diff options
author | Bogumil Zebek <bogumil.zebek@nokia.com> | 2020-09-01 14:26:24 +0200 |
---|---|---|
committer | Zebek Bogumil <bogumil.zebek@nokia.com> | 2020-09-02 07:03:12 +0200 |
commit | f5bd1d9c36266cfa62ac81a7f70e9f9eb7810e41 (patch) | |
tree | dc104bef8a95344cb04866175aa357987b7d3012 /vnfmarket-be/deployment | |
parent | 6ede5a7097df3122af7ddf9c850db737afa1e664 (diff) |
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 <bogumil.zebek@nokia.com>
Change-Id: I8b653c0b2050b3dce26ff33f6cdfdc6603e4fff6
Diffstat (limited to 'vnfmarket-be/deployment')
-rw-r--r-- | vnfmarket-be/deployment/docker/docker-refrepo/src/main/docker/Dockerfile | 23 |
1 files 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 |