News for hackers. Stuff that matters.
Re:Awesome projects from the Docker community by dsissitka on Sunday July 28, 2013 @12:41PM (#6117149)
> ...but won't all data be erased when you close the container?

No, containers aren't ephemeral:

  $ docker run -i -t base /bin/bash
  root@d675bee3cbdb:/# echo 'Hello, world!' > /foo   
  root@d675bee3cbdb:/# exit
  $ docker restart d675bee3cbdb
  d675bee3cbdb
  $ docker attach d675bee3cbdb
  root@d675bee3cbdb:/# cat /foo
  Hello, world!
  root@d675bee3cbdb:/#
Re:Awesome projects from the Docker community by StavrosK on Sunday July 28, 2013 @12:44PM (#6117159)
Weird, they were for me. I guess I was probably starting the base image again? Where do you get the modified id from?
Re:Awesome projects from the Docker community by dsissitka on Sunday July 28, 2013 @01:22PM (#6117266)
> Weird, they were for me.

Were you using volumes? Currently a container's volumes are reset when the container is restarted. That's fixed in master.

> Where do you get the modified id from?

In this case I just copied it from the container's command prompt. It's also available via docker ps -a:

  $ docker run base sleep 1
  $ docker ps -a
  ID                  IMAGE               COMMAND             CREATED             STATUS              PORTS
  041d889d7bd8        base:latest         sleep 1             5 seconds ago       Exit 0                                
  $
Re:Awesome projects from the Docker community by StavrosK on Sunday July 28, 2013 @02:13PM (#6117496)
Apparently I don't know how to use docker. You are right, I was just starting the base image every time. Starting it creates a new container which you can find with "ps -a", and you can start/attach to it later the way you said. Thanks for the tip, I need to find a good tutorial or write one.
Re:Awesome projects from the Docker community by StavrosK on Sunday July 28, 2013 @01:26PM (#6117283)
Hmm, no, I wasn't using volumes. I was doing "docker ps", but didn't notice (or didn't know to use) an id, so I just did "docker run Ubuntu etc".