-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathDockerfile_test_add
34 lines (26 loc) · 1.15 KB
/
Dockerfile_test_add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM debian:10.13
# First, try adding some regular files
ADD context/foo foo
ADD context/foo /foodir/
ADD context/bar/b* bar/
ADD . newdir
ADD ["context/foo", "/tmp/foo" ]
# Next, make sure environment replacement works
ENV contextenv ./context
ADD $contextenv/* /tmp/${contextenv}/
# Now, test extracting local tar archives
ADD context/tars/fil* /tars/
ADD context/tars/file.tar /tars_again
# This tar has some directories that should be ignored inside it.
ADD context/tars/sys.tar.gz /
# Test with ARG
ARG file
COPY $file /arg
# Finally, test adding a remote URL, concurrently with a normal file
ADD https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_linux_386-1.4.3.tar.gz context/foo /test/all/
# Test environment replacement in the URL
ENV VERSION=v2.1.0
ADD https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/${VERSION}/docker-credential-gcr_darwin_amd64-2.1.0.tar.gz /destination
# Test full url replacement
ENV URL=https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_linux_386-1.4.3.tar.gz
ADD $URL /otherdestination