Dockerfile.aarch64hub 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM arm64v8/alpine:latest
  2. ENV GOGS_CUSTOM /data/gogs
  3. ENV QEMU_EXECVE 1
  4. # For cross compile on dockerhub
  5. ################################
  6. COPY ./docker/aarch64/qemu-aarch64-static /usr/bin/
  7. COPY ./docker/aarch64/resin-xbuild /usr/bin/
  8. RUN [ "/usr/bin/qemu-aarch64-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.10/gosu-arm64 /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 shadow socat tzdata go=1.10.1-r0
  16. COPY docker /app/gogs/docker
  17. COPY templates /app/gogs/templates
  18. COPY public /app/gogs/public
  19. WORKDIR /app/gogs/build
  20. COPY . .
  21. RUN ./docker/build.sh \
  22. && ./docker/finalize.sh
  23. # Configure LibC Name Service
  24. COPY docker/nsswitch.conf /etc/nsswitch.conf
  25. # For cross compile on dockerhub
  26. ################################
  27. RUN [ "cross-build-end" ]
  28. # Configure Docker Container
  29. ############################
  30. VOLUME ["/data"]
  31. EXPOSE 22 3000
  32. ENTRYPOINT ["/app/gogs/docker/start.sh"]
  33. CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"]