Advertisement
fakuivan

Docker container for building sourcemod

May 23rd, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.84 KB | None | 0 0
  1. FROM ubuntu
  2.  
  3. RUN apt update && apt upgrade -y && \
  4.     apt install -y git \
  5.                    lib32stdc++6 \
  6.                    lib32z1-dev \
  7.                    libc6-dev-i386 \
  8.                    linux-libc-dev \
  9.                    lib32gcc-5-dev \
  10.                    libgcc-5-dev \
  11.                    g++-5-multilib \
  12.                    gcc-5-multilib \
  13.                    g++-5 \
  14.                    gcc-5 \
  15.                    python3 \
  16.                     \
  17.                    openssh-server \
  18.                    python3-pip && \
  19.     mkdir /var/run/sshd && chmod 0755 /var/run/sshd
  20.  
  21. RUN sed -i "s/.*RSAAuthentication.*/RSAAuthentication yes/g" /etc/ssh/sshd_config && \
  22.     sed -i "s/.*PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config && \
  23.     sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config && \
  24.     sed -i "s/.*AuthorizedKeysFile.*/AuthorizedKeysFile\t\.ssh\/authorized_keys/g" /etc/ssh/sshd_config && \
  25.     sed -i "s/.*PermitRootLogin.*/PermitRootLogin no/g" /etc/ssh/sshd_config
  26. ADD id.pub /tmp/id.pub
  27.  
  28. RUN useradd -U -d /home/build -s /bin/bash build && \
  29.     mkdir /home/build && chown build:build /home/build && \
  30.     su build -c bash -c "mkdir /home/build/.ssh/ && \
  31.    cat /tmp/id.pub > /home/build/.ssh/authorized_keys"
  32.  
  33. RUN su build -c bash -c \
  34.     "git clone --branch 1.8-dev --recursive https://github.com/alliedmodders/sourcemod      /home/build/sourcemod && \
  35.     git clone --branch tf2                 https://github.com/alliedmodders/hl2sdk         /home/build/hl2sdk-tf2 && \
  36.     git clone --branch 1.10-dev            https://github.com/alliedmodders/metamod-source /home/build/mmsource-1.10" && \
  37.     git clone https://github.com/alliedmodders/ambuild /tmp/ambuild
  38. RUN cd /tmp/ambuild && python3 setup.py install
  39.  
  40. EXPOSE 22
  41. CMD ["/usr/sbin/sshd", "-D"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement