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

Allow heredocs to be defined anywhere on the instruction's first line #96

Closed
rcjsuen opened this issue Aug 12, 2021 · 1 comment
Closed
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Aug 12, 2021

# syntax=docker/dockerfile-upstream:master-labs
FROM alpine
COPY a.txt <<file b.txt <<file2 /destination/
abc
file
def
file2
$ DOCKER_BUILDKIT=1 docker build --no-cache .
[+] Building 1.2s (13/13) FINISHED                                          
 => [internal] load build definition from Dockerfile                   0.0s
 => => transferring dockerfile: 31B                                    0.0s
 => [internal] load .dockerignore                                      0.0s
 => => transferring context: 2B                                        0.0s
 => resolve image config for docker.io/docker/dockerfile-upstream:mas  0.1s
 => CACHED docker-image://docker.io/docker/dockerfile-upstream:master  0.0s
 => [internal] load build definition from Dockerfile                   0.0s
 => [internal] load .dockerignore                                      0.0s
 => [internal] load metadata for docker.io/library/alpine:latest       0.1s
 => CACHED [internal] preparing inline document                        0.0s
 => [internal] load build context                                      0.0s
 => => transferring context: 52B                                       0.0s
 => [1/2] FROM docker.io/library/alpine@sha256:eb3e4e175ba6d212ba1d6e  0.3s
 => => resolve docker.io/library/alpine@sha256:eb3e4e175ba6d212ba1d6e  0.0s
 => => sha256:021b3423115ff662225e83d7e2606475217de7b 1.47kB / 1.47kB  0.0s
 => => sha256:29291e31a76a7e560b9b7ad3cada56e8c18d50a 2.81MB / 2.81MB  0.1s
 => => sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c 1.64kB / 1.64kB  0.0s
 => => sha256:be9bdc0ef8e96dbc428dc189b31e2e3b05523d96d12 528B / 528B  0.0s
 => => extracting sha256:29291e31a76a7e560b9b7ad3cada56e8c18d50a96cca  0.2s
 => CACHED [internal] preparing inline document                        0.0s
 => [2/2] COPY a.txt <<file b.txt <<file2 /destination/                0.2s
 => exporting to image                                                 0.0s
 => => exporting layers                                                0.0s
 => => writing image sha256:278b87bb3d532c3d659462a84487ae4713ca06f39  0.0s
@rcjsuen rcjsuen self-assigned this Aug 12, 2021
@rcjsuen
Copy link
Owner Author

rcjsuen commented Aug 12, 2021

This is only implemented for ADD, COPY, RUN, and their corresponding ONBUILD versions. We'll keep an eye on how things evolve in BuildKit and add support for other instructions as they come up.

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

No branches or pull requests

1 participant