Skip to content

Instantly share code, notes, and snippets.

@marc-barry
Last active April 17, 2019 16:36
Show Gist options
  • Save marc-barry/5c3f725ad0f6dcd8b2094aad3d7dbada to your computer and use it in GitHub Desktop.
Save marc-barry/5c3f725ad0f6dcd8b2094aad3d7dbada to your computer and use it in GitHub Desktop.
Marc's list of useful Docker stuff
# Run interactive TTY
$ docker run -it <image> /bin/sh
$ docker run -it <image> --entrypoint /bin/sh
# Publish a container’s port(s) to the host
$ docker run -p 127.0.0.1:80:80/tcp -it <image>
# Publish all exposed ports to random ports
$ docker run -P -it <image>
# Run a command in a running container
$ docker exec -it <container id> /bin/ash
# Stop all running containers
$ docker stop $(docker ps -a -q)
# Remove all containers
$ docker rm $(docker ps -a -q)
# Remove unused data
$ docker system prune
# Remove all unused images not just dangling ones
$ docker system prune -a
# Get tag list from the registry
$ curl https://docker.internal.digitalocean.com/v2/growth_onboarding/openchannel_proxy/tags/list
# Cleaning up a private registry
https://github.com/fraunhoferfokus/deckschrubber
@omarismail
Copy link

docker network ls
docker network inspect <network_id>

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