Dockerfile.rpihub 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM armhf/alpine:3.5
  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. && apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat tzdata
  16. COPY . /app/gogs/build
  17. WORKDIR /app/gogs/build
  18. RUN ./docker/build-go.sh \
  19. && ./docker/build.sh \
  20. && ./docker/finalize.sh
  21. # Configure LibC Name Service
  22. COPY docker/nsswitch.conf /etc/nsswitch.conf
  23. # For cross compile on dockerhub
  24. ################################
  25. RUN [ "cross-build-end" ]
  26. # Configure Docker Container
  27. ############################
  28. VOLUME ["/data"]
  29. EXPOSE 22 3000
  30. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  31. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]