-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
When I define an argument (ARG) or an environment variable (ENV) and then try to use it in the RUN --mount=type=bind,... command, I don't get the mount working.
How to reproduce:
Docker version:
$ docker version
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:01 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:06:30 2019
OS/Arch: linux/amd64
Experimental: false
I used the following Dockerfile with BUILDKIT=1 and it failed. If I only change ...target=${TEMPORARY_MOUNT_POINT}... to ...target=/tmp-mount..., it works
# syntax = docker/dockerfile:experimental
FROM ubuntu:14.04.5
ARG TEMPORARY_MOUNT_POINT=/tmp-mount
RUN --mount=type=bind,source=./,target=${TEMPORARY_MOUNT_POINT} \
ls ${TEMPORARY_MOUNT_POINT}
I also tried using ENV instead of the ARG command, but I had the same results.
The failing and non-failing Dockerfile's are attached (I had to add .txt extension, they are ordinary Dockerfiles)
Dockerfile.fail.txt
Dockerfile.success.txt
Reactions are currently unavailable