Unix Container: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==Container Howto== * Install and run a container <pre>docker run -i -t ubuntu:14:04 /bin/bash</pre> * Commit (Create an image from a container) "b5673dbced61" is an image i...") |
|||
Line 1: | Line 1: | ||
==Container Howto== | ==Container Howto== | ||
===Install and run a container=== | |||
<pre>docker run -i -t ubuntu:14:04 /bin/bash</pre> | <pre>docker run -i -t ubuntu:14:04 /bin/bash</pre> | ||
===Create an image from a container Commit=== | |||
"b5673dbced61" is an image id | |||
<pre>docker commit -m "Ubuntu 14.10 Demonstrator" -a "Author Name" b5673dbced61 demo:14.10</pre> | <pre>docker commit -m "Ubuntu 14.10 Demonstrator" -a "Author Name" b5673dbced61 demo:14.10</pre> | ||
===List Images (Source to initiare a containers)=== | |||
<pre>docker images</pre> | <pre>docker images</pre> | ||
===Remove an image "b5673dbced61" is an image id=== | |||
<pre>docker rmi b5673dbced61 </pre> | <pre>docker rmi b5673dbced61 </pre> | ||
===List containers (Running Virtual Machines)=== | |||
<pre> docker ps</pre> | <pre> docker ps</pre> | ||
===Remove a container=== | |||
"d0955f21bf24" is a container Id | |||
<pre>docker rm d0955f21bf24</pre> | <pre>docker rm d0955f21bf24</pre> | ||
===Remove all containers=== | |||
<pre>docker stop $(docker ps -a -q) | <pre>docker stop $(docker ps -a -q) | ||
docker rm $(docker ps -a -q)</pre> | docker rm $(docker ps -a -q)</pre> | ||
===Execute more advances=== | |||
<pre>docker run -i -t --net="bridge" --name Demo -v /opt/docker/data mindesktop:v01.01</pre> | <pre>docker run -i -t --net="bridge" --name Demo -v /opt/docker/data mindesktop:v01.01</pre> |
Revision as of 16:26, 29 March 2015
Container Howto
Install and run a container
docker run -i -t ubuntu:14:04 /bin/bash
Create an image from a container Commit
"b5673dbced61" is an image id
docker commit -m "Ubuntu 14.10 Demonstrator" -a "Author Name" b5673dbced61 demo:14.10
List Images (Source to initiare a containers)
docker images
Remove an image "b5673dbced61" is an image id
docker rmi b5673dbced61
List containers (Running Virtual Machines)
docker ps
Remove a container
"d0955f21bf24" is a container Id
docker rm d0955f21bf24
Remove all containers
docker stop $(docker ps -a -q) docker rm $(docker ps -a -q)
Execute more advances
docker run -i -t --net="bridge" --name Demo -v /opt/docker/data mindesktop:v01.01