Dockerfile 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM golang:alpine3.11 AS binarybuilder
  2. RUN apk --no-cache --no-progress add --virtual \
  3. build-deps \
  4. build-base \
  5. git \
  6. linux-pam-dev
  7. WORKDIR /gogs.io/gogs
  8. COPY . .
  9. RUN make build TAGS="cert pam"
  10. FROM alpine:3.11
  11. RUN wget https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64 -O /usr/sbin/gosu \
  12. && chmod +x /usr/sbin/gosu \
  13. && echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
  14. && apk --no-cache --no-progress add \
  15. bash \
  16. ca-certificates \
  17. curl \
  18. git \
  19. linux-pam \
  20. openssh \
  21. s6 \
  22. shadow \
  23. socat \
  24. tzdata \
  25. rsync
  26. ENV GOGS_CUSTOM /data/gogs
  27. # Configure LibC Name Service
  28. COPY docker/nsswitch.conf /etc/nsswitch.conf
  29. WORKDIR /app/gogs
  30. COPY docker ./docker
  31. COPY --from=binarybuilder /gogs.io/gogs/gogs .
  32. RUN ./docker/finalize.sh
  33. # Configure Docker Container
  34. VOLUME ["/data", "/backup"]
  35. EXPOSE 22 3000
  36. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  37. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]