Skip to content

Commit

Permalink
Use UBI-based image for Go builder
Browse files Browse the repository at this point in the history
  • Loading branch information
dalbani committed Jul 9, 2023
1 parent 4f020c6 commit 8ffcf6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM golang:1.19-bullseye
RUN apt-get update -y && apt-get install -y libkrb5-dev
FROM registry.access.redhat.com/ubi8/go-toolset:1.19
WORKDIR /opt/pbm
COPY . .
RUN make install
Expand All @@ -14,7 +13,7 @@ LABEL org.opencontainers.image.authors="info@percona.com"

COPY LICENSE /licenses/

COPY --from=0 /go/bin/pbm /go/bin/pbm-agent /go/bin/pbm-speed-test /usr/local/bin/
COPY --from=0 /opt/app-root/src/go/bin/pbm /opt/app-root/src/go/bin/pbm-agent /opt/app-root/src/go/bin/pbm-speed-test /usr/local/bin/

USER nobody

Expand Down
5 changes: 2 additions & 3 deletions docker/Dockerfile.k8s
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM golang:1.19-bullseye
RUN apt-get update -y && apt-get install -y libkrb5-dev
FROM registry.access.redhat.com/ubi8/go-toolset:1.19
WORKDIR /opt/pbm
COPY . .
RUN make install-k8s
Expand Down Expand Up @@ -49,7 +48,7 @@ RUN set -ex; \

RUN microdnf install percona-server-mongodb-shell

COPY --from=0 /go/bin/pbm /go/bin/pbm-agent /go/bin/pbm-agent-entrypoint /go/bin/pbm-speed-test /usr/bin/
COPY --from=0 /opt/app-root/src/go/bin/pbm /opt/app-root/src/go/bin/pbm-agent /opt/app-root/src/go/bin/pbm-agent-entrypoint /opt/app-root/src/go/bin/pbm-speed-test /usr/bin/
COPY ./docker/start-agent.sh /start-agent.sh

USER nobody
Expand Down

0 comments on commit 8ffcf6d

Please sign in to comment.