gitea/tea as an OCI image
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
798 B

  1. ARG GOVERSION="1.15.2"
  2. FROM golang:${GOVERSION}-alpine AS buildenv
  3. ARG REPO="https://gitea.com/gitea/tea.git"
  4. ARG VERSION="0.5.0"
  5. ENV TEA_VERSION="${VERSION}"
  6. ARG CGO_ENABLED="0"
  7. ARG GOOS="linux"
  8. WORKDIR $GOPATH/src
  9. RUN apk add --quiet --no-cache git && \
  10. git config --global advice.detachedHead false && \
  11. if [ "${TEA_VERSION}" == "development" ]; \
  12. then \
  13. export TEA_VERSION="development-$(git ls-remote -q ${REPO} HEAD | cut -c-7)"; \
  14. else \
  15. export BRANCH_MODIFIER="-b v${TEA_VERSION}"; \
  16. fi && \
  17. git clone --single-branch ${REPO} ${BRANCH_MODIFIER} . && \
  18. go get -v . && \
  19. go build -v -a -ldflags "-X main.Version=${TEA_VERSION}" -o /tea .
  20. FROM scratch
  21. LABEL maintainer="Tamás Gérczei <tamas@gerczei.eu>"
  22. COPY --from=buildenv /tea /
  23. ENV HOME="/app"
  24. ENTRYPOINT ["/tea"]