Show Menu
Cheatography

docker, docker-compose, Node Cheat Sheet (DRAFT) by

Common commands for building configurations with docker and docker-compose

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Docker Workflow

Command
Effect
Link
docker image ls
list docker images
docker [container ls | ps]
list running containers
docker [container ls --all | ps -a]
list all docker containers
docker build [tag=
label
]
path
build an image from a docker­file; path is usually . (current dir)
docker run <im­age>
run an image
docker rmi <im­age>
remove image
docker rm <co­nta­ine­r>
remove container
 
connect to remote

Compose

docker­-co­mpose up
run current compose file
docker­-co­mpose -f <fi­len­ame> up
run specified compose file
-f is nice for running various config­s/build processes within one project

General Docker­/Co­mpose

Connect (inter­active) to container
docker exec -it <cont name> /path/­to/­shell
 

npm workflow

Command
Effect
Link
npm init
generate packag­e.json in pwd
npm i|install
<pk­g[,­pkg­]>
[-P]
save prod dep to packag­e.json
npm i
<pk­g[,­pkg­]>
-D
save dev dep to packag­e.json
npm i
<pk­g[,­pkg­]>
@
1.2.3
save specific version