Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use amazon corretto alpine as Docker base image #387

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
FROM aquasec/trivy:0.49.1 as SECURITY_SCANNER

FROM registry.access.redhat.com/ubi8/openjdk-17:1.19-1
FROM golang:alpine3.19 as TERRAFORM_DOCS

COPY --from=SECURITY_SCANNER /usr/local/bin/trivy /usr/bin/
RUN go install github.com/terraform-docs/terraform-docs@v0.17.0

USER root
FROM amazoncorretto:17-alpine3.19-jdk

RUN microdnf install golang && go install github.com/terraform-docs/terraform-docs@v0.16.0 \
&& mv /home/jboss/go/bin/terraform-docs /usr/bin/ \
&& microdnf clean all \
&& mkdir -p /home/jboss/.cache/trivy \
RUN mkdir -p /home/jboss/.cache/trivy \
&& chmod a+wr /home/jboss/.cache/trivy

RUN addgroup -g 187 tapir && adduser -D -u 187 -G tapir tapir

# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --chown=185 target/quarkus-app/lib/ /tf/registry/lib/
COPY --chown=185 target/quarkus-app/quarkus-run.jar /tf/registry/tapir.jar
COPY --chown=185 target/quarkus-app/app/ /tf/registry/app/
COPY --chown=185 target/quarkus-app/quarkus/ /tf/registry/quarkus/
COPY --chown=187 target/quarkus-app/lib/ /tf/registry/lib/
COPY --chown=187 target/quarkus-app/quarkus-run.jar /tf/registry/tapir.jar
COPY --chown=187 target/quarkus-app/app/ /tf/registry/app/
COPY --chown=187 target/quarkus-app/quarkus/ /tf/registry/quarkus/

EXPOSE 8080
USER tapir

USER 185
COPY --from=TERRAFORM_DOCS /go/bin/terraform-docs /usr/bin/

COPY --from=SECURITY_SCANNER /usr/local/bin/trivy /usr/bin/

EXPOSE 8080

ENV AB_JOLOKIA_OFF=""
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/tf/registry/tapir.jar"

ENTRYPOINT ["java"]

CMD ["-jar", "/tf/registry/tapir.jar"]
2 changes: 2 additions & 0 deletions changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[semantic version

=== changed

* https://github.com/PacoVK/tapir/pull/387[#387 - Use amazon corretto alpine as Docker base image]

== 0.6.3

=== fixes
Expand Down