Skip to content

Commit

Permalink
CLOUDP-196136: Use UBI micro base image instead of minimal (#1099)
Browse files Browse the repository at this point in the history
* Use micro base image instead of minimal

* Make E2E & int tests manually runnable

* Add Dockerfile to the path filter, such that cloud tests
are run when it's changed.

* Copy internal dir into docker builder step

* Add Root CAs to micro UBI
  • Loading branch information
roothorp authored Sep 15, 2023
1 parent 0e1118a commit 40242e9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/paths-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
production-code-changed:
- 'cmd/**/!(*_test.go)'
- 'pkg/**/!(*_test.go)'
- 'Dockerfile'
# run only if 'production-code' files were changed
- name: production code changed
if: steps.filter.outputs.production-code-changed == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
type: boolean
required: false
default: false
workflow_dispatch:

jobs:
prepare-e2e:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
type: boolean
required: false
default: false
workflow_dispatch:

jobs:
int-test:
Expand Down
15 changes: 3 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN go install golang.org/x/tools/cmd/goimports@latest
COPY cmd/manager/main.go cmd/manager/main.go
COPY .git/ .git/
COPY pkg/ pkg/
COPY internal/ internal/
COPY Makefile Makefile
COPY config/ config/
COPY hack/ hack/
Expand All @@ -27,18 +28,7 @@ ENV TARGET_OS=${TARGETOS}

RUN make manager

FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2

RUN microdnf install -y yum &&\
yum -y update &&\
yum -y upgrade &&\
yum clean all &&\
dnf remove python3-pip -y &&\
microdnf clean all

#FROM registry.access.redhat.com/ubi8/ubi
#
#RUN dnf -y update-minimal --security --sec-severity=Important --sec-severity=Critical
FROM registry.access.redhat.com/ubi9/ubi-micro:9.2

LABEL name="MongoDB Atlas Operator" \
maintainer="[email protected]" \
Expand All @@ -56,6 +46,7 @@ LABEL name="MongoDB Atlas Operator" \
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY hack/licenses licenses
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

USER 1001:0
ENTRYPOINT ["/manager"]

0 comments on commit 40242e9

Please sign in to comment.