Skip to content

Instantly share code, notes, and snippets.

@fakuivan
Last active May 23, 2017 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fakuivan/e168bbe35ee3e93b000e71cfdbd71c6e to your computer and use it in GitHub Desktop.
Save fakuivan/e168bbe35ee3e93b000e71cfdbd71c6e to your computer and use it in GitHub Desktop.
A complete (but w/o mysql and only the tf2 sdk) docker build environment for compiling sourcemod (1.8-dev branch) and its extensions, controlled by SSH.
FROM ubuntu
RUN apt update && apt upgrade -y && \
apt install -y git \
lib32stdc++6 \
lib32z1-dev \
libc6-dev-i386 \
linux-libc-dev \
lib32gcc-5-dev \
libgcc-5-dev \
g++-5-multilib \
gcc-5-multilib \
g++-5 \
gcc-5 \
python3 \
\
openssh-server \
python3-pip && \
mkdir /var/run/sshd && chmod 0755 /var/run/sshd
RUN sed -i "s/.*RSAAuthentication.*/RSAAuthentication yes/g" /etc/ssh/sshd_config && \
sed -i "s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config && \
sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config && \
sed -i "s/.*AuthorizedKeysFile.*/AuthorizedKeysFile\t\.ssh\/authorized_keys/g" /etc/ssh/sshd_config && \
sed -i "s/.*PermitRootLogin.*/PermitRootLogin no/g" /etc/ssh/sshd_config
#Supply your own public key for authenticating
ADD id.pub /tmp/id.pub
RUN useradd -U -d /home/build -s /bin/bash build && \
mkdir /home/build && chown build:build /home/build && \
su build -c bash -c "mkdir /home/build/.ssh/ && \
cat /tmp/id.pub > /home/build/.ssh/authorized_keys"
RUN su build -c bash -c \
"git clone --branch 1.8-dev --recursive https://github.com/alliedmodders/sourcemod /home/build/sourcemod && \
git clone --branch tf2 https://github.com/alliedmodders/hl2sdk /home/build/hl2sdk-tf2 && \
git clone --branch 1.10-dev https://github.com/alliedmodders/metamod-source /home/build/mmsource-1.10" && \
git clone https://github.com/alliedmodders/ambuild /tmp/ambuild
RUN cd /tmp/ambuild && python3 setup.py install
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment