Docker quick start (Firefox container as an example)
Below are the minimal commands needed to get a working Mozilla Firefox docker container in Ubuntu.
Install docker client and server
sudo apt-get install docker.io
Allow the docker user to communicate with your X session
xhost +local:docker
Download a Firefox docker image and start it as a container
sudo docker run -v $HOME/Downloads:/home/firefox/Downloads:.rw -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox
Once the image has been downloaded, it can be started with the following command instead:
sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox
Note the id or name of the container. Later if you want to get back to the container, you need that id.
sudo docker attach [id or name]
sudo docker start [id or name>
Before you can run again, one shall stop the container.
First use the following command to look for the id of the container.
sudo docker ps -q -f status=exited
Then issue the rm command against the respective id.
sudo docker rm [id or name]
The list of all docker images can be found through the following command.
sudo docker image -qf "dangling=true"
The images can be deleted using the following command:
sudo docker rmi [id or name]
References
Install docker client and server
sudo apt-get install docker.io
Allow the docker user to communicate with your X session
xhost +local:docker
Download a Firefox docker image and start it as a container
sudo docker run -v $HOME/Downloads:/home/firefox/Downloads:.rw -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox
Once the image has been downloaded, it can be started with the following command instead:
sudo docker run -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox
Note the id or name of the container. Later if you want to get back to the container, you need that id.
sudo docker attach [id or name]
sudo docker start [id or name>
Before you can run again, one shall stop the container.
First use the following command to look for the id of the container.
sudo docker ps -q -f status=exited
Then issue the rm command against the respective id.
sudo docker rm [id or name]
The list of all docker images can be found through the following command.
sudo docker image -qf "dangling=true"
The images can be deleted using the following command:
sudo docker rmi [id or name]
References
- https://docs.docker.com/linux/
- https://github.com/chrisdaish/docker-firefox
- http://www.slashroot.in/dockerfile-tutorial-building-docker-images-for-containers
- https://blog.docker.com/2013/07/docker-desktop-your-desktop-over-ssh-running-inside-of-a-docker-container/
- https://github.com/jlund/docker-chrome-pulseaudio
Comments
Post a Comment