skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Dockerfile 1.4 heredoc syntax not supporter

Open jsok opened this issue 3 years ago • 1 comments

Expected behavior

A Dockerfile like the following should build:

# syntax=docker/dockerfile:1.4
FROM scratch
COPY <<EOF /hello.text
Hello, World!
EOF

Syntax reference: https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/reference.md#here-documents

Actual behavior

Skaffold returns the error:

getting hash for artifact "heredoc-example": getting dependencies for "heredoc-example": file pattern [<<EOF] must match at least one file

Information

  • Skaffold version: v2.0.2
  • Operating system: macOS 12.6.1
  • Installed via: homebrew
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta28
kind: Config
build:
  local:
    useBuildkit: true
  artifacts:
    - image: heredoc-example
      docker:
        dockerfile: Dockerfile

Steps to reproduce the behavior

Use the above skaffold.yaml and Dockerfile to reproduce.

jsok avatar Nov 28 '22 01:11 jsok

Late to the party, but for future reference, the workaround is to set --cache-artifacts=false and heredoc syntax will work.

johanjk avatar Oct 16 '23 08:10 johanjk