Newb wants to make rutorrent container mod, but unsure where to start

OK, I read the blog-post (https://blog.linuxserver.io/2019/09/14/customizing-our-containers/) and looked at the accompanying GitHub page. Kinda looks simple enough, but then again, I’m completely green when it comes to Dockerfiles.

So to describe what I’m trying to achieve:
I want to make a mod that adds PyroScope to the linuxserver/rutorrent image.
I’m guessing it will involve adding build-tools to the image, pulling in code, building from source and “installing” the resulting files into a folder that can then be merged into the base image.

  • Does the base Alpine Linux image of the mod have to version-match the rutorrent Alpine-version?
  • Once the application is compiled, should I uninstall the build-tools?
  • Can compiled code be easily “installed” (make install) into a “root” folder of my choosing?

I’m sure these are pretty dumb questions, but I’m no developer, so I’m not used to doing this stuff. :wink:

Yours, Fudd79 (trying to learn new stuff)

The mod is simply a tar file (single docker image layer) that gets copied to the container root, that’s all. The tar file can contain binaries, init files, or service files.

The Dockerfile is just used to produce that single layer image.

1 Like

This one for instance: https://github.com/linuxserver/docker-mods/blob/code-server-python3/Dockerfile#L6
All it does is copy whatever’s in the root folder into the FROM scratch image’s root /. The root folder contains just an init file, so when the mod is applied, in other words that tar file extracted to the root of the container, it injects the init file /etc/cont-init.d/98-python3, which installs python3 during container start.

This one on the other hand is more complicated: https://github.com/linuxserver/docker-mods/blob/code-server-powershell/Dockerfile
It retrieves binary files for powershell (all three arches), and stores them in /root-layer. It also copies an init file into that /root-layer folder. In the final step, all those files are copied to a FROM scratch image’s root /.

When it is applied, the binaries along with the init file are copied to the container. The init file processes the correct binary for the arch and activates it during container start

Hmm… PyroScope already has a Docker-file that they use to build their .deb package… If I understand this correctly, I might actually use that file (with some modifications) to get the stuff built and packaged? I just need to work out how to get it “Alpine-ized” and maybe some other things…