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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #Build stage
  2. FROM golang:1.18-alpine3.16 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 alpine:3.16
  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. RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
  54. RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*