File tree Expand file tree Collapse file tree 5 files changed +99
-3
lines changed Expand file tree Collapse file tree 5 files changed +99
-3
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ def genBuildStep(LinkedHashMap pkg, String arch) {
42
42
stage(" build" ) {
43
43
checkout scm
44
44
sh " make clean"
45
- sh " make REF=$branch ${ pkg.target} "
45
+ sh " make REF=$branch ARCH= ${ arch } ${ pkg.target} "
46
46
}
47
47
stage(" verify" ) {
48
- sh " make IMAGE=${ pkg.image} verify"
48
+ sh " make IMAGE=${ pkg.image} ARCH= ${ arch } verify"
49
49
}
50
50
}
51
51
}
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ BUILD?=DOCKER_BUILDKIT=1 \
22
22
--build-arg GO_IMAGE=$(GO_IMAGE ) \
23
23
--build-arg COMMON_FILES=$(COMMON_FILES ) \
24
24
-t debbuild-$@ /$(ARCH ) \
25
+ --platform linux/$(ARCH ) \
25
26
-f $@ /Dockerfile \
26
27
.
27
28
@@ -33,6 +34,7 @@ RUN_FLAGS=
33
34
# see https://github.com/docker/docker-ce-packaging/pull/1006#issuecomment-2006878743
34
35
RUN? =docker run --rm \
35
36
--security-opt seccomp=unconfined \
37
+ --platform linux/$(ARCH ) \
36
38
-e PLATFORM \
37
39
-e EPOCH='$(EPOCH ) ' \
38
40
-e DEB_VERSION=$(word 1, $(GEN_DEB_VER ) ) \
Original file line number Diff line number Diff line change @@ -10,14 +10,19 @@ CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) &&
10
10
ENGINE_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/docker) && git rev-parse --short HEAD)
11
11
BUILDX_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/buildx) && git rev-parse --short HEAD)
12
12
13
+ ifdef RH_USER
14
+ RH_FLAGS=--secret id=rh-user,env=RH_USER --secret id=rh-pass,env=RH_PASS
15
+ endif
13
16
ifdef BUILD_IMAGE
14
17
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
15
18
endif
16
19
BUILD?=DOCKER_BUILDKIT =1 \
17
20
docker build \
21
+ $(RH_FLAGS ) \
18
22
$(BUILD_IMAGE_FLAG ) \
19
23
--build-arg GO_IMAGE=$(GO_IMAGE ) \
20
24
-t rpmbuild-$@ /$(ARCH ) \
25
+ --platform linux/$(ARCH ) \
21
26
-f $@ /Dockerfile \
22
27
.
23
28
@@ -48,6 +53,7 @@ RUN_FLAGS=
48
53
# https://github.com/docker/docker-ce-packaging/pull/1006#issuecomment-2006878743
49
54
RUN? =docker run --rm \
50
55
--security-opt seccomp=unconfined \
56
+ --platform linux/$(ARCH ) \
51
57
-e PLATFORM \
52
58
-v $(CURDIR ) /rpmbuild/SOURCES:/root/rpmbuild/SOURCES:ro \
53
59
-v $(CURDIR ) /rpmbuild/$@ /RPMS:/root/rpmbuild/RPMS \
@@ -57,7 +63,7 @@ RUN?=docker run --rm \
57
63
58
64
FEDORA_RELEASES ?= fedora-40 fedora-39
59
65
CENTOS_RELEASES ?= centos-9
60
- RHEL_RELEASES ?=
66
+ RHEL_RELEASES ?= rhel-8 rhel-9
61
67
62
68
DISTROS := $(FEDORA_RELEASES ) $(CENTOS_RELEASES ) $(RHEL_RELEASES )
63
69
BUNDLES := $(patsubst % ,rpmbuild/bundles-ce-% -$(DPKG_ARCH ) .tar.gz,$(DISTROS ) )
Original file line number Diff line number Diff line change
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
+ RUN --mount=type=secret,id=rh-user --mount=type=secret,id=rh-pass <<-EOT
12
+ rm -f /etc/rhsm-host
13
+
14
+ if [ ! -f /run/secrets/rh-user ] || [ ! -f /run/secrets/rh-pass ]; then
15
+ echo "Either RH_USER or RH_PASS is not set. Running build without subscription."
16
+ else
17
+ subscription-manager register \
18
+ --username="$(cat /run/secrets/rh-user)" \
19
+ --password="$(cat /run/secrets/rh-pass)"
20
+
21
+ subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
22
+ # dnf config-manager --set-enabled codeready-builder-for-rhel-8-$(arch)-rpms
23
+ fi
24
+ EOT
25
+
26
+ FROM subscribed-image
27
+
28
+ ENV GOPROXY=https://proxy.golang.org|direct
29
+ ENV GO111MODULE=off
30
+ ENV GOPATH=/go
31
+ ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
32
+ ENV AUTO_GOPATH 1
33
+ ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
34
+ ARG DISTRO
35
+ ARG SUITE
36
+ ENV DISTRO=${DISTRO}
37
+ ENV SUITE=${SUITE}
38
+
39
+ RUN dnf install -y rpm-build rpmlint
40
+ COPY --link SPECS /root/rpmbuild/SPECS
41
+ RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
42
+ COPY --link --from=golang /usr/local/go /usr/local/go
43
+ WORKDIR /root/rpmbuild
44
+ ENTRYPOINT ["/bin/rpmbuild" ]
Original file line number Diff line number Diff line change
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
+ RUN --mount=type=secret,id=rh-user --mount=type=secret,id=rh-pass <<-EOT
12
+ rm -f /etc/rhsm-host
13
+
14
+ if [ ! -f /run/secrets/rh-user ] || [ ! -f /run/secrets/rh-pass ]; then
15
+ echo "Either RH_USER or RH_PASS is not set. Running build without subscription."
16
+ else
17
+ subscription-manager register \
18
+ --username="$(cat /run/secrets/rh-user)" \
19
+ --password="$(cat /run/secrets/rh-pass)"
20
+
21
+ subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
22
+ # dnf config-manager --set-enabled codeready-builder-for-rhel-9-$(arch)-rpms
23
+ fi
24
+ EOT
25
+
26
+ FROM subscribed-image
27
+
28
+ ENV GOPROXY=https://proxy.golang.org|direct
29
+ ENV GO111MODULE=off
30
+ ENV GOPATH=/go
31
+ ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
32
+ ENV AUTO_GOPATH 1
33
+ ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
34
+ ARG DISTRO
35
+ ARG SUITE
36
+ ENV DISTRO=${DISTRO}
37
+ ENV SUITE=${SUITE}
38
+
39
+ RUN dnf install -y rpm-build rpmlint
40
+ COPY --link SPECS /root/rpmbuild/SPECS
41
+ RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
42
+ COPY --link --from=golang /usr/local/go /usr/local/go
43
+ WORKDIR /root/rpmbuild
44
+ ENTRYPOINT ["/bin/rpmbuild" ]
You can’t perform that action at this time.
0 commit comments