docker_images_containers
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| docker_images_containers [2015/10/05 15:52] – luke7858 | docker_images_containers [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Getting a fresh image: | + | ===Getting a fresh image:=== |
| <sxh bash> | <sxh bash> | ||
| docker pull centos:6 | docker pull centos:6 | ||
| Line 14: | Line 14: | ||
| hello-world | hello-world | ||
| </ | </ | ||
| - | Once you have the image downloaded you can create a container with | + | \\ |
| + | ===Creating a container=== | ||
| + | Once you have the image downloaded you can create a container with the following | ||
| ^ Flag ^ Explanation | ^ Flag ^ Explanation | ||
| | -i | Interactive Container | | | -i | Interactive Container | | ||
| Line 27: | Line 29: | ||
| docker run -i -t 72703a0520b7 | docker run -i -t 72703a0520b7 | ||
| </ | </ | ||
| + | \\ | ||
| + | ===Getting back into a container === | ||
| + | If you need to get back into the container to make changes you can run the following command: | ||
| + | <sxh> | ||
| + | docker exec -it container /bin/bash | ||
| + | </ | ||
| + | \\ | ||
| + | === Deleting a container === | ||
| <sxh bash> | <sxh bash> | ||
| + | docker rm imageid | ||
| </ | </ | ||
| <sxh bash> | <sxh bash> | ||
| + | [root@docker ~]# docker rm 0496f8e30329 | ||
| + | 0496f8e30329 | ||
| + | </ | ||
| + | \\ | ||
| + | ===Docker location on host === | ||
| + | Each container is located on the host | ||
| + | \\ | ||
| + | You can view the containers in: | ||
| + | <sxh bash> | ||
| + | / | ||
| </ | </ | ||
docker_images_containers.1444060339.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
