You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1 KiB

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