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”…

  • Toribor@corndog.uk
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    I’ve started replacing my docker compose files with pure ansible that is the equivilent of doing docker run. My ansible playbooks look almost exactly like my compose file but they can also create folders, set config files or cycle services when configs are updated.

    It’s been a bit of a learning process but it’s replaced a lot what was previously documentation with code instead.

      • Toribor@corndog.uk
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        ansible-nas

        Wow, yeah this is exactly the sort of roles/playbooks that I’ve been building. I’m definitely using this as a source before starting my own from scratch. Thanks for sharing.

    • xcjs@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I’ve done something similar, but I’m using compose files orchestrated by Ansible instead.

      • Toribor@corndog.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I’m actually doing both right now since I had quite a huge compose file that I haven’t converted to ansible yet. The biggest frustration I have is that there doesn’t seem to be an ansible module that works with compose v2 (the official plugin) which means I’m either stuck on the old version of compose or I have to use shell commands to run stuff like ‘docker compose up -d’.

        One nice thing I’ve gained though is for services like Plex. I have an ‘update’ playbook that I use and it will check to see if Plex is actively streaming before updating the container which isn’t something I could do easily with compose.

        • alteredEnvoy@feddit.ch
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Well the v2 plugin is basically a binary, while v1 is written with Python, which makes it super easy to write an Ansible module

        • xcjs@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          I’m still using the old docker-compose executable - my Docker role is still installing it until the Ansible module catches up.

    • Zephyr@feddit.nl
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I did the same, but I started from my list of run scripts… I used ChatGPT to create them, took 2 minutes…

      • Toribor@corndog.uk
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Hahaha, I’ve been using ChatGPT in the exact same way. It requires a bit of double-checking but it really speeds things up a lot.