$ cat <<EOF
line1
line2
EOF
line1
line2
Supported in Dockerfile
with experimental syntax >= 1.3-labs
Fist line of Dockerfile
must be:
# syntax=docker/dockerfile:1.3-labs
Use RUN
like a script block
No more &&
and \
RUN <<EOF
ps faux
EOF
Test RUN with script block:
docker build . --file Dockerfile.run
Use a custom interpreter for the script block
RUN bash -xe <<EOF
echo foo
EOF
Test RUN with interpreter:
docker build . --file Dockerfile.interpreter
Provide shebang to set interpreter
RUN <<EOF
#!/bin/bash
ps faux
EOF
Test RUN with script:
docker build . --file Dockerfile.script
Provide inline file
COPY --chmod=0755 <<"EOF" /entrypoint.sh
#!/bin/bash
exec "$@"
EOF
Test COPY with inline file:
docker build . --file Dockerfile.copy
Create multiple files in a single COPY
COPY <<no-recommends <<no-suggests /etc/apt/apt.conf.d/
APT::Install-Recommends "false";
no-recommends
APT::Install-Suggests "false";
no-suggests
Test COPY with multiple files:
docker build . --file Dockerfile.copy-multiple