2020-12-13 16:32:36 +00:00
|
|
|
ARG GOVERSION="1.15.6"
|
2020-05-13 16:14:10 +00:00
|
|
|
|
|
|
|
FROM golang:${GOVERSION}-alpine AS buildenv
|
|
|
|
|
|
|
|
ARG REPO="https://gitea.com/gitea/tea.git"
|
2020-05-12 09:26:53 +00:00
|
|
|
|
2020-09-30 17:13:30 +00:00
|
|
|
ARG VERSION="0.5.0"
|
2020-05-13 05:26:50 +00:00
|
|
|
ENV TEA_VERSION="${VERSION}"
|
2020-05-13 16:14:10 +00:00
|
|
|
|
2020-05-12 09:26:53 +00:00
|
|
|
ARG CGO_ENABLED="0"
|
|
|
|
ARG GOOS="linux"
|
|
|
|
|
2020-12-13 16:32:36 +00:00
|
|
|
ARG BUILD_DATE
|
|
|
|
|
2020-05-12 09:26:53 +00:00
|
|
|
WORKDIR $GOPATH/src
|
|
|
|
|
2020-05-13 16:14:10 +00:00
|
|
|
RUN apk add --quiet --no-cache git && \
|
2020-05-12 09:26:53 +00:00
|
|
|
git config --global advice.detachedHead false && \
|
2020-12-13 16:32:36 +00:00
|
|
|
git clone --single-branch ${REPO} -b v${TEA_VERSION} . && \
|
2020-05-12 09:26:53 +00:00
|
|
|
go get -v . && \
|
2020-05-13 05:26:50 +00:00
|
|
|
go build -v -a -ldflags "-X main.Version=${TEA_VERSION}" -o /tea .
|
2020-05-12 09:26:53 +00:00
|
|
|
|
|
|
|
FROM scratch
|
2020-12-13 16:32:36 +00:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VERSION
|
|
|
|
LABEL org.opencontainers.image.title="Gitea - Git with a cup of tea"
|
|
|
|
LABEL org.opencontainers.image.description="A command line tool to interact with Gitea servers"
|
|
|
|
LABEL org.opencontainers.image.version="${VERSION}"
|
|
|
|
LABEL org.opencontainers.image.url="https://gitea.com/gitea/tea"
|
|
|
|
LABEL org.opencontainers.image.authors="Tamás Gérczei <tamas@gerczei.eu>"
|
|
|
|
LABEL org.opencontainers.image.created="${BUILD_DATE}"
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/tgerczei/conteaner"
|
|
|
|
LABEL org.opencontainers.image.vendor="Gérczei Tamás E.V."
|
2020-05-12 09:26:53 +00:00
|
|
|
COPY --from=buildenv /tea /
|
|
|
|
ENV HOME="/app"
|
|
|
|
ENTRYPOINT ["/tea"]
|