Skip to content

Instantly share code, notes, and snippets.

@Dulani
Last active October 17, 2018 05:23
Show Gist options
  • Select an option

  • Save Dulani/3d2ccb60dfbe00726354eecc827b1bf5 to your computer and use it in GitHub Desktop.

Select an option

Save Dulani/3d2ccb60dfbe00726354eecc827b1bf5 to your computer and use it in GitHub Desktop.
Favorite commands for use with Docker

Docker Favorites

Build an image with a dockerfile: docker build - < Dockerfile

Add a name to the image (after building it):

docker tag <image ID> <image name>:latest

e.g. docker tag dbfee88ee9fd windowsservercore:latest (Source)

Mount an external path:

docker run -it -v <host path>:<guest or image/container path> <container id> /bin/bash

Run bash to explore an image (use exec if the container is running):

docker run -it <container id> /bin/bash

Enabling gdb within a docker container:

docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined (Source)

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