2015-07-20 09:53:53 -04:00
|
|
|
FROM buildpack-deps:trusty-scm
|
2014-08-29 12:20:15 -04:00
|
|
|
|
2015-07-20 09:53:53 -04:00
|
|
|
# This part is taken from the official docker image --------------------
|
2014-08-29 12:20:15 -04:00
|
|
|
|
2015-07-20 09:53:53 -04:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
build-essential --no-install-recommends
|
2014-08-29 12:20:15 -04:00
|
|
|
|
|
|
|
ENV GOLANG_VERSION 1.3
|
|
|
|
|
2015-07-20 09:53:53 -04:00
|
|
|
RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
|
|
|
|
| tar -v -C /usr/src -xz
|
2014-08-29 12:20:15 -04:00
|
|
|
|
2015-07-20 09:53:53 -04:00
|
|
|
RUN cd /usr/src/go/src && ./make.bash --no-clean 2>&1
|
2014-08-29 12:20:15 -04:00
|
|
|
|
|
|
|
ENV PATH /usr/src/go/bin:$PATH
|
|
|
|
|
2015-07-20 09:53:53 -04:00
|
|
|
RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
|
2014-08-29 12:20:15 -04:00
|
|
|
ENV GOPATH /go
|
|
|
|
ENV PATH /go/bin:$PATH
|
|
|
|
WORKDIR /go
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
RUN useradd -m git
|
|
|
|
|
|
|
|
ENV GOGS_PATH $GOPATH/src/github.com/gogits/gogs
|
|
|
|
ENV GOGS_CUSTOM_CONF_PATH $GOGS_PATH/custom/conf
|
|
|
|
ENV GOGS_CUSTOM_CONF $GOGS_CUSTOM_CONF_PATH/app.ini
|
|
|
|
|
2014-09-03 12:41:20 -04:00
|
|
|
RUN git clone -b dev https://github.com/gogits/gogs.git $GOGS_PATH
|
2014-08-29 12:20:15 -04:00
|
|
|
# WORKDIR $GOGS_PATH
|
|
|
|
WORKDIR /go/src/github.com/gogits/gogs
|
2014-09-03 11:12:38 -04:00
|
|
|
RUN go get -d && go build
|
2014-08-29 12:20:15 -04:00
|
|
|
RUN chown -R git $GOGS_PATH
|
|
|
|
|
|
|
|
ADD init_gogs.sh /tmp/
|
|
|
|
RUN chown git /tmp/init_gogs.sh
|
|
|
|
RUN chmod +x /tmp/init_gogs.sh
|
|
|
|
|
|
|
|
USER git
|
|
|
|
ENV HOME /home/git
|
|
|
|
ENV USER git
|
|
|
|
ENV PATH $GOGS_PATH:$PATH
|
|
|
|
|
2014-12-27 22:10:33 -05:00
|
|
|
RUN git config --global user.name "GoGS" && git config --global user.email "gogitservice@gmail.com"
|
2014-08-29 12:20:15 -04:00
|
|
|
|
|
|
|
ENTRYPOINT ["/tmp/init_gogs.sh"]
|
|
|
|
CMD ["gogs", "web"]
|