For the vast majority of docker images, the documentation only mention a super long and hard to understand “docker run” one liner.
Why nobody is placing an example docker-compose.yml in their documentation? It’s so tidy and easy to understand, also much easier to run in the future, just set and forget.
If every image had an yml to just copy, I could get it running in a few seconds, instead I have to decode the line to become an yml
I want to know if it’s just me that I’m out of touch and should use “docker run” or it’s just that an “one liner” looks much tidier in the docs. Like to say “hey just copy and paste this line to run the container. You don’t understand what it does? Who cares”
The worst are the ones that are piping directly from curl to “sudo bash”…
you don’t have to decode anything… just throw it in here :
Because it’s “quick start”. Least effort to get a taste of it. For actual deployment I would use compose as well.
Many project also have a example docker-compose.yml in the repository if you dig not so deep into it
There is https://www.composerize.com to convert run command to compose. Works ~80% of the time.
I honestly don’t understand why anyone would make “curl and bash” the officially installation method these days, with docker around. Unless this is the ONLY thing you install on the system, so many things can go wrong.
I used to host composerize. Now I host it-tools which has its own version and many other super helpful tools!
You have changed my life today.
No, the creator of it-tools did. I just told you about it. Give them a star on GitHub and maybe donate if you can ❤️
I too am endlessly frustrated by documentation that lacks compose file examples.
Fortunately, this exists: Docker Compose Generator
it turns out GPT converts plain docker commands into docker compose files well enough to me, it’s been my go-to when I need to create a compose YAML. Checking a YAML and making one or two small corrections is even faster than entering all info in a form like Docker Compose Generator.
Even for the one-liner argument - a better one liner than any docker run is
docker compose up [-d]
.I don’t think you’re out of touch, just use docker compose. It’s not that hard to conver the
docker run
example command line into a neatdocker-compose.yml
, if they don’t already provide one for you. So much better than just running containers manually.Also, you should always understand what any command or docker compose file does before you run it! And don’t blindly
curl | bash
either, download the bash script and look at it first.Nah I’ll just copy paste half the tutorial in one go and then blame others when things break
Average linux user /s
I’m sure someone has written a script to convert docker run commands to compose files.
I am usually customizing variables and tend to use compose for anything I am planning on running in “production”. I’ll use run if it’s a temporary or on-demand use container.
It’s not really that much effort to write a compose file with the variables from a run command, but you do have to keep an eye on formatting.
use chatgpt for that… It can also create your ansible task…
Virgin docker compose. Chad Kubectl apply.
Kubernetes is just docker-compose with extra steps.
/s