mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
- Use progressive build to reduce final image size - Download source during build so only Dockerfile is required to be present on the build host - Add a `version` arg so any tag or branch can be built: `docker build --build-arg=version=v0.25.0 -t wtf .`
23 lines
523 B
Docker
23 lines
523 B
Docker
FROM golang:1.13-alpine as build
|
|
|
|
ARG version=master
|
|
|
|
RUN apk add git make ncurses && \
|
|
git clone https://github.com/wtfutil/wtf.git $GOPATH/src/github.com/wtfutil/wtf && \
|
|
cd $GOPATH/src/github.com/wtfutil/wtf && \
|
|
git checkout $version
|
|
|
|
ENV GOPROXY=https://proxy.golang.org,direct
|
|
ENV GO111MODULE=on
|
|
ENV GOSUMDB=off
|
|
|
|
WORKDIR $GOPATH/src/github.com/wtfutil/wtf
|
|
|
|
ENV PATH=$PATH:./bin
|
|
|
|
RUN make build
|
|
|
|
FROM alpine
|
|
COPY --from=build /go/src/github.com/wtfutil/wtf/bin/wtfutil /usr/local/bin/
|
|
ENTRYPOINT "wtfutil"
|