8000 rpm: minimal RHEL support · docker/docker-ce-packaging@8e82b00 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 8e82b00

Browse files
neersightedvvoland
authored andcommitted
rpm: minimal RHEL support
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com> Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent 457e857 commit 8e82b00

File tree

4 files changed

+77
-35
lines changed

4 files changed

+77
-35
lines changed

rpm/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) &&
1010
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
1111
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)
1212

13+
ifdef RH_USER
14+
RH_FLAGS=--build-arg RH_USER=$(RH_USER) --build-arg RH_PASS=$(RH_PASS)
15+
endif
1316
ifdef BUILD_IMAGE
1417
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
1518
endif
1619
BUILD?=DOCKER_BUILDKIT=1 \
1720
docker build \
21+
$(RH_FLAGS) \
1822
$(BUILD_IMAGE_FLAG) \
1923
--build-arg GO_IMAGE=$(GO_IMAGE) \
2024
-t rpmbuild-$@/$(ARCH) \
@@ -59,11 +63,7 @@ RUN?=docker run --rm \
5963

6064
FEDORA_RELEASES ?= fedora-40 fedora-39 fedora-38
6165
CENTOS_RELEASES ?= centos-7 centos-8 centos-9
62-
ifeq ($(ARCH),s390x)
63-
RHEL_RELEASES ?= rhel-7
64-
else
65-
RHEL_RELEASES ?=
66-
endif
66+
RHEL_RELEASES ?= rhel-8 rhel-9
6767

6868
DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES)
6969
BUNDLES := $(patsubst %,rpmbuild/bundles-ce-%-$(DPKG_ARCH).tar.gz,$(DISTROS))

rpm/rhel-7/Dockerfile

Lines changed: 0 additions & 30 deletions
This file was deleted.

rpm/rhel-8/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG GO_IMAGE
4+
ARG DISTRO=rhel
5+
ARG SUITE=8
6+
ARG BUILD_IMAGE=registry.access.redhat.com/ubi8/ubi
7+
8+
FROM ${GO_IMAGE} AS golang
9+
10+
FROM ${BUILD_IMAGE} AS subscribed-image
11+
ARG RH_USER
12+
ARG RH_PASS
13+
RUN rm /etc/rhsm-host
14+
RUN subscription-manager register --username=$RH_USER --password=$RH_PASS
15+
RUN subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
16+
# RUN dnf config-manager --set-enabled codeready-builder-for-rhel-8-$(arch)-rpms
17+
18+
FROM subscribed-image
19+
20+
ENV GOPROXY=https://proxy.golang.org|direct
21+
ENV GO111MODULE=off
22+
ENV GOPATH=/go
23+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
24+
ENV AUTO_GOPATH 1
25+
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
26+
ARG DISTRO
27+
ARG SUITE
28+
ENV DISTRO=${DISTRO}
29+
ENV SUITE=${SUITE}
30+
31+
RUN dnf install -y rpm-build rpmlint
32+
COPY --link SPECS /root/rpmbuild/SPECS
33+
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
34+
COPY --link --from=golang /usr/local/go /usr/local/go
35+
WORKDIR /root/rpmbuild
36+
ENTRYPOINT ["/bin/rpmbuild"]

rpm/rhel-9/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG GO_IMAGE
4+
ARG DISTRO=rhel
5+
ARG SUITE=9
6+
ARG BUILD_IMAGE=registry.access.redhat.com/ubi9/ubi
7+
8+
FROM ${GO_IMAGE} AS golang
9+
10+
FROM ${BUILD_IMAGE} AS subscribed-image
11+
ARG RH_USER
12+
ARG RH_PASS
13+
RUN rm /etc/rhsm-host
14+
RUN subscription-manager register --username=$RH_USER --password=$RH_PASS
15+
RUN subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
16+
# RUN dnf config-manager --set-enabled codeready-builder-for-rhel-9-$(arch)-rpms
17+
18+
FROM subscribed-image
19+
20+
ENV GOPROXY=https://proxy.golang.org|direct
21+
ENV GO111MODULE=off
22+
ENV GOPATH=/go
23+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
24+
ENV AUTO_GOPATH 1
25+
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
26+
ARG DISTRO
27+
ARG SUITE
28+
ENV DISTRO=${DISTRO}
29+
ENV SUITE=${SUITE}
30+
31+
RUN dnf install -y rpm-build rpmlint
32+
COPY --link SPECS /root/rpmbuild/SPECS
33+
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
34+
COPY --link --from=golang /usr/local/go /usr/local/go
35+
WORKDIR /root/rpmbuild
36+
ENTRYPOINT ["/bin/rpmbuild"]

0 commit comments

Comments
 (0)
0