Dockerfile 1019 B

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