You are on page 1of 2

Docker Tools and Terms Cheat Sheet

by achang via cheatography.com/39709/cs/12310/

Container Tools Aliases

docker ps lists all currently running containers docker​_build followed by a


docker​_co​mpose

docker ps -a lists all containers (including stopped docker​_bu​ild_js


ones) docker​_bu​‐ builds front-end components using yarn
docker logs shows the output of the given contai​‐ ild_js run compile
CONTAI​NER(S) ner(s) docker​_co​mpose installs depend​encies as defined in
docker rm CONTAI​‐ removes a contai​ner(s) - including any compos​er.lock- does not update
NER(S) local data changes docker​_start runs all containers as defined in
docker rm -f same as docker rm except also force with the
docker​-co​mpo​se.yml

CONTAI​NER(S) stops a contai​ner(s) default command as defined by the image

docker start attempts to start a stopped contai​ner(s) dockerize logs in to aws in order to pull new images

CONTAI​NER(S) src_sync copies source code into all running


containers and makes sure container
docker stop attempts to stop a running contai​ner(s)
source is up to date
CONTAI​NER(S)
docker​_ca​che​‐ runs CacheC​lea​rCo​mmand
in order to
docker restart stops and then starts the specified
_clear remove cached assets
CONTAI​NER(S) contai​ner(s)
docker​_ca​che​‐ rm -rf app/cache
docker cp SRC DEST copies files to/from a specific container
_fo​rce​_clear
to a local location
container location format: CONTAI​‐ docker​_ru​n_s​‐ runs a single phpUnit test file
NER​:PA​TH_​ON_​CON​TAINER ing​le_test
TEST_F​ILE​_LO​‐
docker exec -it starts a bash terminal session in the
CONTAINER specified CATION
CONTAINER bash
cmd starts a new container using the scriptbox
image and starts an intera​ctive bash
session

By achang Published 17th July, 2017. Sponsored by ApolloPad.com


cheatography.com/achang/ Last updated 29th August, 2017. Everyone has a novel in them. Finish
Page 1 of 2. Yours!
https://apollopad.com
Docker Tools and Terms Cheat Sheet
by achang via cheatography.com/39709/cs/12310/

Terms Docker ps columns

Image A snapshot of a lightw​eight filesystem in order to run NAMES Interc​han​geable with CONTAINER ID - used to
specific tasks reference a specific container
Container An instan​tiation of an enviro​nment created from a CONTAINER Interc​han​geable with NAMES - used to reference a
specific image ID specific container
Fileca​‐ A file mount that is shared across all containers IMAGE Image that the container enviro​nment is running on
binet
COMMAND Command(s) that the container is runs when started
CREATED Date when container was first created
Troubl​esh​ooting
STATUS Current status of container - will also display exit
docker ps -a use to see which containers are not
codes
starting if linking errors occur
PORTS Displays external -> internal port mapping and
docker logs use to see specific logs and errors for a
protocal
CONTAINER container to trouble shoot bad exit codes

src_sync use if logs reveal that files cannot be found xdebug - docker native
docker​_bu​‐ use if parame​ter​s/d​epe​nde​ncies seem to sudo ifconfig lo0 alias 10.254.25​4.254
ild​/bu​ild​‐ be incorrect
docker exec -it webserver bash
_js​/co​mpose
vi /etc/p​hp.d​/x​deb​ug.ini
docker rm use if a file is corrupt in a container
press i to be able to edit, arrows to navigate
CONTAINER NOTE: DO NOT REMOVE *_data
CONTAINERS AS THEY WILL TAKE A set xdebug.re​mot​e_c​onn​ect​_back=0
LONG TIME TO DOWNLOAD set xdebug.re​mot​e_h​ost​=10.25​4.2​54.254
docker​_ca​che​‐ use if annota​tions or other cached assets set xdebug.re​mot​e_a​uto​start=1
_cl​ear​/do​cke​‐ seem to be corrup​t/not updating
to save and quit from vi:
r_c​ach​e_f​orc​‐
press esc
e_clear
type :wq

press enter

exit to get out of the container

run docker restart webserver in order to have the new config


values take place

By achang Published 17th July, 2017. Sponsored by ApolloPad.com


cheatography.com/achang/ Last updated 29th August, 2017. Everyone has a novel in them. Finish
Page 2 of 2. Yours!
https://apollopad.com

You might also like