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

introduce docker multistage build to alpine image #276

Merged
merged 2 commits into from Jan 9, 2020

Conversation

mmacata
Copy link
Contributor

@mmacata mmacata commented Jan 9, 2020

With this PR, docker multistage-build is used for the alpine image. The order of the commands in the Dockerfile are only rearranged and a COPY statement was added. Additionally the environtment variable resolution for CMD was fixed.

Now there are the following stages:

  • FROM alpine:edge as common (includes build- and runtime requirements)
  • FROM common as build (compiles GRASS GIS)
  • FROM common as grass (Copies compiled code from build)
  • FROM grass as test (Preprares tests)
  • FROM grass as final (Finalizes small Dockerimage)

As a result, the Dockerimage is much smaller (local build vs existing one from dockerhub):

docker images
grass-py3-pdal             latest-alpine   b2fd2c918c87    8 minutes ago   337MB
mundialis/grass-py3-pdal   latest-alpine   4c371a9c6f84    14 hours ago    900MB

@neteler neteler merged commit 77c77f4 into OSGeo:master Jan 9, 2020
neteler pushed a commit that referenced this pull request Jan 9, 2020
introduce docker multistage build to alpine image, reducing significantly the image size
@neteler
Copy link
Member

neteler commented Jan 9, 2020

Excellent work, thanks!

@neteler
Copy link
Member

neteler commented Jan 9, 2020

Backported to relbranch78 in 25f6035

landam pushed a commit to landam/grass that referenced this pull request Jan 28, 2020
introduce docker multistage build to alpine image, reducing significantly the image size
@neteler neteler added this to the 7.8.3 milestone Feb 11, 2020
petrasovaa pushed a commit to petrasovaa/grass that referenced this pull request Feb 18, 2020
introduce docker multistage build to alpine image, reducing significantly the image size
@mmacata mmacata deleted the docker-alpine-multistage branch March 29, 2022 07:52
@mmacata mmacata restored the docker-alpine-multistage branch March 29, 2022 07:52
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.

None yet

2 participants