1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-05 01:34:25 +00:00
gitea/Dockerfile

40 lines
1.5 KiB
Docker
Raw Normal View History

2015-08-17 07:10:23 +00:00
FROM google/golang:latest
2015-08-17 07:17:18 +00:00
MAINTAINER codeskyblue@gmail.com
2015-08-17 07:10:23 +00:00
RUN echo "deb http://ftp.debian.org/debian/ wheezy-backports main" >> /etc/apt/sources.list
RUN apt-get update
2015-08-17 13:12:47 +00:00
RUN apt-get install -y openssh-server rsync libpam-dev
2015-08-17 07:10:23 +00:00
# set the working directory and add current stuff
2015-08-17 07:17:18 +00:00
COPY . /gopath/src/github.com/gogits/gogs/
2015-08-17 07:10:23 +00:00
WORKDIR /gopath/src/github.com/gogits/gogs/
2015-08-17 07:17:18 +00:00
2015-08-17 13:12:47 +00:00
RUN go get -v -tags "sqlite redis memcache cert pam"
RUN go build -tags "sqlite redis memcache cert pam"
2015-08-17 07:10:23 +00:00
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 sed 's@UsePrivilegeSeparation yes@UsePrivilegeSeparation no@' -i /etc/ssh/sshd_config
RUN echo "export VISIBLE=now" >> /etc/profile
RUN echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config
# setup server keys on startup
RUN sed 's@^HostKey@\#HostKey@' -i /etc/ssh/sshd_config
RUN echo "HostKey /data/ssh/ssh_host_key" >> /etc/ssh/sshd_config
RUN echo "HostKey /data/ssh/ssh_host_rsa_key" >> /etc/ssh/sshd_config
RUN echo "HostKey /data/ssh/ssh_host_dsa_key" >> /etc/ssh/sshd_config
RUN echo "HostKey /data/ssh/ssh_host_ecdsa_key" >> /etc/ssh/sshd_config
RUN echo "HostKey /data/ssh/ssh_host_ed25519_key" >> /etc/ssh/sshd_config
# prepare data
#ENV USER="git" HOME="/home/git"
ENV GOGS_CUSTOM /data/gogs
RUN echo "export GOGS_CUSTOM=/data/gogs" >> /etc/profile
EXPOSE 22 3000
ENTRYPOINT []
CMD ["./docker/start.sh"]