From 5f311f9bf7fffb5b23dd671af387bd1200556a7a Mon Sep 17 00:00:00 2001 From: Simon Hrabos Date: Thu, 25 Jul 2019 13:48:49 +0200 Subject: small, multi-platform (amd64, arm64) images Modify zookeeper docker image due to arm64 compatibility Issue-ID: INT-911 Issue-ID: INT-934 Signed-off-by: Simon Hrabos Change-Id: I1e30bb7beaf09d4dde54ff4da4b07b0eac2e864a --- pom.xml | 132 +++++++++++++++------------------------------ src/main/docker/Dockerfile | 18 +++---- 2 files changed, 49 insertions(+), 101 deletions(-) diff --git a/pom.xml b/pom.xml index 7772190..eece3d9 100644 --- a/pom.xml +++ b/pom.xml @@ -104,93 +104,6 @@ - - com.spotify - docker-maven-plugin - 1.0.0 - - onap/dmaap/zookeeper - src/main/docker - docker-hub - - ${dockertag1} - ${dockertag2} - - true - - - - / - ${project.build.directory} - **/** - - - - - - build-image - install - - build - - - ${skip.docker.build} - - - - - tag-image-project-version - install - - tag - - - onap/dmaap/zookeeper - ${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2} - ${skip.docker.push} - - - - - tag-image-latest - install - - tag - - - onap/dmaap/zookeeper - ${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1} - ${skip.docker.push} - - - - - push-image - deploy - - push - - - ${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2} - ${skip.docker.push} - - - - - push-image-latest - deploy - - push - - - ${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1} - ${skip.docker.push} - - - - - @@ -202,8 +115,7 @@ true true https://nexus.onap.org - nexus3.onap.org:10003 - https://nexus.onap.org + onap/dmaap/zookeeper @@ -247,7 +159,7 @@ project.properties['dockertag1']=project.properties['ver'] + "-latest"; project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp']; } else { - project.properties['dockertag1']=project.properties['ver']+ "-STAGING-latest"; + project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest"; project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp']; } println 'docker tag 1: ' + project.properties['dockertag1']; @@ -256,6 +168,46 @@ + + + io.fabric8 + docker-maven-plugin + 0.28.0 + + ${docker.verbose} + ${docker.apiVersion} + ${docker.pull.registry} + ${docker.push.registry} + + + ${docker.image.name} + + try + Dockerfile + + ${dockertag1} + ${dockertag2} + + + + + + + + generate-images + install + + build + + + + push-images + deploy + + push + + + diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 7e0d715..a82f351 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -1,17 +1,16 @@ -FROM ubuntu:16.04 +FROM openjdk:8-jre-alpine ENV ZK_USER=mrzookeeper \ ZK_DATA_DIR=/var/lib/zookeeper/data \ ZK_LOG_DIR=/var/log/zookeeper \ - JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 - + JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk ARG ZK_DIST=zookeeper-3.4.9 RUN set -x \ - && apt-get update \ - && apt-get install -y openjdk-8-jre-headless wget netcat-openbsd \ - && apt-get install -y git \ + && apk update \ + && apk add wget netcat-openbsd \ + && apk add bash git\ && wget -q "http://archive.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz" \ && wget -q "http://archive.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz.asc" \ && tar -xzf "$ZK_DIST.tar.gz" -C /opt \ @@ -34,7 +33,6 @@ RUN set -x \ /opt/zookeeper/$ZK_DIST.jar.asc \ /opt/zookeeper/$ZK_DIST.jar.md5 \ /opt/zookeeper/$ZK_DIST.jar.sha1 \ - && apt-get autoremove -y wget \ && rm -rf /var/lib/apt/lists/* # Copy configuration generator script to bin @@ -53,14 +51,12 @@ RUN set -x \ && ln -s /opt/zookeeper/lib/* /usr/share/zookeeper RUN chmod -R 777 /opt/zookeeper/bin -ENTRYPOINT /opt/zookeeper/bin/start-zookeeper.sh +ENTRYPOINT ["bash", "/opt/zookeeper/bin/start-zookeeper.sh"] EXPOSE 2181 2888 3888 -RUN useradd $ZK_USER \ +RUN adduser $ZK_USER --disabled-password \ && [ `id -u $ZK_USER` -eq 1000 ] \ && [ `id -g $ZK_USER` -eq 1000 ] \ && chown -R $ZK_USER:$ZK_USER /opt/$ZK_DIST/ /opt/zookeeper/ /var/lib/ /var/log/ /tmp/zookeeper/ USER $ZK_USER - - -- cgit 1.2.3-korg