假设我们有这个:
RUN go get 'github.com/foo/one'
RUN go get 'github.com/foo/two'
RUN go get 'github.com/foo/three'
我们改变顺序:
RUN go get 'github.com/foo/two'
RUN go get 'github.com/foo/three'
RUN go get 'github.com/foo/one'
缓存将完全失效。有没有办法告诉docker build
依赖的顺序无关紧要。像这样的一些语法:
PARALLEL START
RUN go get 'github.com/foo/two'
RUN go get 'github.com/foo/three'
RUN go get 'github.com/foo/one'
PARALLEL END