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

Add support for heredocs in ADD and COPY #98

Closed
rcjsuen opened this issue Aug 28, 2021 · 0 comments
Closed

Add support for heredocs in ADD and COPY #98

rcjsuen opened this issue Aug 28, 2021 · 0 comments
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Aug 28, 2021

# syntax=docker/dockerfile-upstream:master-labs
FROM alpine
COPY <<eot /app/out.txt
  hello
eot
$ DOCKER_BUILDKIT=1 docker build . --no-cache -t test
[+] Building 1.0s (11/11) FINISHED                                              
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 132B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile-upstream:master-  0.2s
 => CACHED docker-image://docker.io/docker/dockerfile-upstream:master-lab  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
 => [internal] preparing inline document                                   0.0s
 => CACHED [1/2] FROM docker.io/library/alpine@sha256:e1c082e3d3c45cccac8  0.0s
 => [2/2] COPY <<eot /app/out.txt                                          0.1s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:ea6a40bd045d6a06e5eaf39ec34b1dec85d9279a23352  0.0s
 => => naming to docker.io/library/test                                    0.0s
const utils = require("dockerfile-utils")
const problems = utils.validate("FROM alpine\nCOPY <<eot /app/out.txt\n  hello\neot");
console.log(problems.length);
1

The Dockerfile above is valid with the new heredoc syntax so we should not be reporting any errors.

@rcjsuen rcjsuen self-assigned this Aug 28, 2021
rcjsuen added a commit that referenced this issue Aug 28, 2021
Signed-off-by: Remy Suen <remy.suen@gmail.com>
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