mirror of
https://github.com/jpillora/chisel
synced 2026-06-08 15:07:02 +00:00
17 lines
448 B
Docker
17 lines
448 B
Docker
# build stage (go modules! farewell GOPATH!)
|
|
FROM golang:alpine AS build-env
|
|
LABEL maintainer="dev@jpillora.com"
|
|
RUN apk update
|
|
RUN apk add git
|
|
ENV CGO_ENABLED 0
|
|
ADD . /src
|
|
WORKDIR /src
|
|
RUN go build \
|
|
-mod vendor \
|
|
-ldflags "-X github.com/jpillora/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)" \
|
|
-o chisel
|
|
# container stage
|
|
FROM alpine
|
|
WORKDIR /app
|
|
COPY --from=build-env /src/chisel /app/chisel
|
|
ENTRYPOINT ["/app/chisel"] |