About
Easy to use shortcuts for developers
Whether you are new to Containers or have experience, you may find yourself encountering tasks you haven’t done lately. That is where the cheat sheet can help.
In this Containers cheat sheet, you will find:
- Introduction to container architecture
- Engine, image, registry, and volume-related commands
- Example of running a web server container
Save this cheat sheet or print to take it with you.
Excerpt
docker
CLI- Container Related Commands
docker [CMD] [OPTS] [CONTAINER]
Examples
All examples shown work in Red Hat Enterprise Linux
- Run a container in interactive mode:
#Run a bash shell inside an image
$ docker run -it rhel7/rhel bash
#Check the release inside a container
[root@.../]# cat /etc/redhat-release
- Run a container in detached mode:
$ docker run --name mywild y -d -p 8080:8080 jboss/wild y
- Run a detached container in a previously created container network:
$ docker network create mynetwork
$ docker run --name mywild y-net -d --net mynetwork
-p 8080:8080 jboss/wild y
- Run a detached container mounting a local folder inside the container:
$ docker run --name mywild y-volume -d
-v myfolder/:/opt/jboss/wild y/standalone/deployments/
-p 8080:8080 jboss/wild yjboss/wild y
- Follow the logs of a specific container:
$ docker logs -f mywild y
$ docker logs -f [container-name]
- Run a container in interactive mode:
- Container Related Commands