| 1 |
FROM docker.io/library/python:latest |
| 2 |
RUN <<EOF |
| 3 |
echo "Hello" >> /hello |
| 4 |
echo "World!" >> /hello |
| 5 |
EOF |
| 6 |
|
| 7 |
RUN <<-EOF |
| 8 |
echo "hello" |
| 9 |
echo "world" |
| 10 |
EOF |
| 11 |
|
| 12 |
RUN <<heredoc |
| 13 |
echo "hello" |
| 14 |
echo "world" |
| 15 |
heredoc |
| 16 |
|
| 17 |
RUN <<-heredoc |
| 18 |
echo "hello" |
| 19 |
echo "world" |
| 20 |
heredoc |
| 21 |
|
| 22 |
RUN 0<<heredoc |
| 23 |
echo "hello" |
| 24 |
echo "world" |
| 25 |
heredoc |
| 26 |
|
| 27 |
RUN 0<<-heredoc |
| 28 |
echo "hello" |
| 29 |
echo "world" |
| 30 |
heredoc |
| 31 |
|
| 32 |
RUN 0<<-"heredoc" |
| 33 |
echo "hello" |
| 34 |
echo "world" |
| 35 |
heredoc |
| 36 |
|
| 37 |
RUN 0<<"heredoc" |
| 38 |
echo "hello" |
| 39 |
echo "world" |
| 40 |
heredoc |
| 41 |
|
| 42 |
RUN 5<<EOF cat /proc/self/fd/5 > file.txt |
| 43 |
this is the file |
| 44 |
EOF |
| 45 |
|
| 46 |
RUN cat /proc/self/fd/5 /proc/self/fd/6 5<<FILE1 6<<FILE2 > file.txt |
| 47 |
this is the first file |
| 48 |
FILE1 |
| 49 |
this is the second file |
| 50 |
FILE2 |
| 51 |
|
| 52 |
RUN cat /proc/self/fd/5 /proc/self/fd/6 5<<FILE1 > file.txt 6<<FILE2 |
| 53 |
this is the first file |
| 54 |
FILE1 |
| 55 |
this is the second file |
| 56 |
FILE2 |
| 57 |
|
| 58 |
RUN cat 0<<EOF > file.txt |
| 59 |
this is the file |
| 60 |
EOF |
| 61 |
|
| 62 |
RUN 5<<file cat /proc/self/fd/5 /proc/self/fd/6 6<<FILE | cat /dev/stdin /proc/self/fd/6 6<<File > file.txt |
| 63 |
this is the first file |
| 64 |
file |
| 65 |
this is the second file |
| 66 |
FILE |
| 67 |
this is the third file |
| 68 |
File |
| 69 |
|
| 70 |
RUN python3 <<EOF |
| 71 |
with open("/hello", "w") as f: |
| 72 |
print("Hello", file=f) |
| 73 |
print("Something", file=f) |
| 74 |
EOF |
| 75 |
|
| 76 |
ADD <<EOF /index.html |
| 77 |
(your index page goes here) |
| 78 |
EOF |
| 79 |
|
| 80 |
COPY <<robots.txt <<humans.txt /test/ |
| 81 |
(robots content) |
| 82 |
robots.txt |
| 83 |
(humans content) |
| 84 |
humans.txt |
| 85 |
|
| 86 |
# heredoc with terminator followed by |
| 87 |
# non-empty line. |
| 88 |
RUN 0<<-"heredoc" |
| 89 |
echo "hello" |
| 90 |
echo "world" |
| 91 |
heredoc |
| 92 |
RUN cat index.html |
| 93 |
RUN cat hello |