diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f861983 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.4 + +RUN apt-get update +RUN apt-get -y install sudo + +COPY . /go/src/github.com/jwilder/docker-squash +RUN go get github.com/jwilder/docker-squash + +ENTRYPOINT ["docker-squash"] diff --git a/export.go b/export.go index f6678c2..ed5b785 100644 --- a/export.go +++ b/export.go @@ -588,7 +588,7 @@ func (e *Export) rewriteChildren(entry *ExportedImage) error { continue } - if strings.Contains(cmd, "#(nop)") && !strings.Contains(cmd, "ADD") { + if strings.Contains(cmd, "#(nop)") && !(strings.Contains(cmd, "ADD") || strings.Contains(cmd, "COPY")) { newEntry, err := e.ReplaceLayer(entry.LayerConfig.Id) if err != nil { return err