Add documentation of Incus compile instruction on AlpineLinux

I’m kindly asking Linux Containers community to add documentation about Incus compile instruction on AlpineLinux.


AlpineLinux is lightweight Linux distro that contains minimal dependencies. I’m not an advanced user of Linux but as a user of low-end home server, I’d like to suggest add documentation about how to compile Incus on AlpineLinux. It doesn’t mean that Linux Containers need to fully maintain or support the behavior of Incus on AlpineLinux. However, it opens the wide use-cases of Incus for other distros than Debian based ones.

Compile Insturction on AlpineLinux

Install dev dependencies on your machine.

apk add acl-dev autoconf automake eudev-dev gettext-dev go intltool libcap-dev libtool libuv-dev linux-headers lz4-dev tcl-dev sqlite-dev lxc-dev make xz

Download release tarball and extract on directory.

xz -d incus-0.3.tar.xz
tar xf incus-0.3.tar
cd incus-0.3

Compile Incus. You’ll get Incus binaries and libraries from go path.

# cc1: error: /usr/local/include: No such file or directory [-Werror=missing-include-dirs]
mkdir -p /usr/local/include

# paste output `export` commands on console to set required environment variables
make deps

# gettext.cgo2.c:(.text+0x2b9): undefined reference to `libintl_gettext'
# - module path:*&path=&name=gettext-dev&branch=edge
# - related issue:
export CGO_LDFLAGS="$CGO_LDFLAGS -L/usr/lib -lintl"
export CGO_CPPFLAGS="-I/usr/include"


Suggested solution

I’d like to recommend to add above snippets to installation documentation. I’m willing to create PR but I’m asking here first as I’m not producing natural sentences.

Yeah, just like we’re working on adding more instructions for package installations on other distributions, I’d be happy to see build instructions for other distributions too.

Feel free to open a PR and we’ll get a first pass merged, then I’ll do some tweaking to try and make things easy to find in that page (it’s going to get quite long so we’ll need to use some Sphinx features to show tabs to users where they can pick their distribution).

1 Like

My 2cents: You should try to get incus packaged and maintained in alpine! I don’t know the procedure for adding packages to the distribution, but it’d be better for both alpine and incus long-term to have the package natively available in the repos. IIRC alpine has a community repo, where packages may stay for testing, before being pulled to “core” repo?

My time is much better spent working on Incus itself than figuring out the packaging system of a dozen plus distros :wink:

That said, I expect most distros that currently have native packages for LXD to soon be getting native packages for Incus too, as it’s really straightforward for the package to do, so an easy win.

I don’t know for Alpine, but we do have native packages on the way for Debian and Arch Linux, with an interest for native packages (instead of COPR) on Fedora. There also are existing native packages on both Gentoo and NixOS, so not too bad given how new Incus is :slight_smile:

Yes, providing Incus build via package manager is the most preferred way so far. I fully agree to it. However, I haven’t done these kind of task before. I’m going to contact Alpine devel IRC in short days to see if there’s anyone interested in Incus packaging. Personally, I’m learning how to compile Alpine packages via their wiki now.

Also, yes. Actually, new Incus seems more flexible. I like it.