Skip to content

Commit

Permalink
fix(uid): set default container uid (#11) (#14)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7922337)

Co-authored-by: Andrew Azores <me@andrewazor.es>
  • Loading branch information
mergify[bot] and andrewazores authored Nov 6, 2024
1 parent c9d5d51 commit eb9419e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG builder_version=8.10
ARG runner_version=8.10
ARG goversion=go1.22.6
ARG user_id=1001

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

FROM registry.access.redhat.com/ubi8/ubi-minimal:$runner_version
ARG user_id
COPY --from=builder ./oauth-proxy /usr/bin/oauth-proxy
USER $user_id
ENTRYPOINT ["/usr/bin/oauth-proxy"]
14 changes: 14 additions & 0 deletions build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -xe

DIR="$(dirname "$(readlink -f "$0")")"

IMAGE_NAMESPACE="${IMAGE_NAMESPACE:-quay.io/cryostat}"
IMAGE_NAME="${IMAGE_NAME:-openshift-oauth-proxy}"

podman build -f "${DIR}/Containerfile" . -t "${IMAGE_NAMESPACE}/${IMAGE_NAME}:latest"

for tag in $IMAGE_TAGS; do
podman tag "${IMAGE_NAMESPACE}/${IMAGE_NAME}:latest" "${IMAGE_NAMESPACE}/${IMAGE_NAME}:${tag}"
done

0 comments on commit eb9419e

Please sign in to comment.