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 up
version: "3.8"
services:
api:
build:
dockerfile: ./Dockerfile.api
ports:
- 4567:4567
links:
- url_cache
url_cache:
image: memcached
https://docs.docker.com/engine/reference/commandline/stack/
Must use ", not '
FROM image_name:image_tag
LABEL maintainer="person <[email protected]>"
RUN install_things
CMD ["executable", "--to", "--run"]
docker logs <CONTAINER>
See also /var/lib/docker/containers/<ID>/<ID>-json.log
docker run -d -p 5000:5000 --restart=always --name registry registry:2
https://podman.io/blogs/2019/01/16/podman-varlink.html
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
# Install hab
brew tap habitat-sh/habitat
brew install hab
# Setup
hab cli setup