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

Slim down hoisted docker container a touch #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Shadowfiend
Copy link

We use multistage builds to drop the compressed size of the container down ~70%
to ~= 130M using the openjdk alpine base image.

We use multistage builds to drop the compressed size of the container down ~70%
to ~= 130M using the openjdk alpine base image.
@Shadowfiend
Copy link
Author

See https://hub.docker.com/r/shadowfiend/hoisted/tags/ for resulting size with latest hoisted.

This dockerfile isn't quite ready yet, it's set up for local testing.

Since the Dockerfile now copies hoisted from the local fs so as to maximize
build speed, we need to clone it outside the file.
@Shadowfiend
Copy link
Author

Ok, pushed a tweak to build.sh that clones hoisted outside docker and then removes it post-build, if that sounds okay.

Core idea: let the clone happen in the parent fs, then let docker detect when existing intermediate stages line up properly. The new structure should ensure that only a change in build.sbt triggers a full refetch of dependencies (by caching the intermediate stage where we do the dep fetch).

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

Successfully merging this pull request may close these issues.

1 participant