Snippets for yer computer needs


Installing on Mac

brew cask install docker


# list all containers
docker ps -a
# remove a container
docker rm [container_id|name]
# restart a container
docker restart [container]
# build a docker image from a Dockerfile
docker build -t TAGNAME . # in dir of Dockerfile
# create a docker container
docker create TAGNAME
# create and run a docker container, open a shell
docker run --name CONTAINERNAME -it

Docker compose

docker-compose up

Docker stack


Dockerfile syntax

Must use “, not ‘

FROM image_name:image_tag
MAINTAINER person <person@example.org>
RUN install_things
CMD ["executable", "--to", "--run"]