Another Docker Cheat Sheet
A quick/pretty basic Docker cheat sheet. Other ones (see Links) are insteresting but I wanted to start my own.
##Prerequisites
None (at least for the time being). This section will be expanded as time goes on.
For the time being, I assume you have Docker installed and running. On my side, I'm currently playing with Scaleway.
Start a container with an interactive shell
docker run --rm -i -t ubuntu /bin/bash
** --rm
: the container will be silently discarded when disconnecting
docker create
creates a container but does not start it.docker run
creates and starts a container in one operation.docker stop
stops it.docker start
will start it again.docker restart
restarts a container.docker rm
deletes a container.docker kill
sends a SIGKILL to a container.docker attach
will connect to a running container.docker wait
blocks until container stops.
docker ps -a
show ALL containers. Omitting the-a
option only show running containers.- [
docker exec -it container /bin/bash
] (https://docs.docker.com/reference/commandline/exec) enters to a running container using a bash shell.
some docker code
The "registry" is a place where local images are stored.
docker images
lists images available in the local registrydocker rmi
remove a specific image from the local registry More infos about managing docker images
docker build -t reponame/name .
build a new image based on the Dockerfile located in the current directory. ** The-t
option is optional (repository name/name) - An optionnal "tag" can be specified.
Misc infos. Keep away the usual mess.
More stuff needs to be added here ! :-)
- This Docker cheat sheet is inspirated from wsarget - Docker cheat sheet
- Nothing (at least for yet)