From f5bd1d9c36266cfa62ac81a7f70e9f9eb7810e41 Mon Sep 17 00:00:00 2001 From: Bogumil Zebek Date: Tue, 1 Sep 2020 14:26:24 +0200 Subject: Optimize the refrepo image - remove an Ubuntu image as a base of refrepo image - reduce size of refrepo image from 1,01 GB to 824MB - reduce time of image creation from 4 minutes to 2 minutes Issue-ID: VNFSDK-646 Signed-off-by: Zebek Bogumil Change-Id: I8b653c0b2050b3dce26ff33f6cdfdc6603e4fff6 --- .../docker-refrepo/src/main/docker/Dockerfile | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile b/vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile index 21086fc5..6a9eaa56 100644 --- a/vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile +++ b/vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile @@ -18,7 +18,7 @@ # 10-basebuild.txt -FROM ubuntu:20.04 +FROM openjdk:11-jre-slim ARG DEBIAN_FRONTEND=noninteractive ENV JAVA_VERSION_MAJOR=11 \ @@ -30,32 +30,19 @@ ENV JAVA_VERSION_MAJOR=11 \ # Install required libraries RUN apt-get update && apt-get install -y \ curl \ + procps \ g++ \ make \ nano \ nginx \ nodejs \ npm \ - software-properties-common \ sudo \ unzip \ wget \ - && rm -rf /var/lib/apt/lists/* - -# Install Java -WORKDIR /service -RUN add-apt-repository ppa:openjdk-r/ppa -y && \ - # update data from repositories - apt-get update && \ - # Make info file about this build - printf "Build of java:openjdk-11-jre-headless, date: %s\n" `date -u +"%Y-%m-%dT%H:%M:%SZ"` > /service/java && \ - # install application - apt-get install -y --no-install-recommends openjdk-11-jre-headless && \ - # fix default setting - ln -s java-11-openjdk-amd64 /usr/lib/jvm/default-jvm && \ - # remove apt cache from image - apt-get clean all && \ - rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && sudo mkdir -p /usr/lib/jvm/default-jvm \ + && sudo ln -s /usr/local/openjdk-11/* /usr/lib/jvm/default-jvm # Download and set up Tomcat WORKDIR /service -- cgit 1.2.3-korg