Skip to content

Commit

Permalink
cmd/shfmt: add Dockerfile for Docker Hub
Browse files Browse the repository at this point in the history
Pinning versions of the builder and final base image, so that its
behavior doesn't change over time.

Updates #68.
  • Loading branch information
mvdan committed Nov 20, 2018
1 parent b4018ea commit 3f0ab69
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/shfmt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.11.2-alpine3.8

ENV VERSION 2.6.1

RUN apk add --no-cache git \
&& go get -d mvdan.cc/sh/cmd/shfmt \
&& git -C $GOPATH/src/mvdan.cc/sh checkout -q v$VERSION \
&& CGO_ENABLED=0 go install -ldflags '-w -s -extldflags "-static"' mvdan.cc/sh/cmd/shfmt

FROM busybox:1.29.3-musl
COPY --from=0 /go/bin/shfmt /bin/shfmt

0 comments on commit 3f0ab69

Please sign in to comment.