Docker.how – Docker command cheat sheet

55 pointsposted 12 hours ago
by anagogistis

18 Comments

mmh0000

7 hours ago

I am so not understanding the purpose of this...

If you need Docker CLI commands, isn't it just easier to use the CLI that you're already on?

Docker is fully self-documented:

    / # docker
  Usage:  docker [OPTIONS] COMMAND
  
  A self-sufficient runtime for containers
  
  Common Commands:
    run         Create and run a new container from an image
    exec        Execute a command in a running container
  
  …SNIP…
  
  / # docker run --help
  Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
  
  Create and run a new container from an image
  
  Aliases:
    docker container run, docker run
  
  Options:
        --add-host list                    Add a custom host-to-IP mapping (host:IP)

  …SNIP…

fragmede

4 hours ago

Are you on a desert island with no access to the Internet? If you don't know docker, what's faster? Reading all of the documentation first and then figuring out the difference between, say, run and exec, or just copy and pasting a command from a tutorial until it sinks in and you gain a better understanding? This is the AI information age. If docker has eaten your hard drive, and again, you don't know docker, is it easier to have ChatGPT tell you, or muddle around with ps, rm, images, rmi and all of the various options.

If you have a command with a bunch of flags, static documentation like man pages are just such a poor interface compared to eg explainshell.com. This opinion obviously gets me thrown out of the Unix grey beards club, but I don't have a beard and it's not grey.

rendaw

2 hours ago

How do you know which command to copy and paste? Unless you're suggesting to just try them randomly until you get one that seems to do what you want.

There are plenty of commands where the documentation is nearly impenetrable (e.g. ffmpeg, or if it exists at all), but I think GP's point was that for docker it's fairly simple.

IMO except for the concrete examples for docker run/exec, this website looks more or less exactly like the CLI help output for docker.

ZpJuUuNaQ5

10 hours ago

What bothers me the most about LLM-generated CSS is the inclusion of these long and completely unnecessary transitions. Every single time, it's the transform on hover and opacity+transform on page load. Why? I haven't noticed these patterns that often on popular sites, but for AI-generated UIs this seems to be the default. If you hover on elements and switch pages frequently, these animations become annoying really quickly.

DJBunnies

9 hours ago

Do folks not leverage built in help commands anymore?

I must be getting old.

koolba

5 hours ago

Just wait till these whippersnappers find out about man page.

amstan

4 hours ago

I keep hearing podman is better, especially for local setups. Does anyone know any podman cheatsheets similar to this or is it pretty much s/docker/podman?

GCUMstlyHarmls

an hour ago

I've used podman for number of years, possibly too long to really give a good comparison but for the most part it is exactly s/docker/podman. Can't think of anything I've read on the internet that I couldn't just copy the tail of and stick podman in front of it. Any run/build/inspect/volumes/secrets/etc all work like for like by design afaik. There may be additional flags on podmans end for other things it supports (eg: selinux labels).

EDIT: Actually the biggest might be that containers often need a fully qualified name, so instead of `run name/container:latest` you need `run docker.io/name/container:latest`. You can configure default search domains though.

The biggest thing people will (did?) miss is docker-compose. There was a third party `podman-compose` but now it seems that's actually been folded under the official umbrella, along with a `podman compose` command that will "Run compose workloads via an external provider such as docker-compose or podman-compose" so even that gap might be closed up now. Honestly I swapped to just scripting it myself when I swapped to podman - before even the third party podman compose existed, either using sh, .kube files or now systemd units. If you're used to using big 5-10+ container compose files you might have some friction there, might not.

There are differences internally, ex: docker primarily runs as root and has a different networking stack compared to podman, but for most usage on a dev machine it doesn't matter, and matters maybe in a deployment, maybe not.

Unsolicited opinion, I originally found Podman much less intrusive, dockers iptable muckery always rubbed me the wrong way, so it defaulting to userspace and just letting me do any nftable routing I wanted felt much nicer. It also just fees less icky when using it where its default or configuration options were less funnel-you-into-docker.com.

https://github.com/containers/podman-compose

internet2000

8 hours ago

"Hey Claude, can you list the docker containers I have running, find the one using the uv:debian-slim image, and copy main.py from the app folder in it onto my pwd" ← No cheat sheet needed.

lifetimerubyist

8 hours ago

Some people don’t want to spend $30 per month to not learn things.

anagogistis

11 hours ago

I wanted a Docker cheat sheet that's actually nice and accessible from anywhere. So I built one with help from Claude Code and shipped it in ~1 hour. Feedback is welcome.

tomhow

8 hours ago

Thanks for submitting this. We're happy for anything to be submitted that the community finds useful. But “I built one with help from Claude Code and shipped it in ~1 hour” doesn't really clear the bar for a good Show HN. It's not really “something you've made that other people can play with”; it's more of a list of commands, and lists are explicitly outside the scope of Show HNs. For that reason we've removed the “Show HN” prefix.

https://news.ycombinator.com/showhn.html

crtasm

9 hours ago

Did you test all the examples to confirm they work as expected and none of the attributes are obsolete?