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.)
So you’re building your own images? I’m sure there’s a way to build, transfer, and run an image. But you might just set up a local registry. Or just throw them up on a free registry like GitHub.
My development machine is an AMD64 and the Pi is an Aarch64… I have no clue how complicated cross-building images for a different architecture is?!? (I am thinking about using something like Erlang/Elixir, so I honestly don’t know at all.)
I am not totally opposed to use a registry (free or payed), but, correct me if I am wrong: If I just build the image on the Pi, it is already exactly at the one spot where I need it, so what problem is solved for me by using a registry?
Edit: Someone above mentioned docker buildx, so seems cross compilation is solved.