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

[master] Add Support for Centos-8 #416

Merged
merged 2 commits into from
Mar 13, 2020
Merged

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Jan 16, 2020

No description provided.

StefanScherer
StefanScherer previously approved these changes Jan 17, 2020
Copy link
Member

@StefanScherer StefanScherer left a comment

Choose a reason for hiding this comment

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

LGTM

RUN yum install -y rpm-build rpmlint
COPY SPECS /root/rpmbuild/SPECS
# Overwrite repo that was failing on aarch64
RUN sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is no longer needed for CentOS 8 (it was added in 0fd20b9 / #142):

The centos:7 (linux/arm64) image indeed has this repo:

docker run --rm --platform=linux/arm64 centos:7 sh -c 'cat /etc/yum.repos.d/CentOS-Sources.repo | grep altarch'
baseurl=http://vault.centos.org/altarch/$releasever/extras/Source/
baseurl=http://vault.centos.org/altarch/$releasever/centosplus/Source/

But they are no longer in the centos:8 image:

docker run --rm --platform=linux/arm64 centos:8 sh -c 'cat /etc/yum.repos.d/CentOS-Sources.repo | grep altarch'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thaJeztah I don't see it in centos:7 either

🐳 ~/go-workspace/src/github.com/docker/docker-ce-packaging$ docker run --rm --platform=linux/arm64 centos:7 sh -c 'cat /etc/yum.repos.d/CentOS-Sources.repo | grep altarch'
🐳 ~/go-workspace/src/github.com/docker/docker-ce-packaging$ docker run --rm --platform=linux/arm64 centos:8 sh -c 'cat /etc/yum.repos.d/CentOS-Sources.repo | grep altarch'

@thaJeztah
Copy link
Member

Builds on master are currently failing (see #415 (comment))

Step 24/49 : RUN go build -o /sbin/dockerd     -tags 'autogen apparmor seccomp selinux journald exclude_graphdriver_devicemapper'     -i     -buildmode=pie     -a -ldflags '-w'    github.com/docker/docker/cmd/dockerd
 ---> Running in 2d737193b473
# github.com/docker/docker/dockerversion
dockerversion/useragent.go:20:83: undefined: Version
dockerversion/useragent.go:22:87: undefined: GitCommit
The command '/bin/sh -c go build -o /sbin/dockerd     -tags 'autogen apparmor seccomp selinux journald exclude_graphdriver_devicemapper'     -i     -buildmode=pie     -a -ldflags '-w'    github.com/docker/docker/cmd/dockerd' returned a non-zero code: 2
Makefile:61: recipe for target 'image-linux' failed

Suspect that's due to upstream changes in moby/moby#40180

Specifically this commit; moby/moby@675b414

@thaJeztah
Copy link
Member

opened #417 and moby/moby#40393 to fix the build-failures

@wood1986
Copy link

when will it get merged?

StefanScherer
StefanScherer previously approved these changes Feb 5, 2020
Copy link
Member

@StefanScherer StefanScherer left a comment

Choose a reason for hiding this comment

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

LGTM

@WqyJh
Copy link

WqyJh commented Feb 6, 2020

When will the official rpm repo be available?

@arkodg
Copy link
Contributor Author

arkodg commented Feb 10, 2020

ptal @thaJeztah

@AkihiroSuda
Copy link
Contributor

ping @thaJeztah

@mattvw
Copy link

mattvw commented Mar 2, 2020

Any updates on when this might be merged so we can get CentOS 8 RPMs created? It would be really great if we could get full CentOS 8 support for Docker CE soon. Thanks! @thaJeztah @StefanScherer @arkodg

Copy link

@plfiorini plfiorini left a comment

Choose a reason for hiding this comment

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

There are also missing build deps: btrfs-progs-devel, device-mapper-devel, glibc-static

ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN yum install -y rpm-build rpmlint

Choose a reason for hiding this comment

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

In order to use yum-builddep you need to install yum-utils here

@thaJeztah
Copy link
Member

There are also missing build deps: btrfs-progs-devel, device-mapper-devel, glibc-static

btrfs is not supported on RHEL/CentOS; https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/7.4_release_notes/index

Red Hat Enterprise Linux 7.4 introduces the last planned update to this feature. Btrfs has been deprecated, which means Red Hat will not be moving Btrfs to a fully supported feature and it will be removed in a future major release of Red Hat Enterprise Linux. (BZ#1477977)

Arko Dasgupta added 2 commits March 13, 2020 08:40
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
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.

LGTM, thanks!

@thaJeztah thaJeztah merged commit 5456096 into docker:master Mar 13, 2020
@mattvw
Copy link

mattvw commented Mar 15, 2020

FYI, from my tests, @plfiorini was correct in his suggested change regarding yum-builddep at #416 (review). You need to add yum-utils on line 20 of centos-8/Dockerfile or the yum-builddep command on line 22 will fail:

...
== Building packages for centos-8 ==
docker run --rm -v /opt/docker/docker-ce-packaging/rpm:/v -w /v alpine chown -R root:root rpmbuild
DOCKER_BUILDKIT=1 docker build  --build-arg GO_IMAGE=golang:1.13.8-buster -t rpmbuild-centos-8/x86_64 -f centos-8/Dockerfile .
[+] Building 16.8s (10/12)                                                                                                                             
 => [internal] load build definition from Dockerfile                                                                                              0.0s
 => => transferring dockerfile: 658B                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/centos:8                                                                                       0.2s
 => [internal] load metadata for docker.io/library/golang:1.13.8-buster                                                                           0.3s
 => CACHED [stage-1 1/6] FROM docker.io/library/centos:8@sha256:fe8d824220415eed5477b63addf40fb06c3b049404242b31982106ac204f6700                  0.0s
 => CACHED [golang 1/1] FROM docker.io/library/golang:1.13.8-buster@sha256:1da34145a757a5b9959111d0150d257c1a1f456b5fc3ec72101093e01977d8ca       0.0s
 => [internal] load build context                                                                                                                 0.2s
 => => transferring context: 111B                                                                                                                 0.1s
 => [stage-1 2/6] RUN yum install -y rpm-build rpmlint                                                                                           15.9s
 => [stage-1 3/6] COPY SPECS /root/rpmbuild/SPECS                                                                                                 0.1s
 => ERROR [stage-1 4/6] RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec                                                                           0.5s 
------                                                                                                                                                 
 > [stage-1 4/6] RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec:                                                                                      
#9 0.439 /bin/sh: yum-builddep: command not found                                                                                                      
------                                                                                                                                                 
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c yum-builddep -y /root/rpmbuild/SPECS/*.spec]: runc did not terminate sucessfully
...

Also, as @plfiorini indicated, you have BuildRequires on the btrfs-progs-devel, device-mapper-devel, and glibc-static packages in the SPECS/docker-ce.spec file, which don't exist by default in CentOS 8, and causes the CentOS 8 RPM build to fail:

(with yum-utils added to line 20 of centos-8/Dockerfile)

...
=> [stage-1 2/6] RUN yum install -y rpm-build rpmlint yum-utils                                                                                       15.2s
 => [stage-1 3/6] COPY SPECS /root/rpmbuild/SPECS                                                                                                       0.1s
 => ERROR [stage-1 4/6] RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec                                                                                 1.1s 
------                                                                                                                                                       
 > [stage-1 4/6] RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec:                                                                                            
#9 0.797 Last metadata expiration check: 0:00:12 ago on Sun Mar 15 12:06:29 2020.                                                                            
#9 1.054 Package bash-4.4.19-10.el8.x86_64 is already installed.                                                                                             
#9 1.054 No matching package to install: 'btrfs-progs-devel'
#9 1.055 Package ca-certificates-2019.2.32-80.0.el8_1.noarch is already installed.
#9 1.055 No matching package to install: 'device-mapper-devel'
#9 1.056 No matching package to install: 'glibc-static'
#9 1.057 Package pkgconf-pkg-config-1.4.2-1.el8.x86_64 is already installed.
#9 1.058 Package systemd-239-18.el8_1.1.x86_64 is already installed.
#9 1.058 Package tar-2:1.30-4.el8.x86_64 is already installed.
#9 1.059 Not all dependencies satisfied
#9 1.062 Error: Some packages could not be found.
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c yum-builddep -y /root/rpmbuild/SPECS/*.spec]: runc did not terminate sucessfully
...

btrfs-progs-devel was removed (as you'd expect). glibc-static and device-mapper-devel were moved to the PowerTools repository in CentOS 8 (equivalent to the CodeReady Linux Builder repo in RHEL 8), which isn't enabled by default in CentOS 8.

I just added the line

RUN yum-config-manager --set-enabled PowerTools

right below line 20 in centos-8/Dockerfile and that allowed me to get past that part and into the actual RPM build. (yum-config-manager command is provided by the yum-utils package.)

However, it looks like there are further dependencies on btrfs-progs-devel in certain components, which is beyond my expertise to further diagnose and try to fix:

...
Install docker-proxy version bf2bd42abc0a3734f12b5ec724e571434e42c669
+ git clone https://github.com/docker/libnetwork.git /go/src/github.com/docker/libnetwork
Cloning into '/go/src/github.com/docker/libnetwork'...
+ cd /go/src/github.com/docker/libnetwork
+ git checkout -q bf2bd42abc0a3734f12b5ec724e571434e42c669
+ go build -buildmode=pie -ldflags=-linkmode=external -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy
+ return
+ VERSION=0.0.0-20200314012737-2e20eebe27
+ PRODUCT=docker
+ hack/make.sh dynbinary

Removing bundles/


---> Making bundle: dynbinary (in bundles/dynbinary)
Building: bundles/dynbinary-daemon/dockerd-0.0.0-20200314012737-2e20eebe27
GOOS="" GOARCH="" GOARM=""
# github.com/docker/docker/daemon/graphdriver/btrfs
.gopath/src/github.com/docker/docker/daemon/graphdriver/btrfs/btrfs.go:8:10: fatal error: btrfs/ioctl.h: No such file or directory
 #include <btrfs/ioctl.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
error: Bad exit status from /var/tmp/rpm-tmp.AVjfql (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.AVjfql (%build)
...

Hope this helps!

@thaJeztah
Copy link
Member

Thanks! pushed #444 with a fix

@thaJeztah thaJeztah changed the title Add Support for Centos-8 [master] Add Support for Centos-8 May 1, 2020
@AkihiroSuda
Copy link
Contributor

Any ETA on pushing this to https://download.docker.com/linux/centos/ ?

@proea
Copy link

proea commented Aug 24, 2020

one more plus to the question above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants