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

Adding the option of passing custom --build-arg(s)… #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

steview
Copy link

@steview steview commented Aug 15, 2022

to docker buildx via Bash functions

@rwadstein
Copy link
Member

Can you give an example of how this would have been used?

@AlexCoplandSage
Copy link

Sorry to revive an old PR but I've come across a situation where passing custom build-args seems to be required.

We've built a shared package for accessing SBC and are currently hosting this on the GoProposal Github account. To install this we need to add a fine grained read-only token for composer so it can access the repo. We're in the process of getting the token added to the pipeline environment variables but we're currently stuck getting the token into the docker build.

We had some success adding the token as a deployment variable and installing the package within entrypoint.sh, but this feels like the wrong side to perform the installation. As far as I understand if we pass the token as a --build-arg and clean up after composer has pulled the package the token shouldn't remain within the image.

Have we missed something obvious here or is the a better way to do things?

"--secret id=jfrog,env=BUNDLE_SAGEONEGEMS__JFROG__IO"
"--ssh default $OPTIONAL_TARGET"
"-t $REPO:$tag"
"${build_args/"--build_arg"/"--build-arg"}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this replacement still work if there are multiple build arg? This test suggests not..

$ var='foo bar wibble bar'
$ echo ${var/bar/meep}
foo meep wibble bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants