Dockerfile 1.3 KB

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