Install custom Linux packages on deployment image

In my project I am using “fgallery” a tool that generates simple static galleries.
fgallery website:
fgallery can be installed via apt/apt-get on Debian and its derivatives.
I created a script that uses the fgallery. It checks if it does not exist and tries to install it with “apt”. It didn’t work.
I tried to compile it from source and build it on the Netlify deployment, but alas it didn’t work either, since the sources list doesn’t contain the software’s source.

I wonder if this can be solved somehow? I simply want to install packages from the official Debian/Ubuntu repositories. Is there a way? If not, what alternatives do I have?

Thanks for your help and time in advance.

1 Like

Hi Latiif and thanks for filing the feature request on our build-image repo, just saw it there!

I’d suggest instead compiling locally for your build environment - I don’t know which you use, but it is likely you use our current default (unless your site is >1.5 years old on our service, you definitely do), and then you could pre-compile a binary for your tool and check it into your directory. You’re compiling for (or getting a statically linked binary, or a dynamically linked binary that works on…) ubuntu 16.04 x86_64 architecture. Then you can run it in your build (./fgallery && run-the-rest-of-your-build as a build command). To test your binary, I’d use the running locally instructions:

It is unlikely we’ll add a binary such as this for a single person to our build image since each bit in there is transferred before each build (we build you a new container to run your build; we throw it away afterwards so nobody can steal any contents), and we try to keep the container size as small as possible. But fortunately this workaround works for many so should work for you too.