diff --git a/Dockerfile b/Dockerfile index 9cc3fb0..48b597c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ -FROM golang:1.27.2 AS binary +FROM golang:1.27.3 AS binary WORKDIR /go/src/github.com/jwilder/dockerize COPY *.go go.* /go/src/github.com/jwilder/dockerize/ ARG VERSION=dev ENV GO111MODULE=on -RUN go mod tidy -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.buildVersion=${VERSION}" -a -o /go/bin/dockerize . +RUN go mod download +RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -ldflags "-X main.buildVersion=${VERSION}" -a -o /go/bin/dockerize . FROM gcr.io/distroless/static:nonroot LABEL maintainer="Jason Wilder " diff --git a/go.mod b/go.mod index 944ac8f..b490702 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/jwilder/dockerize -go 1.27.2 +go 1.27.3 require ( github.com/Masterminds/sprig/v3 v3.3.0 @@ -17,11 +17,11 @@ require ( github.com/fsnotify/fsnotify v1.10.1 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/huandu/xstrings v1.6.2 // indirect + github.com/huandu/xstrings v1.6.3 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/rogpeppe/go-internal v1.16.0 // indirect - github.com/shopspring/decimal v1.5.0 // indirect + github.com/shopspring/decimal v1.6.0 // indirect github.com/spf13/cast v1.10.0 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/crypto v0.58.0 // indirect diff --git a/go.sum b/go.sum index f1b294d..ff25506 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.6.2 h1:+X5X6N46b40cmDw7FFJFU6Eoq0yJS8lbYigT2EFau4c= -github.com/huandu/xstrings v1.6.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.6.3 h1:7997PcI0mYC9uPNBJ7udg/KrdJh1GhJid8f2tzKFHYQ= +github.com/huandu/xstrings v1.6.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/jwilder/gojq v0.0.0-20161018055142-c550732d4a52 h1:ZSTiJFRPQr2XRqfgvm2xpEsrsudezdk8ykBXXiJDfiQ= github.com/jwilder/gojq v0.0.0-20161018055142-c550732d4a52/go.mod h1:pD7F1lLmlib/2Vy3xild2aXjNnnSudq54IJGftfO4O0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -32,8 +32,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/rogpeppe/go-internal v1.16.0 h1:O9DK+vNMDVGLr2BeZqmpLeMjiMNkuXfcqntWbZV6S5g= github.com/rogpeppe/go-internal v1.16.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs= -github.com/shopspring/decimal v1.5.0 h1:HxSWk31RmJv0EyY4oLiGQB9u7WPludUwPBdvQZnYFPc= -github.com/shopspring/decimal v1.5.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/shopspring/decimal v1.6.0 h1:DcTwjCj4tJPLuGZYsR9W0hyX9pQwMIkdo26Ig1T9xX4= +github.com/shopspring/decimal v1.6.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= diff --git a/toolchain_test.go b/toolchain_test.go index e0908f6..17bb25f 100644 --- a/toolchain_test.go +++ b/toolchain_test.go @@ -64,8 +64,8 @@ func TestGoModVersion(t *testing.T) { want string wantOK bool }{ - {"go directive", "module x\n\ngo 1.27.2\n", "1.27.2", true}, - {"toolchain overrides go", "module x\n\ngo 1.27.0\ntoolchain go1.27.2\n", "1.27.2", true}, + {"go directive", "module x\n\ngo 1.27.3\n", "1.27.3", true}, + {"toolchain overrides go", "module x\n\ngo 1.27.0\ntoolchain go1.27.3\n", "1.27.3", true}, {"no directive", "module x\n", "", false}, } for _, tt := range tests { @@ -85,11 +85,11 @@ func TestDockerfileGoVersion(t *testing.T) { want string wantOK bool }{ - {"plain tag", "FROM golang:1.27.2 AS binary\n", "1.27.2", true}, - {"alpine suffix", "FROM golang:1.27.2-alpine AS binary\n", "1.27.2", true}, - {"lowercase keyword", "from golang:1.27.2\n", "1.27.2", true}, + {"plain tag", "FROM golang:1.27.3 AS binary\n", "1.27.3", true}, + {"alpine suffix", "FROM golang:1.27.3-alpine AS binary\n", "1.27.3", true}, + {"lowercase keyword", "from golang:1.27.3\n", "1.27.3", true}, {"no golang image", "FROM gcr.io/distroless/static:nonroot\n", "", false}, - {"golang mentioned mid-line", "# uses golang:1.27.2\n", "", false}, + {"golang mentioned mid-line", "# uses golang:1.27.3\n", "", false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {