Skip to content

Instantly share code, notes, and snippets.

@debojyoti
Created November 23, 2022 09:28
Show Gist options
  • Save debojyoti/a6bbfd76d5d0c95195a1083da0e98df0 to your computer and use it in GitHub Desktop.
Save debojyoti/a6bbfd76d5d0c95195a1083da0e98df0 to your computer and use it in GitHub Desktop.
important-commands

docker commands

Start a container

docker run -p HOSTPORT:CONTAINERPORT IMAGE_ID_OR_NAME

List all containers

docker ps -a

Stop a container

docker stop CONTAINER_ID_OR_NAME

Delete a container

docker rm CONTAINER_ID_OR_NAME

Start a shell inside a container

docker exec -it CONTAINER_ID sh

Show logs from a container

docker logs CONTAINER_ID sh

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