Skip to content

Commit

Permalink
replace distroless with alpine image
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Pinsel <[email protected]>
  • Loading branch information
DominikPinsel committed Sep 22, 2022
1 parent 436de34 commit 94e703f
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM gcr.io/distroless/java11-debian11@sha256:dee9240c64471f1776a6b37f315890aba14ff4bc89ad247eeb34ec79fdeb24f4
FROM alpine:3.16.2

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk add --update openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-controlplane.jar
COPY ${LIB} ./lib/

CMD ["-javaagent:/app/opentelemetry-javaagent.jar", \
CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM gcr.io/distroless/java11-debian11@sha256:dee9240c64471f1776a6b37f315890aba14ff4bc89ad247eeb34ec79fdeb24f4
FROM alpine:3.16.2

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk add --update openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-controlplane.jar
COPY ${LIB} ./lib/

CMD ["-javaagent:/app/opentelemetry-javaagent.jar", \
CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM gcr.io/distroless/java11-debian11@sha256:dee9240c64471f1776a6b37f315890aba14ff4bc89ad247eeb34ec79fdeb24f4
FROM alpine:3.16.2

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk add --update openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-controlplane.jar
COPY ${LIB} ./lib/

CMD ["-javaagent:/app/opentelemetry-javaagent.jar", \
CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
Expand Down
23 changes: 21 additions & 2 deletions edc-dataplane/edc-dataplane-azure-vault/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM gcr.io/distroless/java11-debian11@sha256:dee9240c64471f1776a6b37f315890aba14ff4bc89ad247eeb34ec79fdeb24f4
FROM alpine:3.16.2

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk add --update openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-dataplane.jar
COPY ${LIB} ./lib/

CMD ["-javaagent:/app/opentelemetry-javaagent.jar", \
CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,36 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM gcr.io/distroless/java11-debian11@sha256:dee9240c64471f1776a6b37f315890aba14ff4bc89ad247eeb34ec79fdeb24f4
FROM alpine:3.16.2

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk add --update openjdk11-jre-headless=11.0.16.1_p1-r0 --no-cache

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-dataplane.jar
COPY ${LIB} ./lib/

CMD ["-javaagent:/app/opentelemetry-javaagent.jar", \
CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
Expand Down

0 comments on commit 94e703f

Please sign in to comment.