Skip to content

Instantly share code, notes, and snippets.

@asalhani
Created June 2, 2019 08:45
Show Gist options
  • Save asalhani/b415d10864a83bfdc385c990247a7f4a to your computer and use it in GitHub Desktop.
Save asalhani/b415d10864a83bfdc385c990247a7f4a to your computer and use it in GitHub Desktop.
Docker Commands
# list images
docker image ls
# build image from Dockerfile
docker image build -t "<name>:latest" <dockerfile_path>
ex:
docker image build -t "custom-ubu" Dockerfile
# remove image
docker image rm <image_name>
ex:
docker image rm custom-ubu
# run container from image
docker run -i -d -it custom-ubu
# attach to bash of running container
docker attach <container_name_or_id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment