Dockerfile 987 B

1234567891011121314151617181920212223242526272829303132
  1. FROM alpine:3.2
  2. MAINTAINER roemer.jp@gmail.com
  3. # Install system utils & Gogs runtime dependencies
  4. ADD https://github.com/tianon/gosu/releases/download/1.5/gosu-amd64 /usr/sbin/gosu
  5. RUN echo "@edge http://dl-4.alpinelinux.org/alpine/edge/main" | tee -a /etc/apk/repositories \
  6. && echo "@community http://dl-4.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories \
  7. && apk -U --no-progress upgrade \
  8. && apk -U --no-progress add ca-certificates git linux-pam s6@edge curl openssh socat \
  9. && chmod +x /usr/sbin/gosu
  10. # Configure SSH
  11. COPY docker/sshd_config /etc/ssh/sshd_config
  12. # Configure Go and build Gogs
  13. ENV GOPATH /tmp/go
  14. ENV PATH $PATH:$GOPATH/bin
  15. COPY . /app/gogs/
  16. WORKDIR /app/gogs/
  17. RUN ./docker/build.sh
  18. ENV GOGS_CUSTOM /data/gogs
  19. # Create git user for Gogs
  20. RUN adduser -D -g 'Gogs Git User' git -h /data/git/ -s /bin/sh && passwd -u git
  21. RUN echo "export GOGS_CUSTOM=/data/gogs" >> /etc/profile
  22. VOLUME ["/data"]
  23. EXPOSE 22 3000
  24. CMD ["./docker/start.sh"]