diff options
author | Alex Goodman <wagoodman@gmail.com> | 2018-12-01 19:01:59 -0500 |
---|---|---|
committer | Alex Goodman <wagoodman@gmail.com> | 2018-12-01 19:01:59 -0500 |
commit | 53b11f4ecf7e42b7896ad518932a22267fbcb23d (patch) | |
tree | 3b5c575129c69dda7843b791d416a238a9d4dd91 | |
parent | 1baa942d37a0e09ff62778010c4cd5a45b9405e2 (diff) |
fail on image not found without panic; add extra chmod case to test dockerfilev0.4.0
-rw-r--r-- | .data/Dockerfile | 1 | ||||
-rw-r--r-- | image/image.go | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/.data/Dockerfile b/.data/Dockerfile index 9f96d7d..fc82c55 100644 --- a/.data/Dockerfile +++ b/.data/Dockerfile @@ -2,6 +2,7 @@ FROM alpine:latest ADD README.md /somefile.txt RUN mkdir /root/example RUN cp /somefile.txt /root/example/somefile1.txt +RUN chmod 444 /root/example/somefile1.txt RUN cp /somefile.txt /root/example/somefile2.txt RUN cp /somefile.txt /root/example/somefile3.txt RUN mv /root/example/somefile3.txt /root/saved.txt diff --git a/image/image.go b/image/image.go index f788cee..2ceee51 100644 --- a/image/image.go +++ b/image/image.go @@ -268,7 +268,10 @@ func getImageReader(imageID string) (io.ReadCloser, int64) { fmt.Println(" Fetching metadata...") result, _, err := dockerClient.ImageInspectWithRaw(ctx, imageID) - check(err) + if err != nil { + fmt.Println(err.Error()) + utils.Exit(1) + } totalSize := result.Size fmt.Println(" Fetching image...") |