================== Basic heredoc ================== FROM busybox AS build RUN <> /dest whoami >> /dest EOF FROM scratch COPY --from=build /dest /dest --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (run_instruction (shell_command (shell_fragment (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_line) (heredoc_end))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================== Basic heredoc with space after marker ================== FROM busybox AS build RUN <> /dest whoami >> /dest EOF FROM scratch COPY --from=build /dest /dest --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (run_instruction (shell_command (shell_fragment (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_line) (heredoc_end))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================== Run heredoc ================== FROM busybox AS build SHELL ["/bin/awk"] RUN < "/dest" } EOF FROM scratch COPY --from=build /dest /dest --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (shell_instruction (json_string_array (json_string))) (run_instruction (shell_command (shell_fragment (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_end))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================== Run heredoc with shebang ================== FROM busybox AS build RUN <> "/dest" print "world" >> "/dest" } EOF FROM scratch COPY --from=build /dest /dest --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (run_instruction (shell_command (shell_fragment (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_end))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================== Run complex heredoc ================== FROM busybox AS build WORKDIR /dest RUN cat < ./out1; \ cat < ./out2 hello WORLD EOF1 HELLO world EOF2 RUN < 0) print tolower(line) > "./fd3" while ((getline line < "/proc/self/fd/4") > 0) print toupper(line) > "./fd4" } EOF hello WORLD IN1 HELLO world IN2 FROM scratch COPY --from=build /dest / --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (workdir_instruction (path)) (run_instruction (shell_command (shell_fragment (heredoc_marker)) (line_continuation) (shell_fragment (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_end)) (heredoc_block (heredoc_line) (heredoc_end))) (run_instruction (shell_command (shell_fragment (heredoc_marker) (heredoc_marker) (heredoc_marker))) (heredoc_block (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_line) (heredoc_end)) (heredoc_block (heredoc_line) (heredoc_end)) (heredoc_block (heredoc_line) (heredoc_end))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================================= Copy with heredoc ================================= FROM busybox AS build RUN adduser -D user WORKDIR /dest COPY <> perms && \ stat -c "%04a" /permfiles/rw >> perms && \ stat -c "%U:%G" /permfiles/owned >> perms FROM scratch COPY --from=build /dest / --- (source_file (from_instruction (image_spec (image_name)) (image_alias)) (run_instruction (shell_command (shell_fragment))) (workdir_instruction (path)) (copy_instruction (path (heredoc_marker)) (path) (heredoc_block (heredoc_line) (heredoc_end))) (copy_instruction (path (heredoc_marker)) (path (heredoc_marker)) (path) (heredoc_block (heredoc_line) (heredoc_end)) (heredoc_block (heredoc_line) (heredoc_end))) (run_instruction (shell_command (shell_fragment))) (copy_instruction (param) (path (heredoc_marker)) (path) (heredoc_block (heredoc_line) (heredoc_end))) (copy_instruction (param) (path (heredoc_marker)) (path) (heredoc_block (heredoc_line) (heredoc_end))) (copy_instruction (param) (path (heredoc_marker)) (path) (heredoc_block (heredoc_line) (heredoc_end))) (run_instruction (shell_command (shell_fragment) (line_continuation) (shell_fragment) (line_continuation) (shell_fragment))) (from_instruction (image_spec (image_name))) (copy_instruction (param) (path) (path))) ================== Heredoc with special symbols ================== FROM scratch COPY <