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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #Build stage
  2. FROM docker.io/library/golang:1.20-alpine3.18 AS build-env
  3. ARG GOPROXY
  4. ENV GOPROXY ${GOPROXY:-direct}
  5. ARG GITEA_VERSION
  6. ARG TAGS="sqlite sqlite_unlock_notify"
  7. ENV TAGS "bindata timetzdata $TAGS"
  8. ARG CGO_EXTRA_CFLAGS
  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. # Begin env-to-ini build
  18. RUN go build contrib/environment-to-ini/environment-to-ini.go
  19. FROM docker.io/library/alpine:3.18
  20. LABEL maintainer="maintainers@gitea.io"
  21. EXPOSE 22 3000
  22. RUN apk --no-cache add \
  23. bash \
  24. ca-certificates \
  25. curl \
  26. gettext \
  27. git \
  28. linux-pam \
  29. openssh \
  30. s6 \
  31. sqlite \
  32. su-exec \
  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:*" | chpasswd -e
  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. COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
  53. COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
  54. RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
  55. RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
  56. RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh