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

Fix make build-docker-local #100

Merged
merged 1 commit into from Mar 19, 2020
Merged

Fix make build-docker-local #100

merged 1 commit into from Mar 19, 2020

Conversation

trevoro
Copy link
Contributor

@trevoro trevoro commented Mar 19, 2020

This commit addresses a couple problems with the Dockerfile which was
resulting in a failed build. The likely culprit of this not being caught
earlier was some cached images. This does two things

  1. It removes unnecessary references to things that aren't being used
    any more. The ENV setting was removed in a previous commit, but not the
    reference of it later in the Dockerfile. If this is in error please let
    me know!
  2. The go modules are cached in a layer as these are much less likely to
    change between build runs than the source code itself. The technique is
    simple enough; just copy the files in a separate COPY and run go mod download. This reduces the hydrated build time (previous layers cached)
    from 2m35s on average (3 runs) to 34s on average (3 runs).

This commit addresses a couple problems with the Dockerfile which was
resulting in a failed build. The likely culprit of this not being caught
earlier was some cached images. This does two things

1. It removes unnecessary references to things that aren't being used
any more. The ENV setting was removed in a previous commit, but not the
reference of it later in the Dockerfile. If this is in error please let
me know!
2. The go modules are cached in a layer as these are much less likely to
change between build runs than the source code itself. The technique is
simple enough; just copy the files in a separate COPY and run `go mod
download`. This reduces the hydrated build time (previous layers cached)
from  2m35s on average (3 runs) to 34s on average (3 runs).
@trevoro trevoro requested a review from bmonkman March 19, 2020 00:54
Copy link
Member

@bmonkman bmonkman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@trevoro trevoro merged commit 213e49b into master Mar 19, 2020
@trevoro trevoro deleted the fix branch March 19, 2020 03:06
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