Dockerfile.rpi 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. FROM arm32v7/golang:1.14-alpine3.14 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 arm32v7/alpine:3.14
  11. RUN wget https://github.com/tianon/gosu/releases/download/1.12/gosu-armhf -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. HEALTHCHECK CMD (nc -z -w 3 localhost 22 && curl -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1
  37. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  38. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]