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

"ARG requires exactly one argument" dockerfile-utils(4) #2760

Closed
oberfoerster opened this issue Mar 8, 2021 · 6 comments · Fixed by #2866
Closed

"ARG requires exactly one argument" dockerfile-utils(4) #2760

oberfoerster opened this issue Mar 8, 2021 · 6 comments · Fixed by #2866

Comments

@oberfoerster
Copy link

in Dockerfile:

...
ARG BUILD_ARG1=23 \
    BUILD_ARG2=42
...

renders following warning from dockerfile-utils: "ARG requires exactly one argument" albeit everything building and working as expected.

ENV:

Version: 1.43.2
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:52:11.516Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 3.10.0-1160.11.1.el7.x86_64
@bwateratmsft
Copy link
Contributor

bwateratmsft commented Mar 9, 2021

I guess it's debatable; the spec for ARG implies (but doesn't overtly state) that it takes only one item, optionally with a default value.

ARG <name>[=<default value>]

As an example for multiple, it gives the following:

FROM busybox
ARG user1
ARG buildno
# ...

@rcjsuen what do you think?

@bwateratmsft bwateratmsft added this to the 1.12.0 milestone Mar 10, 2021
@bwateratmsft bwateratmsft modified the milestones: 1.12.0, 1.13.0 Mar 24, 2021
@bwateratmsft bwateratmsft modified the milestones: 1.13.0, Future Apr 7, 2021
@ucheNkadiCode
Copy link
Contributor

@rcjsuen, do you think it's possible to make this dockerfile specification a little more flexible to include the user's ARG use case? The phrase "requires" makes it seem like their example won't run when it will.

@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 8, 2021

First of all, thank you to @oberfoerster for the bug report and my apologies for the late response. Been flooded with GitHub notifications and I haven't yet gotten around to pruning things down so this fell through the cracks. :(

So, with regards to ARG instructions taking in multiple arguments, that is a new feature introduced by moby/buildkit#1692 in the 20.10 release. I'll make the change in the language server so that this is no longer flagged as an error.

@bwateratmsft bwateratmsft modified the milestones: Future, 1.13.0 Apr 8, 2021
@bwateratmsft
Copy link
Contributor

Cool, didn't know it was explicitly added as a new capability. Thanks!

@oberfoerster
Copy link
Author

Thank You!
Seems, I'm an early adopter then ;)

@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 11, 2021

@oberfoerster I've opened #2866 to fix this.

@bwateratmsft bwateratmsft linked a pull request Apr 12, 2021 that will close this issue
@vscodebot vscodebot bot locked and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants