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

Improve docker layer reuse with initFile config #79

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Aug 24, 2021

  • Add initFile configuration setting. This is the file (relative to the working directory) that should be copied into the bundle before we run terraform init during porter build. Limiting to a single file instead of the entire bundle source allows for layer caching when the bundle source changes. Defaults to copying the entire working directory (terraform),
    instead of the entire bundle source, which is at least some improvement, but we should encourage people to isolate their
    provider declarations into a single file.
  • Add workingDir configuration setting. Defaults to terraform and is relative to the bundle directory (/cnab/app). I am not defaulting it to /cnab/app/terraform because this allows us to locate the directory on the host during build.

Fixes #73
Fixes #16

* Add initFile configuration setting. This is the file (relative to the
working directory) that should be copied into the bundle before we run
terraform init during porter build. Limiting to a single file instead of
the entire bundle source allows for layer caching when the bundle source
changes. Defaults to copying the entire working directory (terraform),
instead of the entire bundle source,  which is at
least some improvement, but we should encourage people to isolate their
provider declarations into a single file.
* Add workingDir configuration setting. Defaults to terraform and is
relative to the bundle directory. I am not setting it to
/cnab/app/terraform because this allows us to locate the directory on
the host during build.

Fixes getporter#73
Fixes getporter#16

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
@carolynvs carolynvs marked this pull request as ready for review August 24, 2021 22:46
@carolynvs carolynvs requested a review from vdice August 24, 2021 22:46
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for adding.

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.

Optimize for layer caching during init Support specifying the configuration directory
2 participants