fail on image not found without panic; add extra chmod case to test dockerfile

This commit is contained in:
Alex Goodman 2018-12-01 19:01:59 -05:00
parent 1baa942d37
commit 53b11f4ecf
No known key found for this signature in database
GPG Key ID: 743640FAA11698A1
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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...")