Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created January 12, 2018 22:06
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 niraj-shah/9f660ee8a15f9908836baca30fc5a48f to your computer and use it in GitHub Desktop.
Save niraj-shah/9f660ee8a15f9908836baca30fc5a48f to your computer and use it in GitHub Desktop.
Docker Usage and Examples
# get list of docker images
docker images
# build docker image
docker build -t <repo>/<name>:<version> ./path/to/directory
# example: docker build -t nirajshah/php7:v0.3 .
# run a command in container
docker run <img_id> <command>
# example: docker run bbd53c8ffa96 php -v
# push image to docker & publish
docker push <repo>/<name>:<version>
# example: docker push nirajshah/php7:v0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment