Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg(docker-engine): fix static build with latest changes #69

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

crazy-max
Copy link
Member

follow-up moby/moby#44546

@crazy-max
Copy link
Member Author

CentOS 7 packaging is broken when building from master branch: https://github.com/docker/packaging/actions/runs/3865721363/jobs/6589383289#step:7:898

#33 87.73 # github.com/docker/docker/daemon/graphdriver/btrfs
#33 87.73 daemon/graphdriver/btrfs/btrfs.go:12:30: fatal error: linux/btrfs_tree.h: No such file or directory
#33 87.73  #include <linux/btrfs_tree.h>

Looks related to moby/moby#44761 (moby/moby@3208dca).

So it seems it now requires 4.12 kernel looking at the first appearence in /usr/include/linux/btrfs_tree.h: torvalds/linux@fcc8487. Guess we need to build without btrfs support in such case or provide headers from a newer kernel. cc @neersighted

@neersighted
Copy link
Member

Right, this is intentional. I would suggest simply compiling without Btrfs support as it's deprecated in CentOS (nee Red Hat) 7; this is what we plan to do in MCR/EE. There's no intention to backport to 20.10 so we don't take anything away from users.

Alternatively, it shouldn't be too burdensome to host an image on Docker Hub or similar that carries the results of:

  • Setting up a system with the libc headers
  • Fetching a tarball from kernel.org
  • Running make headers_install

Then one could mount/copy those headers into the build environment of the CentOS 7 builder. However, I think given that it's very much on life-support in the distro itself means we should just skip building it, like we already do on 8+.

@crazy-max
Copy link
Member Author

Yes there is also http://elrepo.org/tiki/kernel-lt

@neersighted
Copy link
Member

Ah, good find; I had not realized that ELRepo provides full userspace headers (as opposed to kernel headers in /usr/src for module builds) -- I'll keep that in my back pocket if this comes up again. However I'd suggest just setting the buildtag for now and revisiting if it becomes a problem later.

@crazy-max
Copy link
Member Author

Yes will do here:

centos8|centos9|oraclelinux*)
rpmDefine+=(--define "_without_btrfs 1")
export DOCKER_BUILDTAGS="exclude_graphdriver_btrfs $DOCKER_BUILDTAGS"
;;

Thanks for your feedback

@crazy-max
Copy link
Member Author

FWIW it works with:

yum install -y https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel -y install kernel-lt-headers

@thaJeztah
Copy link
Member

@crazy-max how did you get it working for non-x86? Looks like the headers (even if they're "noarch") packages (or mirrors) are still x86; docker/docker-ce-packaging#810 (comment)

@crazy-max
Copy link
Member Author

crazy-max commented Jan 9, 2023

@crazy-max how did you get it working for non-x86? Looks like the headers (even if they're "noarch") packages (or mirrors) are still x86; docker/docker-ce-packaging#810 (comment)

I build without btrfs support in this PR and didn't try to install headers on non-x86 but it seems this repo don't support this arch unfortunately 😞

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants