Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Alpine Docker image and multi-stage building #60

Open
sinoz opened this issue Mar 26, 2019 · 0 comments
Open

Use Alpine Docker image and multi-stage building #60

sinoz opened this issue Mar 26, 2019 · 0 comments

Comments

@sinoz
Copy link

sinoz commented Mar 26, 2019

https://github.com/Tomm0017/rsmod/blob/master/Dockerfile#L11

The distributor of the zenika/kotlin:1.3-jdk8 image also provides Alpine images which will reduce the size down by roughly 500mb:

Screenshot from 2019-03-26 23-10-40

Though a better solution would be to make use of multi-stage building using either one of those images presented above for just building a fat JAR:

# Start with the Alpine image for building (You can also use the larger one as this image will be discarded eventually)
FROM zenika/kotlin:1.3-eap-jdk8-alpine AS builder

# Imagine Gradle commands here building our fat JAR

# Restart using probably the smallest JRE image available
FROM openjdk:8-jre-alpine

# Copy over the fat JAR
COPY --from=builder /my_fat_jar.jar /app/

This fat JAR would include everything RS MOD needs. The JAR can then be copied over to an OpenJDK based JRE image as this image is even smaller than the Kotlin Alpine one.

Tomm0017 added a commit that referenced this issue Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant