This is a draft cheat sheet. It is a work in progress and is not finished yet.
Containers
create |
creates a container but does not start it. |
run |
creates and starts a container in one operation. |
stop |
stops it. |
start |
will start it again. |
restart |
restarts a container. |
rm |
deletes a container. |
kill |
sends a SIGKILL to a container. |
attach |
will connect to a running container. |
wait |
blocks until container stops. |
Info
ps |
shows running containers. |
logs |
gets logs from container. |
inspect |
looks at all the info on a container (including IP address). |
events |
gets events from container. |
port |
shows public facing port of container. |
top |
shows running processes in container. |
stats |
shows containers' resource usage statistics. |
diff |
shows changed files in the container's FS. |
Import / Export
cp |
copies files or folders out of a container's filesystem. |
export |
turns container filesystem into tarball archive stream to STDOUT. |
Executing Commands
exec |
to execute a command in container. |
|
|
Images
images |
shows all images. |
import |
creates an image from a tarball. |
build |
creates image from Dockerfile. |
commit |
creates image from a container. |
rmi |
removes an image. |
insert |
inserts a file from URL into image. (kind of odd, you'd think images would be immutable after create) |
load |
loads an image from a tar archive as STDIN, including images and tags (as of 0.7). |
save |
saves an image to a tar archive stream to STDOUT with all parent layers, tags & versions (as of 0.7). |
Info
history |
shows history of image. |
tag |
tags an image to a name (local or registry). |
Registry & Repository
login |
to login to a registry. |
search |
searches registry for image. |
pull |
pulls an image from registry to local machine. |
push |
pushes an image to the registry from local machine. |
Dockerfile
FROM |
<image>:<tag> |
MAINTAINER |
<name> |
RUN |
<shell command> |
CMD |
<command> |
EXPOSE |
<port> |
ENV |
<key> <value> |
ADD |
<src>... <dest> |
COPY |
<src>... <dest> |
ENTRYPOINT |
command param1 param2 |
VOLUME |
["/data"] |
USER |
daemon |
WORKDIR |
/path/to/workdir |
ONBUILD |
[INSTRUCTION] |
|