Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM golang:alpine3.10 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 /go/src/github.com/gogs/gogs
  8. COPY . .
  9. RUN make build TAGS="sqlite cert pam"
  10. FROM alpine:3.10
  11. ADD https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 /usr/sbin/gosu
  12. RUN 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 templates ./templates
  32. COPY public ./public
  33. COPY --from=binarybuilder /go/src/github.com/gogs/gogs/gogs .
  34. RUN ./docker/finalize.sh
  35. # Configure Docker Container
  36. VOLUME ["/data"]
  37. EXPOSE 22 3000
  38. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  39. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]