Dockerfile 1.1 KB

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