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.

Dockerfile 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ###################################
  2. #Build stage
  3. FROM golang:1.14-alpine3.11 AS build-env
  4. ARG GOPROXY
  5. ENV GOPROXY ${GOPROXY:-direct}
  6. ARG GITEA_VERSION
  7. ARG TAGS="sqlite sqlite_unlock_notify"
  8. ENV TAGS "bindata $TAGS"
  9. ARG CGO_EXTRA_CFLAGS
  10. #Build deps
  11. RUN apk --no-cache add build-base git nodejs npm
  12. #Setup repo
  13. COPY . ${GOPATH}/src/code.gitea.io/gitea
  14. WORKDIR ${GOPATH}/src/code.gitea.io/gitea
  15. #Checkout version if set
  16. RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
  17. && make clean-all build
  18. FROM alpine:3.11
  19. LABEL maintainer="maintainers@gitea.io"
  20. EXPOSE 22 3000
  21. RUN apk --no-cache add \
  22. bash \
  23. ca-certificates \
  24. curl \
  25. gettext \
  26. git \
  27. linux-pam \
  28. openssh \
  29. s6 \
  30. sqlite \
  31. su-exec \
  32. tzdata \
  33. gnupg
  34. RUN addgroup \
  35. -S -g 1000 \
  36. git && \
  37. adduser \
  38. -S -H -D \
  39. -h /data/git \
  40. -s /bin/bash \
  41. -u 1000 \
  42. -G git \
  43. git && \
  44. echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
  45. ENV USER git
  46. ENV GITEA_CUSTOM /data/gitea
  47. VOLUME ["/data"]
  48. ENTRYPOINT ["/usr/bin/entrypoint"]
  49. CMD ["/bin/s6-svscan", "/etc/s6"]
  50. COPY docker/root /
  51. COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
  52. RUN ln -s /app/gitea/gitea /usr/local/bin/gitea