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

dockerfile: Labels, Alpine, & Multi-stage builds #151

Merged
merged 2 commits into from
Jun 27, 2018

Conversation

akutz
Copy link
Contributor

@akutz akutz commented Jun 19, 2018

This PR includes the following changes:

The Maintainer Label

The MAINTAINER keyword is deprecated, and the Dockerfile has been updated to use LABEL maintainer instead.

Alpine & Multi-stage builds

Two changes were made to the Dockerfile in order to reduce its size:

  1. The Dockerfile is now based on Alpine.
  2. Multi-stage builds are used to build the Terraform binaries.

The above changes reduces the size of the image from 1.72GB to 465MB.

This patch has been tested with the vSphere provider (#150) and verified that the switch to Alpine does not impede at least the standard Terraform binary or the Terraform provider binaries for: vSphere, AWS, Gzip+Base64.

Please note that I made myself the maintainer for the golang stage, while @denverwilliams is still listed as the maintainer for the primary stage. I am more than happy to revert this part of the change. I only did it to indicate who should support the build stage.

Testing

This change should be tested with all of the providers before being considered for merge:

  • AWS
  • GCE
  • OpenStack
  • Packet
  • vSphere

cc @denverwilliams

akutz added 2 commits June 19, 2018 09:26
This patch updates the Dockerfile so that it uses "LABEL maintainer=..."
instead of "MAINTAINER=..." as the latter has been deprecated.
This patch updates the Dockerfile:

* The Dockerfile is now based on Alpine in order to reduce the size of
the resulting image.
* Multi-stage builds are used to build the Terraform binaries. This also
reduces the size of the resulting image.

The above changes reduces the size of the image from 1.72GB to 465MB.

This patch has been tested with the vSphere provider (currently a PR)
and verified that the switch to Alpine does not impede at least the
standard Terraform binary or the Terraform provider binaries for:
vSphere, AWS, Gzip+Base64.
@denverwilliams denverwilliams merged commit 4fcf3a8 into crosscloudci:master Jun 27, 2018
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.

2 participants