Add source after installing apk packages to avoid breaking docker cache#2598
Merged
halseth merged 1 commit intolightningnetwork:masterfrom Oct 30, 2019
Merged
Add source after installing apk packages to avoid breaking docker cache#2598halseth merged 1 commit intolightningnetwork:masterfrom
halseth merged 1 commit intolightningnetwork:masterfrom
Conversation
Currently, changing the source code causes the docker layer cache to break the caching of package installation (make, git, etc). If we execute the source COPY command as an individual command, then rebuilds of the container will be much quicker.
skwp
commented
Feb 6, 2019
| make | ||
|
|
||
| # Copy in the local repository to build from. | ||
| COPY . /go/src/github.com/lightningnetwork/lnd |
Contributor
Author
There was a problem hiding this comment.
the only change in this PR is moving the COPY line after the RUN apk add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, changing the source code causes the docker layer cache to break the caching of package installation (make, git, etc). This makes rebuilds of the container due to source code changes unnecessarily expensive.
If we execute the source COPY command as an individual command, after the installation of the OS packages, then rebuilds of the container will be much quicker.
Pull Request Checklist
Contribution Guidelines
Code Documentation and Commenting section
the positive and negative (error paths) conditions (if applicable)
the bug being fixed to prevent regressions
logging level
go fmt(the tab character should be counted as 8 characters, not 4, as some IDEs do
per default)
make checkdoes not fail any testsgo vetdoes not report any issuesmake lintdoes not report any new issues that did notalready exist
cases it can be justifiable to violate this condition. In that case, the
reason should be stated in the commit message.