github.com/jaypipes/ghw@v0.21.1/Dockerfile (about) 1 FROM golang:1.21-buster as builder 2 WORKDIR /go/src/github.com/jaypipes/ghw 3 4 ENV GOPROXY=direct 5 6 # go.mod and go.sum go into their own layers. 7 COPY go.mod . 8 COPY go.sum . 9 10 # This ensures `go mod download` happens only when go.mod and go.sum change. 11 RUN go mod download 12 13 COPY . . 14 15 RUN CGO_ENABLED=0 go build -o ghwc ./cmd/ghwc/ 16 17 FROM alpine:3.7@sha256:8421d9a84432575381bfabd248f1eb56f3aa21d9d7cd2511583c68c9b7511d10 18 RUN apk add --no-cache ethtool 19 20 WORKDIR /bin 21 22 COPY --from=builder /go/src/github.com/jaypipes/ghw/ghwc /bin 23 24 CMD ghwc