Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Moritz Röhrich edited this page Sep 24, 2025 · 1 revision

Problematic code:

Any of the following

RUN go install foobar
RUN go install barfoo@latest
RUN go get foobar
RUN go get barfoo@latest
RUN go run foobar
RUN go run barfoo@latest

Correct code:

Pin the versions of your dependencies or use code from the local filesystem:

RUN go install [email protected]
RUN go install [email protected]
RUN go get [email protected]
RUN go get [email protected]
RUN go run [email protected]
RUN go run [email protected]
RUN go run .
RUN go run /go/app/foobar

Rationale:

Version pinning helps avoid unanticipated changes to the code and behavior. It also makes changes to dependencies obvious in source control systems and helps make builds more reproducible.

Clone this wiki locally