What's the best way to move docker-machine machines (remote not local host) from one computer to another (osx to windows). I have to change the config.json files for all the machines so it works on another computer, because the path to the certs and machine are all hardcoded in the config file.
while this approach works, it's a bit tedious if we need to share them with everyone on the team. Is there a way to export or import the machine? or there are other ways to archive what I am trying to do.
To import an exported container as an image, we use the docker import command. The documentation describes import as follows: docker import – Import the contents from a tarball to create a filesystem image. As you can see, Docker happily runs our exported file system, which we can then attach to and explore.
Q8. Which command is used to import a pre-exported Docker image into another Docker host? Ans. We can import a pre-exported Docker image into another Docker host using the docker load command.
Until this feature gets implemented natively (see Issue 23), you can use this import/export script I've written.
https://gist.github.com/schickling/2c48da462a7def0a577e
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - digitalocean Running tcp://example.com:2376 v1.10.1
$ ./docker-machine-export.sh dev
Exported machine to dev.zip
$ ls
docker-machine-import.sh
docker-machine-export.sh
dev.zip
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
$ ./docker-machine-import.sh dev.zip
Exported machine to dev.zip
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - digitalocean Running tcp://example.com:2376 v1.10.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With