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 createcreates a container but does not start it.docker runcreates and starts a container in one operation.docker stopstops it.docker startwill start it again.docker restartrestarts a container.docker rmdeletes a container.docker killsends a SIGKILL to a container.docker attachwill connect to a running container.docker waitblocks until container stops.
docker ps -ashow ALL containers. Omitting the-aoption 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 imageslists images available in the local registrydocker rmiremove 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-toption 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)