Created
February 18, 2015 17:40
-
-
Save ripienaar/986a9895fd6063e6f836 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:7 | |
MAINTAINER R.I.Pienaar "[email protected]" | |
WORKDIR /opt/gogs | |
RUN yum install -y git openssh-server unzip initscripts rsync; yum clean all | |
RUN yum -y update; yum clean all | |
RUN useradd --shell /bin/bash --system --comment gogits git | |
ENV GOGS_CUSTOM /data/gogs | |
RUN echo "export GOGS_CUSTOM=/data/gogs" >> /etc/profile | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
RUN cd /opt && \ | |
curl -LO https://github.com/gogits/gogs/releases/download/v0.5.13/linux_amd64.zip && \ | |
unzip linux_amd64.zip && \ | |
rm linux_amd64.zip && \ | |
chmod a+x gogs/gogs | |
ADD start.sh /opt/gogs/ | |
ADD sshd_config /etc/ssh/sshd_config | |
ADD sshd_sysconfig /etc/sysconfig/sshd | |
ENTRYPOINT ["./start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SyslogFacility AUTHPRIV | |
AuthorizedKeysFile .ssh/authorized_keys | |
PasswordAuthentication yes | |
ChallengeResponseAuthentication no | |
GSSAPIAuthentication no | |
UsePAM yes | |
X11Forwarding no | |
UsePrivilegeSeparation no | |
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES | |
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT | |
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE | |
AcceptEnv XMODIFIERS | |
HostKey /data/ssh/ssh_host_rsa_key | |
HostKey /data/ssh/ssh_host_ecdsa_key | |
PermitUserEnvironment yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH_USE_STRONG_RNG=0 | |
RSA_KEY=/data/ssh/ssh_host_rsa_key | |
DSA_KEY=/data/ssh/ssh_host_dsa_key | |
ECDSA_KEY=/data/ssh/ssh_host_ecdsa_key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p /data/ssh | |
/usr/sbin/sshd-keygen | |
/usr/sbin/sshd | |
if ! test -d /data/gogs | |
then | |
mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git | |
fi | |
test -d /data/gogs/templates || cp -ar ./templates /data/gogs/ | |
ln -sf /data/gogs/log ./log | |
ln -sf /data/gogs/data ./data | |
ln -sf /data/git /home/git | |
rsync -rtv /data/gogs/templates/ ./templates/ | |
if ! test -d ~git/.ssh | |
then | |
mkdir ~git/.ssh | |
chmod 600 ~git/.ssh | |
fi | |
if ! test -f ~git/.ssh/environment | |
then | |
echo "GOGS_CUSTOM=/data/gogs" > ~git/.ssh/environment | |
chown git:git ~git/.ssh/environment | |
chown 600 ~git/.ssh/environment | |
fi | |
chown -R git:git /data . | |
exec su git -c "./gogs web" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with: