Skip to content

Instantly share code, notes, and snippets.

@LukaszWiktor
Last active August 1, 2020 08:24
Show Gist options
  • Save LukaszWiktor/de6d0852d54f6418f896e605dcb8df19 to your computer and use it in GitHub Desktop.
Save LukaszWiktor/de6d0852d54f6418f896e605dcb8df19 to your computer and use it in GitHub Desktop.

Build image

docker build --tag <image tag>

Run container exposing port 4444 and mounting /views directory

docker run -p 4444:4444 /${PWD}/views:/code/views <image tag>

List running containers

docker ps

List mounted volumes

docker inspect -f '{{ json .Mounts }}' <container name> | jq

Run bash shell in a container

docker exec -it <container name> /bin/bash

Stop container

docker stop <container name>

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