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.
Our Vapor project that uses the Docker runtime depends on certain PHP extensions that have .ini configuration values that need to be set at image build time.
The value of these configurations vary by environment and also contains some sensitive values such as API keys.
To prevent hardcoding these values in the Dockerfile, we've defined
sed
commands in thebuild
vapor.yml key of each environment that replace placeholder strings in our Dockerfiles prior to the image being built.It's a kind of hacky approach. it'd be more ideal if we could make use of the Dockerfile
ARG
keyword and thedocker build --build-arg
option.This PR allows for defining a
build-arg
key for each environment in vapor.yml.ex:
Build arguments can also be provided to the deploy and build commands. This can be leveraged to inject secret values from the CI pipeline.
ex:
vapor deploy staging --build-arg FOO=BAR --build-arg FIZZ=BUZZ
vapor build staging --build-arg FOO=BAR --build-arg FIZZ=BUZZ
The merged build arguments from vapor.yml and the deploy/build command options will be passed to the
docker build
command.If a build argument is present in both vapor.yml and as a CLI option, the CLI option value will take priority.