Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FROM buildpack-deps:trusty-scm
  2. # This part is taken from the official docker image --------------------
  3. RUN apt-get update && apt-get install -y \
  4. build-essential --no-install-recommends
  5. ENV GOLANG_VERSION 1.3
  6. RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
  7. | tar -v -C /usr/src -xz
  8. RUN cd /usr/src/go/src && ./make.bash --no-clean 2>&1
  9. ENV PATH /usr/src/go/bin:$PATH
  10. RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
  11. ENV GOPATH /go
  12. ENV PATH /go/bin:$PATH
  13. WORKDIR /go
  14. # ----------------------------------------------------------------------
  15. RUN useradd -m git
  16. ENV GOGS_PATH $GOPATH/src/github.com/gogits/gogs
  17. ENV GOGS_CUSTOM_CONF_PATH $GOGS_PATH/custom/conf
  18. ENV GOGS_CUSTOM_CONF $GOGS_CUSTOM_CONF_PATH/app.ini
  19. RUN git clone -b dev https://github.com/gogits/gogs.git $GOGS_PATH
  20. # WORKDIR $GOGS_PATH
  21. WORKDIR /go/src/github.com/gogits/gogs
  22. RUN go get -d && go build
  23. RUN chown -R git $GOGS_PATH
  24. ADD init_gogs.sh /tmp/
  25. RUN chown git /tmp/init_gogs.sh
  26. RUN chmod +x /tmp/init_gogs.sh
  27. USER git
  28. ENV HOME /home/git
  29. ENV USER git
  30. ENV PATH $GOGS_PATH:$PATH
  31. RUN git config --global user.name "GoGS" && git config --global user.email "gogitservice@gmail.com"
  32. ENTRYPOINT ["/tmp/init_gogs.sh"]
  33. CMD ["gogs", "web"]