Skip to content

Support devcontainer.json option 'buildArgs' #4352

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

Closed
jeffreyjam opened this issue Jan 25, 2021 · 5 comments
Closed

Support devcontainer.json option 'buildArgs' #4352

jeffreyjam opened this issue Jan 25, 2021 · 5 comments
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@jeffreyjam
Copy link

Currently in devcontainer.json it's possible to pass a list of arguments to docker run with the runArgs option, but there's no corresponding buildArgs option to pass a list of arguments to docker build.

For my particular case I'm looking to pass the --pull argument to docker build so I can keep my devcontainers up to date by rebuilding them and don't have to bump versions by hand.

It looks like some people over in #2200 are looking for the ability to pass the --no-cache option, and I bet there are other options people would like to pass too.

The docker build options --target and --build-arg were added as a part of #46 last year but it stopped short of adding the ability to pass arbitrary options, which would be really convenient.

There exists the similar-sounding build.args option in devcontainer.json right now, so it might be better to use a different name than buildArgs, for example build.options or build.cliArgs.

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jan 25, 2021
@felipecrs
Copy link

buildArgs would be very helpful, despite I think --pull should be along with the default docker build command for the devcontainer.

@chrmarti chrmarti added the feature-request Request for new features or functionality label Jan 27, 2021
@chrmarti chrmarti added this to the Backlog milestone Jan 27, 2021
@eitsupi
Copy link

eitsupi commented Mar 27, 2021

+1

If we want to use --add-host in a container, we can write it in runArgs, but if we want to use it during build, there is no way to set it.

"runArgs": ["--add-host=host.docker.internal:host-gateway"]

@felipecrs
Copy link

This seems to be a duplicate of #3545.

@pgs31
Copy link

pgs31 commented Jun 17, 2021

+1 I'd love to be able to use this so I can use docker build --ssh. I haven't been able to find a good way to get my private key into the docker build stage other than pasting it into devcontainer.json as a docker build arg.

@Chuxel
Copy link
Member

Chuxel commented Nov 10, 2021

Doing some dupe cleanup. Closing as dupe of #3545

@Chuxel Chuxel closed this as completed Nov 10, 2021
@Chuxel Chuxel added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants