Dockerfile.rpihub 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM arm32v7/alpine:latest
  2. ENV GOGS_CUSTOM /data/gogs
  3. ENV QEMU_EXECVE 1
  4. # For cross compile on dockerhub
  5. ################################
  6. COPY ./docker/armhf/qemu-arm-static /usr/bin/
  7. COPY ./docker/armhf/resin-xbuild /usr/bin/
  8. RUN [ "/usr/bin/qemu-arm-static", "/bin/sh", "-c", "ln -s resin-xbuild /usr/bin/cross-build-start; ln -s resin-xbuild /usr/bin/cross-build-end; ln /bin/sh /bin/sh.real" ]
  9. RUN [ "cross-build-start" ]
  10. # Prepare the container
  11. #######################
  12. # Install system utils & Gogs runtime dependencies
  13. ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-armhf /usr/sbin/gosu
  14. RUN chmod +x /usr/sbin/gosu \
  15. && echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
  16. && apk --no-cache --no-progress add \
  17. bash \
  18. ca-certificates \
  19. curl \
  20. git \
  21. linux-pam \
  22. openssh \
  23. s6 \
  24. shadow \
  25. socat \
  26. tzdata \
  27. rsync
  28. # Configure LibC Name Service
  29. COPY docker/nsswitch.conf /etc/nsswitch.conf
  30. COPY docker /app/gogs/docker
  31. COPY templates /app/gogs/templates
  32. COPY public /app/gogs/public
  33. WORKDIR /app/gogs/build
  34. COPY . .
  35. RUN ./docker/build-go.sh \
  36. && ./docker/build.sh \
  37. && ./docker/finalize.sh
  38. # For cross compile on dockerhub
  39. ################################
  40. RUN [ "cross-build-end" ]
  41. # Configure Docker Container
  42. ############################
  43. VOLUME ["/data"]
  44. EXPOSE 22 3000
  45. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  46. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]