ricardobranco777 / docker-volumes.sh Goto Github PK
View Code? Open in Web Editor NEWThe docker-export and docker-commit commands do not save the container volumes. Use this script to save and load the container volumes.
License: MIT License
The docker-export and docker-commit commands do not save the container volumes. Use this script to save and load the container volumes.
License: MIT License
I am trying your script and it give me error docker-volumes.sh command not found
and do let me know what to used instead of this $USER@$HOST I mean username and host IP of other host machine or simply as it is ??
when run sh file show error :
docker-volumes.sh: 14: docker-volumes.sh: [[: not found
docker-volumes.sh: 14: docker-volumes.sh: dockermagento2_web_1: not found
docker-volumes.sh: 19: docker-volumes.sh: Syntax error: "(" unexpected (expecting "then")
Hi.
I'm trying to use this great script but currently is not saving the volumes.
Docker version 18.09.9-ce, build 039a7df on both instances.
Steps:
docker run -it --name http -d -p 9098:80 -v data-volume:/usr/local/apache2/htdocs httpd:2.4
docker inspect -f '{{ .Mounts }}' http [{volume data-volume /var/lib/docker/volumes/data-volume/_data /usr/local/apache2/htdocs local z true }]
docker stop 6d70038e617b
docker commit 6d70038e617b web
docker save -o web.tar web
docker-volume.sh 6d70038e617b save web_volumes.tar
Switch to another host/machine
docker load -i web.tar
docker create -p 9098:80 --name web web
docker-volumes.sh -v web load web_volume.tar
usr/local/apache2/htdocs/
usr/local/apache2/htdocs/index.html
docker start web
docker inspect -f '{{ .Mounts }}' web []
The volumes is not loaded. Any help is appreciate.
Thanks in advance.
I think script should only backup mounts with type: "volume", and not e.g. "bind". or add option to do so.
I save the container and volume following your guide
Then, at windows 10 cmd
D:\test>docker create --name testimage1.tar testimage1
Unable to find image 'testimage1:latest' locally
Error response from daemon: pull access denied for testimage1, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Hi
thanks for sharing your script.
I'm having trouble on using it, am I doing right?
sudo ./docker-volumes.sh -v mynodered save nodered-copy.tar
This is the container I'm trying to save
container-id nodered/node-red-docker:v8 "npm start -- --user…" 5 weeks ago Up About an hour mynodered
I tried using name (mynodered) and container-id, with no success.
The error I get is
tar: //tmp.elTZ0QK1kg/nodered-copy.tar: Cannot open: Is a directory
tar: Error is not recoverable: exiting now
What can I do?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.