Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
39 Cards in this Set
- Front
- Back
shows running containers. |
docker ps |
|
gets logs from container |
docker logs |
|
looks at all the info on a container (including ip) |
docker inspect. |
|
gets events from container |
docker events |
|
shows public facing port of container |
docker port |
|
shows running processes in container |
docker top |
|
shows containers' resource usage statistics |
docker stats |
|
shows changed files in the container's FS. |
docker dif |
|
show running and stopped containers |
docker ps -a |
|
copies files or folders between a container and the local filesystem |
docker cp |
|
turns container filesystem into tarball archive stream to STDOUT |
docker export |
|
to execute a command in container |
docker exec |
|
To enter a running container, attach a new shell process to a running container called foo, use: |
docker exec -it foo /bin/bash. |
|
show all images |
docker images |
|
creates and image from a tarball |
docker import |
|
creates image from Dockerfile |
docker build |
|
creates image from a container |
docker commit |
|
removes an image |
docker rmi |
|
loads an image from a tar archive as STDIN, including images and tags (as of 0.7). |
docker load |
|
saves an image to a tar archive stream to STDOUT with all parent layers, tags & versions (as of 0.7). |
docker save |
|
shows history of image |
docker history |
|
tags an image to a name (local or registry) |
docker tag |
|
to login to a registry |
docker login |
|
searches registry for image |
docker search |
|
pulls an image from registry to local machine |
docker pull |
|
pushes an image to the registry from local machine |
docker push |
|
Run local registry |
Registry implementation has an official image for basic setup that can be launched with docker run -p 5000:5000 registry Note that this installation does not have any authorization controls. You may use option -P -p 127.0.0.1:5000:5000 to limit connections to localhost only. In order to push to this repository tag image withrepositoryHostName:5000/imageName then push this tag. |
|
DockerFile commands/files |
.dockerignore FROM MAINTAINER RUN CMD EXPOSE ENV ADD COPY ENTRYPOINT VOLUME USER WORKDIR ONBUILD |
|
how to start containers to only communicate through links |
start the docker daemon with -icc=false to disable inter process communication. |
|
set an exposed port and link it. |
In the dockerfile include to container named Container: EXPOSE 1337 The to bring up the server linked to: docker run -d --link CONTAINER:ALIAS --name LINKED user/wordpress Then the exposed ports and aliases of CONTAINER will show up in LINKED with the following environment variables: $ALIAS_PORT_1337_TCP_PORT$ALIAS_PORT_1337_TCP_ADDR |
|
how to rm a link |
docker rm --link |
|
LINKS |
are how containers talk to each other through tcp/ip ports |
|
how to run a container in the background ( detached) |
-d $ docker run --name redis -d /redis |
|
how to map container port to host port. |
docker run -p 127.0.0.1:$HOSTPORT:$CONTAINERPORT --name CONTAINER -t someimage |
|
set a container to read only |
docker run --read-only |
|
verify images with a hashsum: |
docker pull debian@sha256:a25306f3850e1bd44541976aa7b5fd0a29be |
|
set volumes to be read only |
docker run -v $(pwd)/secrets:/secrets:ro debian |
|
set memory and cpu sharing |
docker -c 515 -mem 512m |
|
Define and run a user in your Dockerfile so you don't run as root inside the container: |
RUN groupadd -r user && useradd -r -g user userUSER user |