Skip to content

Instantly share code, notes, and snippets.

@realdubb
Last active November 28, 2019 04:21
Show Gist options
  • Save realdubb/99ca353029a088de841a918bf70161cc to your computer and use it in GitHub Desktop.
Save realdubb/99ca353029a088de841a918bf70161cc to your computer and use it in GitHub Desktop.
docker cheatsheet

Show images

docker image ls

Remove image

docker image rm <id>

Show all containers

docker ps -a

Build image from Dockerfile within application directory

docker build -t <image-name> .

Run container (daeomonized -d, cleanup option --rm, expose/forward port 3030 -p)

docker run -d --rm -p 3030:3030 --name <custom-name> <image>

Access container terminal

docker exec -i -t <container-id> /bin/bash

Update docker service image

docker service update --image <image-url/name:tag> --with-registry-auth <service-name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment