Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <mail@jasonwilder.com>"
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
12 changes: 6 additions & 6 deletions toolchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down
Loading