Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Shrink Docker image sizes via OpenJDK 8 JRE 'slim' base images #27

Open
mbrukman opened this issue Jun 23, 2019 · 2 comments
Open

Shrink Docker image sizes via OpenJDK 8 JRE 'slim' base images #27

mbrukman opened this issue Jun 23, 2019 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mbrukman
Copy link
Member

The currently-built JanusGraph Docker images are way too large. While recent releases are on the order of 260-270MB, the built containers are much larger.

Compare:

Version Release zip size Docker image size
0.2.2 276 MB 702 MB
0.2.3 276 MB 675 MB
0.3.1 261 MB 647 MB
0.3.2 261 MB N/A (not published yet)

It may be because the current Docker images are built using the base image openjdk:8-jdk but we don't need the JDK for running JanusGraph, that's what we need to compile it. Thus, we can simply use the JRE instead of the JDK for running it, so we can start using openjdk:8-jre.

Further, we can get rid of even more unneeded support in the base image by switching to openjdk:8-jre-slim which should be sufficient for running JanusGraph.

These image versions are listed on OpenJDK image files.

For details on these image versions, see this SO answer which breaks down the various types of OpenJDK Docker image base images.

@farodin91
Copy link
Contributor

We could also switch to alpine.

@mbrukman
Copy link
Member Author

@farodin91 — good call! Looking at all available tags, here are our OpenJDK 8 Alpine-based base image candidates:

  • openjdk:8-jre-alpine
  • openjdk:8-jre-alpine3.7
  • openjdk:8-jre-alpine3.8
  • openjdk:8-jre-alpine3.9

so we can use one of the versioned base images to create smaller images.

farodin91 added a commit to farodin91/janusgraph-docker that referenced this issue Jan 20, 2021
Part of JanusGraph#60, JanusGraph#27

* Add security scanning using AquaSecurity Trivy
* Security scan results can be found here: https://github.com/JanusGraph/janusgraph-docker/security/code-scanning
* Use openjdk:8-jre-slim-buster instead of openjdk:8-jdk

Signed-off-by: Jan Jansen <[email protected]>
farodin91 added a commit to farodin91/janusgraph-docker that referenced this issue Feb 2, 2021
Part of JanusGraph#60, JanusGraph#27

* Add security scanning using AquaSecurity Trivy
* Security scan results can be found here: https://github.com/JanusGraph/janusgraph-docker/security/code-scanning
* Use openjdk:8-jre-slim-buster instead of openjdk:8-jdk
* Use debian:buster-slim as builder layer

Signed-off-by: Jan Jansen <[email protected]>
farodin91 added a commit that referenced this issue Feb 3, 2021
Part of #60, #27

* Add security scanning using AquaSecurity Trivy
* Security scan results can be found here: https://github.com/JanusGraph/janusgraph-docker/security/code-scanning
* Use openjdk:8-jre-slim-buster instead of openjdk:8-jdk
* Use debian:buster-slim as builder layer

Signed-off-by: Jan Jansen <[email protected]>
@FlorianHockmann FlorianHockmann added enhancement New feature or request help wanted Extra attention is needed labels Jun 16, 2022
lionelfleury added a commit to lionelfleury/janusgraph-docker that referenced this issue Jun 17, 2022
Fixes JanusGraph#27

Signed-off-by: Lionel Fleury <[email protected]>
lionelfleury added a commit to lionelfleury/janusgraph-docker that referenced this issue Jun 17, 2022
Fixes JanusGraph#27

Signed-off-by: Lionel Fleury <[email protected]>
lionelfleury added a commit to lionelfleury/janusgraph-docker that referenced this issue Jun 17, 2022
Fixes JanusGraph#27

Signed-off-by: Lionel Fleury <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants