Skip to content

Instantly share code, notes, and snippets.

@pocmo
Last active March 6, 2018 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pocmo/489ff411df3f5bd5cf3cd6183e183df0 to your computer and use it in GitHub Desktop.
Save pocmo/489ff411df3f5bd5cf3cd6183e183df0 to your computer and use it in GitHub Desktop.
# See all local images
docker images
# Start bash in image
docker run -it <image> /bin/bash
# Show all containers
docker ps -a
# Join container
docker attach <container>
# Copy file form container to host
docker cp <containerId>:/file/path/within/container /host/path/target
# Build image from Dockerfile with tag
docker build -t foo/bar .
# Push image to Docker hub
docker push foo/bar
# Pull image from Docker hub
docker pull foo/bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment