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.2KB

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