Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit eb9419e

Browse files
fix(uid): set default container uid (#11) (#14)
(cherry picked from commit 7922337) Co-authored-by: Andrew Azores <[email protected]>
1 parent c9d5d51 commit eb9419e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Containerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG builder_version=8.10
22
ARG runner_version=8.10
33
ARG goversion=go1.22.6
4+
ARG user_id=1001
45

56
FROM registry.access.redhat.com/ubi8/ubi:$builder_version AS builder
67
ARG goversion
@@ -11,5 +12,7 @@ RUN dnf install -y go \
1112
&& ~/go/bin/$goversion build -a -v -x .
1213

1314
FROM registry.access.redhat.com/ubi8/ubi-minimal:$runner_version
15+
ARG user_id
1416
COPY --from=builder ./oauth-proxy /usr/bin/oauth-proxy
17+
USER $user_id
1518
ENTRYPOINT ["/usr/bin/oauth-proxy"]

build.bash

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -xe
4+
5+
DIR="$(dirname "$(readlink -f "$0")")"
6+
7+
IMAGE_NAMESPACE="${IMAGE_NAMESPACE:-quay.io/cryostat}"
8+
IMAGE_NAME="${IMAGE_NAME:-openshift-oauth-proxy}"
9+
10+
podman build -f "${DIR}/Containerfile" . -t "${IMAGE_NAMESPACE}/${IMAGE_NAME}:latest"
11+
12+
for tag in $IMAGE_TAGS; do
13+
podman tag "${IMAGE_NAMESPACE}/${IMAGE_NAME}:latest" "${IMAGE_NAMESPACE}/${IMAGE_NAME}:${tag}"
14+
done

0 commit comments

Comments
 (0)