Angeliki Fydanaki
Angeliki Fydanaki

Reputation: 11

save installations at Docker

I am using Docker machine for a project, but I cannot find a way to save my installations(eg when I install libraries like numpy,pandas etc). Every time that I switch off my laptop and hence the Docker machine I lose them. I tried the following: docker-machine restart dev, from https://docs.docker.com/machine/reference/restart/ ,but still doesn't work. Is there a way to keep the installations and avoid installing them every time I turn on the laptop?

Thx in advance

Upvotes: 0

Views: 75

Answers (1)

Ken Cochrane
Ken Cochrane

Reputation: 77325

They should still be there unless you are removing them when you shut down your machine.

If you do a docker-machine ls it will show you the machines you have installed, if you see one you like you can

docker-machine start <name>

Once started you need to set your env variables

docker-machine env <name> 

And copy the variables into your shell or eval them

eval $(docker-machine env <name>)

Now that you are linked to the machine you can see all of your running containers

docker ps

Or to see all even the ones that are stopped

docker ps -a

My guess is that your containers have stopped and you just need to start them again. If you set the restart policies correctly on container create they will restart automatically when the machine restarts

Upvotes: 1

Related Questions