Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to restart stopped containers instead of images? #17

Closed
mviereck opened this issue Nov 17, 2017 · 0 comments
Closed

Is there any way to restart stopped containers instead of images? #17

mviereck opened this issue Nov 17, 2017 · 0 comments
Labels

Comments

@mviereck
Copy link
Owner

mviereck commented Nov 17, 2017

@ugallu wrote:

Is there any way to restart stopped containers with x11docker, instead of images? (I tried committing containers as images and running them, but it failed)

For some reasons I decided to work with images only instead of restarting containers. Most important, docker expects mounted volumes to exist on host even for stopped containers; this becomes an issue with X sockets in /tmp/.X11-unix. Those sockets only exist while the X server is up and running. After a reboot, docker misses this X socket and creates a useless and annoying folder in /tmp/.X11-unix as a replacement.

If you wish to have persistant changes in user configuration and files, x11docker provides options --home and --homedir. For changes in the system itself, especially installing additional applications, I recommend to create a new image. Example dockerfile:

FROM x11docker/xfce
RUN apt-get update
RUN apt-get install -y firefox

Build a new image based on this dockerfile, and you have a good and maintainable base.


A possibility I did not test out well:

While the container is up and running, you can create a new image from the container with docker commit containernumber mynewimage. This new image can be started with x11docker.

Is there a special reason why you want to reuse containers instead of creating new ones?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant