Skip to content

Commit e362938

Browse files
authored
Merge pull request #3037 from joejstuart/rpm-lock-macos
Refactor update-rpm-lock.sh to work on MacOS
2 parents d76f60c + e35fb50 commit e362938

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

hack/update-rpm-lock.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ set -o nounset
2323

2424
root_dir=$(git rev-parse --show-toplevel)
2525

26+
# Platform to use for building and running containers
27+
# Use linux/amd64 for compatibility with base images that may not have ARM64 variants
28+
PLATFORM="linux/amd64"
29+
2630
latest_release=$(gh api '/repos/konflux-ci/rpm-lockfile-prototype/tags?per_page=1' --jq '.[0].name')
2731

2832
# build the image for running the RPM lock tool
2933
echo Building RPM lock tooling image...
30-
image=$(podman build --quiet --file <(cat <<DOCKERFILE
34+
dockerfile=$(mktemp "${TMPDIR:-/tmp}/rpm-lock-dockerfile.XXXXXX")
35+
trap "rm -f ${dockerfile}" EXIT
36+
37+
cat > "${dockerfile}" <<DOCKERFILE
3138
FROM quay.io/openshift/origin-cli:latest as oc-cli
3239
3340
# Python version needs to match whatever version of Python dnf itself depends on
@@ -46,7 +53,8 @@ COPY --from=oc-cli /usr/bin/oc /usr/bin
4653
4754
ENV PYTHONPATH=/usr/lib64/python3.9/site-packages:/usr/lib/python3.9/site-packages
4855
DOCKERFILE
49-
))
56+
57+
image=$(podman build --platform "${PLATFORM}" --quiet --file "${dockerfile}" .)
5058

5159
echo "Built: ${image}"
5260

@@ -97,6 +105,7 @@ fi
97105

98106
echo Running RPM lock tooling...
99107
podman run \
108+
--platform "${PLATFORM}" \
100109
--rm \
101110
--volume "${root_dir}/Dockerfile.dist:/opt/app-root/src/Dockerfile:Z" \
102111
--volume "${root_dir}/rpms.in.yaml:/opt/app-root/src/rpms.in.yaml:Z" \

0 commit comments

Comments
 (0)