Dockerfile heredocs don't work, failing with "unknown instruction"

Hi, I have an issue with remote builders.

I’m trying to build a dockerfile with so-called heredocs, it works locally but not on builders. No Idea how to proceed further.

My dockerfile looks like this:


// some stuff here

RUN <<EOF

echo $0

mkdir /opt/maven

EOF

// some stuff here

Error I get:

Error: failed to fetch an image or build from source: error building: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 16: unknown instruction: ECHO

Command I run locally:

docker buildx build --platform linux/amd64 -t image-name:latest -f Dockerfile.native.build .

Considering this topic, fly should support buildx.

1 Like

Hi,

Our builders don’t yet support Docker heredoc syntax. You can either move the content to a file and include it via COPY, execute each command using RUN, or build locally with fly deploy --local-only to leverage your local, heredoc-aware Docker installation and only push the completed image which should work fine.

Regards,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.