Skip to content
Permalink
Browse files

cmd/shfmt: add Docker image build files from v2

  • Loading branch information...
mvdan committed Mar 11, 2019
1 parent fac9359 commit a3dcc70e39089b6bedc25682c0420f91c2e779de
Showing with 22 additions and 0 deletions.
  1. +8 −0 cmd/shfmt/Dockerfile
  2. +14 −0 release-docker.sh
@@ -0,0 +1,8 @@
FROM golang:1.12-alpine3.9

COPY . /go/src/mvdan.cc/sh
RUN CGO_ENABLED=0 go install -ldflags '-w -s -extldflags "-static"' mvdan.cc/sh/cmd/shfmt

FROM busybox:1.30.1-musl
COPY --from=0 /go/bin/shfmt /bin/shfmt
ENTRYPOINT ["/bin/shfmt"]
@@ -0,0 +1,14 @@
#!/bin/bash

tag=$(git describe --exact-match 2>/dev/null)
if [[ $? != 0 ]]; then
tag=latest
fi

docker build -t mvdan/shfmt:$tag -f cmd/shfmt/Dockerfile .

if [[ -n $DOCKER_PASSWORD ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi

docker push mvdan/shfmt:$tag

0 comments on commit a3dcc70

Please sign in to comment.
You can’t perform that action at this time.