Skip to content

Commit 0df3ecb

Browse files
committed
ROX-24040: Set Podman instead of Docker to fix RHEL8 builders
1 parent f34ff11 commit 0df3ecb

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Dockerfile

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ WORKDIR /src
88
RUN go env -w GOCACHE=/go/.cache; \
99
go env -w GOMODCACHE=/go/pkg/mod
1010

11+
# We previously used --mount=type=bind in the next RUN command
12+
# (see https://docs.docker.com/build/guide/mounts/#add-bind-mounts)
13+
# but this did not work with SELinux volumes and Docker, as only
14+
# Podman supports the relabel=shared option
15+
# (see https://docs.podman.io/en/v4.4/markdown/options/mount.html).
16+
# This adds a layer but works with Docker and Podman.
17+
COPY go.mod go.sum ./
18+
1119
RUN --mount=type=cache,target=/go/pkg/mod/ \
12-
--mount=type=bind,source=go.sum,target=go.sum \
13-
--mount=type=bind,source=go.mod,target=go.mod \
1420
go mod download -x
1521

1622
COPY . ./

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,12 @@ docker/login: docker/login/fleet-manager
497497
.PHONY: docker/login
498498

499499
docker/login/fleet-manager:
500-
@docker logout quay.io
500+
$(DOCKER) logout quay.io || true # Swallog podman error if not logged in
501501
@DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) login -u "${QUAY_USER}" --password-stdin <<< "${QUAY_TOKEN}" quay.io
502502
.PHONY: docker/login/fleet-manager
503503

504504
docker/login/probe:
505-
@docker logout quay.io
505+
$(DOCKER) logout quay.io || true # Swallow podman error if not logged in
506506
@DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) login -u "${QUAY_PROBE_USER}" --password-stdin <<< "${QUAY_PROBE_TOKEN}" quay.io
507507
.PHONY: docker/login/probe
508508

@@ -563,7 +563,7 @@ image/push: image/push/fleet-manager image/push/probe
563563

564564
image/push/fleet-manager: IMAGE_REF="$(external_image_registry)/$(image_repository):$(image_tag)"
565565
image/push/fleet-manager:
566-
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(IMAGE_REF) --platform $(IMAGE_PLATFORM) --push .
566+
DOCKER_CONFIG=${DOCKER_CONFIG} $(DOCKER) buildx build -t $(IMAGE_REF) --platform $(IMAGE_PLATFORM) --output=type=registry .
567567
@echo
568568
@echo "Image was pushed as $(IMAGE_REF). You might want to"
569569
@echo "export FLEET_MANAGER_IMAGE=$(IMAGE_REF)"
@@ -579,7 +579,7 @@ image/push/probe: image/build/probe
579579
# push the image to the OpenShift internal registry
580580
image/push/internal: IMAGE_TAG ?= $(image_tag)
581581
image/push/internal: docker/login/internal
582-
$(DOCKER) buildx build -t "$(shell oc get route default-route -n openshift-image-registry -o jsonpath="{.spec.host}")/$(NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)" --platform linux/amd64 --push .
582+
$(DOCKER) buildx build -t "$(shell oc get route default-route -n openshift-image-registry -o jsonpath="{.spec.host}")/$(NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)" --platform linux/amd64 --output=type=registry .
583583
.PHONY: image/push/internal
584584

585585
image/build/fleetshard-operator: IMAGE_REF="$(external_image_registry)/fleetshard-operator:$(image_tag)"

build_push_app_interface.sh

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ source ./scripts/build_setup.sh
4141
# Push the image:
4242
echo "Quay.io user and token is set, will push images to $IMAGE_REPOSITORY"
4343
make \
44+
DOCKER=podman \
4445
DOCKER_CONFIG="${DOCKER_CONFIG}" \
4546
QUAY_USER="${QUAY_USER}" \
4647
QUAY_TOKEN="${QUAY_TOKEN}" \
@@ -51,6 +52,7 @@ make \
5152
image/push/fleet-manager
5253

5354
make \
55+
DOCKER=podman \
5456
DOCKER_CONFIG="${DOCKER_CONFIG}" \
5557
QUAY_USER="${QUAY_USER}" \
5658
QUAY_TOKEN="${QUAY_TOKEN}" \
@@ -62,6 +64,7 @@ make \
6264
image/push/fleet-manager
6365

6466
make \
67+
DOCKER=podman \
6568
DOCKER_CONFIG="${DOCKER_CONFIG}" \
6669
QUAY_PROBE_USER="${QUAY_USER}" \
6770
QUAY_PROBE_TOKEN="${QUAY_TOKEN}" \
@@ -72,6 +75,7 @@ make \
7275
image/push/probe
7376

7477
make \
78+
DOCKER=podman \
7579
DOCKER_CONFIG="${DOCKER_CONFIG}" \
7680
QUAY_PROBE_USER="${QUAY_USER}" \
7781
QUAY_PROBE_TOKEN="${QUAY_TOKEN}" \
@@ -83,6 +87,7 @@ make \
8387
image/push/probe
8488

8589
make \
90+
DOCKER=podman \
8691
DOCKER_CONFIG="${DOCKER_CONFIG}" \
8792
QUAY_USER="${QUAY_USER}" \
8893
QUAY_TOKEN="${QUAY_TOKEN}" \
@@ -93,6 +98,7 @@ make \
9398
image/push/emailsender
9499

95100
make \
101+
DOCKER=podman \
96102
DOCKER_CONFIG="${DOCKER_CONFIG}" \
97103
QUAY_USER="${QUAY_USER}" \
98104
QUAY_TOKEN="${QUAY_TOKEN}" \
@@ -102,3 +108,4 @@ make \
102108
emailsender_image_repository="${EMAILSENDER_IMAGE_REPOSITORY}" \
103109
docker/login/fleet-manager \
104110
image/push/emailsender
111+

0 commit comments

Comments
 (0)