Hello, fellow Linux users!

My question is in the titel: What is a good approach to deploy docker images on a Raspberry Pi and run them?

To give you more context: The Raspberry Pi runs already an Apache server for letsencrypt and as a reverse proxy, and my home grown server should be deployed in a docker image.

To my understanding, one way to achieve this would be to push all sources over to the Raspberry Pi, build the docker image on the Raspberry Pi, give the docker image a ‘latest’ tag and use Systemd with Docker or Podman to execute the image.

My questions:

  • Has anyone here had a similar problem but used a different approach to achieve this?
  • Has anyone here automated this whole pipeline that in a perfect world, I just push updated sources to the Raspberry Pi, the new docker image gets build and Docker/Podman automatically pick up the new image?
  • I would also be happy to be pointed at any available resources (websites/books) which explain how to do this.

At the moment I am using Raspbian 12 with a Raspberry Pi Zero 2 W and the whole setup works with home grown servers which are simply deployed as binaries and executed via systemd. My Docker knowledge is mostly from a developer perspective, so I know nearly nothing about deploying Docker on a production machine. (Which means, if there is a super obvious way to do this I might not even be aware this way exists.)

  • hades@lemm.ee
    link
    fedilink
    arrow-up
    3
    ·
    1 day ago

    systemd has nothing to do with docker, except to start the docker daemon.

    I think what OP was describing was writing systemd unit files that would start/stop docker containers.

    • wolf@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Exactly, this is what I am doing right now (just for binaries, not execute Docker or Podman).

    • CameronDev@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Yeah, probably, but thats not very common is it? Normally you’d just let the docker daemon handle the start/stop etc?

      • hades@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        I actually have no sense how common that is. My experience is with very small non-production docker environments, and with Kubernetes, but I have no idea what people typically do in between.

        • med@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          17 hours ago

          It’s common with rootless docker/podman. Something needs to start up the services, and you’re not using a root enabled docker/podman socket, so systemd it is.

      • hades@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Well, someone needs to run docker compose up, right? (or you set restart policy, but that’s not always possible)