File: Dockerfile.env-precedence

package info (click to toggle)
golang-github-containers-buildah 1.39.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,724 kB
  • sloc: sh: 2,398; makefile: 236; perl: 187; asm: 16; awk: 12; ansic: 1
file content (17 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM alpine
ENV a=b
ENV c=d
# E and G are passed in on the command-line, and we haven't overridden them yet, so the command will get the CLI values.
RUN echo a=$a c=$c E=$E G=$G
ENV E=E G=G
# We just set E and G, and that will override values passed at the command line thanks to imagebuilder's handling of ENV instructions.
RUN echo a=$a c=$c E=$E G=$G

FROM 0
ENV w=x
ENV y=z
# I and K are passed in on the command-line, and we haven't overridden them yet, so the command will get the CLI values.
RUN echo w=$w y=$y I=$I K=$K
ENV I=I K=K
# We just set I and K, and that will override values passed at the command line thanks to imagebuilder's handling of ENV instructions.
RUN echo w=$w y=$y I=$I K=$K