This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
doc:docker [2015/05/04 21:05] stwn [Creating Docker Container] minor fix |
doc:docker [2015/05/08 10:41] (current) stwn [Creating Custom Docker Image] minor fix |
||
|---|---|---|---|
| Line 20: | Line 20: | ||
| openssh-server openssh-client \ | openssh-server openssh-client \ | ||
| asterisk</code> | asterisk</code> | ||
| - | * Build docker container based on the dockerfile.<code># docker build -t ${USER}/asterisk:test0 dockerfile</code> | + | * Build docker container based on the dockerfile.<code># docker build -t ${USER}/asterisk:test0 - < dockerfile</code> |
| ===== Frequently Used Commands ===== | ===== Frequently Used Commands ===== | ||
| + | * Restart docker service with systemd:<code># systemctl restart docker.service</code> | ||
| * Show images:<code># docker images | * Show images:<code># docker images | ||
| REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE | REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE | ||
| stwn/minbase latest d816657c5182 3 minutes ago 123.7 MB | stwn/minbase latest d816657c5182 3 minutes ago 123.7 MB | ||
| scratch latest 511136ea3c5a 22 months ago 0 B</code> | scratch latest 511136ea3c5a 22 months ago 0 B</code> | ||
| - | * Show all running containers: <code># docker ps -a</code> | + | * Remove image:<code># docker rmi [IMAGE ID]</code> |
| - | * Remove image: <code># docker rmi <image></code> | + | * Commit change:<code># docker commit [IMAGE ID] ${USER}/asterisk:test1</code> |
| + | * Show all running containers:<code># docker ps -a</code> | ||
| + | * Remove container:<code># docker rm [CONTAINER ID]</code> | ||
| + | |||
| + | ===== Networking in Docker ===== | ||
| + | There is a network interface named docker0 when we run Docker engine. This interface connected as a (virtual Ethernet) bridge to containers inside Docker and configured with private ip address/network. | ||