0

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

  • 2
    http://stackoverflow.com/questions/19585028/i-lose-my-data-when-the-container-exits might help – reto May 02 '16 at 12:08

1 Answers1

1

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

Ken Cochrane
  • 75,357
  • 9
  • 52
  • 60
  • it seems that I might do something wrong with the policies because the commands that you proposed don't work.. – Angeliki Fydanaki May 04 '16 at 08:21
  • Can you be a little more specific about what doesn't work? Are they giving errors? Are you not seeing any containers when you run `docker ps -a` or any machines when you run `docker-machine ls` ? – Ken Cochrane May 04 '16 at 10:02
  • Can you add that to your question, it is hard to read in the comments. Do you have docker and docker-machine installed on the machine you are running the commands on? – Ken Cochrane May 04 '16 at 13:09
  • I am trying the following "project": (https://cmusatyalab.github.io/openface/) and when I try the commands that you said that's what I get: bash: docker: command not found root@a825d6a1a3dc:/# docker-machine ls bash: docker-machine: command not found. Sorry could be really silly, but I am totally new at the field. – Angeliki Fydanaki May 04 '16 at 13:11
  • It sounds like you don't have docker or docker-machine installed on that machine. How did you install them? – Ken Cochrane May 04 '16 at 17:56