aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-08-22 17:33:02 +0100
committerliamfallon <liam.fallon@est.tech>2022-08-24 08:34:48 +0100
commite572a014bee7ddeaa5027ab9b4fdbeac9c8b24b9 (patch)
treed3e843b409e0ded11f1e80009bb63785036ac295
parent26865ec33c7f6c86caffb0bb391f6e8d7b2c2777 (diff)
Add dockerfile for local use for Non Alpine arch
The "onap-java11" dockerfile does not build on non X64 architectures such as the aarm64 architectures used by the Apple M1 processor. The base image "adoptopenjdk/openjdk11:jre-11.0.15_10-alpine" used by the onap-java11 Dockerfile does not exist for aarm64 architectures. This commit adds a Dockerfile that will create an ONAP base image for local use that uses Alpine as its base image and adds Java11. This new dockerfile builds fine on Apple M1, and can be invoked with the command: docker build -t onap/integration-java11:9.0.0 -f onap-java11/BareAlpine.Dockerfile onap-java11 Issue-ID: POLICY-4287 Change-Id: I88b735ae5b61681c86a0ded2b6b992d39c9c4a83 Signed-off-by: liamfallon <liam.fallon@est.tech>
-rw-r--r--BareAlpine.Dockerfile34
1 files changed, 34 insertions, 0 deletions
diff --git a/BareAlpine.Dockerfile b/BareAlpine.Dockerfile
new file mode 100644
index 0000000..dea77e5
--- /dev/null
+++ b/BareAlpine.Dockerfile
@@ -0,0 +1,34 @@
+FROM alpine
+
+LABEL maintainer="ONAP Integration team"
+LABEL Description="Reference ONAP JAVA 11 image based on alpine"
+
+ENV JAVA_OPTS="-Xms256m -Xmx1g"
+ENV JAVA_SEC_OPTS=""
+
+ARG user=onap
+ARG group=onap
+
+# Install additional tools and Java
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache openssl ca-certificates \
+ && update-ca-certificates \
+ && apk add --update coreutils && rm -rf /var/cache/apk/* \
+ && apk add --update openjdk11 tzdata curl unzip bash \
+ && apk add --no-cache nss \
+ && rm -rf /var/cache/apk/*
+
+# Create a group and user
+RUN addgroup -S $group && adduser -G $group -D $user && \
+ mkdir /var/log/$user && \
+ mkdir /app && \
+ chown -R $user:$group /var/log/$user && \
+ chown -R $user:$group /app && \
+ ln -s /usr/bin/java /bin/java
+
+# Tell docker that all future commands should be run as the onap user
+USER $user
+WORKDIR /app
+
+ENTRYPOINT exec java $JAVA_SEC_OPTS $JAVA_OPTS -jar /app/app.jar