-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Variable expansion in RUN --mount command does not work #2909
Comments
What version of dockerfile are you using? This was added in 1.3 https://github.com/moby/buildkit/releases/tag/dockerfile%2F1.3.0 |
This is the docker version output: >docker version
Client:
Cloud integration: v1.0.22
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:44:07 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0 |
Hmm I am not too familiar with different dockerfile versions. I have tried to add the # syntax line to my dockerfile:
but that resulted in another error:
|
ok, I got it working! Issue can be closed. Thanks for help @tonistiigi |
For future reference if anyone else runs into this issue, add the following as the very first line in the Dockerfile, before anything else including comments: Tested on:
|
I am trying to mount a source dir for one of my run commands in the docker file. Ideally, I would like to pass source dir as build-arg when calling docker build. However, I have noticed that the passed source dir is not correctly expanded. Here is a minimum dockerfile example reproducing the problem:
and then I call it as follows:
docker buildx build -f Dockerfile --build-arg source_dir=./data .
and this is the error I get:
It is a bit confusing as the first ERROR line shows the variable expanded, but then at the bottom, it shows it as not expanded.
According to the #2089 merge request, the variable expansion should be now supported?
The text was updated successfully, but these errors were encountered: