Finding the command used to start a Docker container

Sometimes I want to reuse the command to start a Docker container, if I’m in PowerShell of Bash, I’ll usually have it, but if I’m in the Windows Command Prompt, no chance of finding it!

Another scenario where it’s not possible to know the command is when a third party tool starts the container, like Confluent for their Kafka containers. What you end up with is a container exposing the right ports, configured the right way, and you don’t know how.

Here’s the way to find the command that was used.

  1. Open Docker Desktop
  2. Go to the running Containers page
  3. Click the three dot icon under actions
  4. Click “Copy docker run”
comments powered by Disqus

Related