Skip to content

Instantly share code, notes, and snippets.

@devymex
Last active February 17, 2021 12:18
Show Gist options
  • Save devymex/814e02fa0d1500b4b2c8abb04ba2bda3 to your computer and use it in GitHub Desktop.
Save devymex/814e02fa0d1500b4b2c8abb04ba2bda3 to your computer and use it in GitHub Desktop.
docker_commands
# conceptions: static images, running containers
docker image ls # list all images
docker image rm IMAGE_NAME # remove image
docker run -t -i -d --rm --env=DISPLAY=$DISPLAY --net=host IMAGE_NAME /bin/bash # run a image
docker exec -it CONTAINER_NAME /bin/bash # enter a container
docker kill CONTAINER_NAME # kill a running container
docker rm CONTAINER_NAME # remove a container
docker ps # list all containers
docker commit CONTAINER_NAME # save container to image
docker cp FILE CONTAINER_NAME:/FILE # copy file from host to container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment