forked from codeskyblue/docker-gogs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 889 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM google/golang
MAINTAINER codeskyblue@gmail.com
RUN apt-get install -y openssh-server
# grab but do not build gogs
RUN git clone https://github.com/gogits/gogs.git /gopath/src/github.com/gogits/gogs
# set the working directory and add current stuff
WORKDIR /gopath/src/github.com/gogits/gogs
RUN git checkout master
RUN go get -v -tags sqlite
RUN go build -tags sqlite
RUN useradd --shell /bin/bash --system --comment gogits git
RUN mkdir /var/run/sshd
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
RUN echo "export VISIBLE=now" >> /etc/profile
# prepare data
ENV GOGS_CUSTOM /data/gogs
RUN echo "export GOGS_CUSTOM=/data/gogs" >> /etc/profile
RUN apt-get install -y rsync
ADD . /gopath/src/github.com/gogits/gogs
EXPOSE 22 3000
ENTRYPOINT []
CMD ["./start.sh"]