first working prototype

This commit is contained in:
david 2021-02-12 23:58:42 +01:00
parent 35eda98e69
commit 1fd5e83338
3 changed files with 23 additions and 5 deletions

View File

@ -11,17 +11,24 @@ ENV USERNAME=steam
VOLUME [ "/home/${USERNAME}" ]
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm --needed base-devel openssh git sudo cargo tmux vim wget python unzip bc jq netcat && \
pacman -S --noconfirm --needed base-devel openssh git sudo cargo tmux screen vim wget python unzip bc jq netcat && \
groupadd -g ${GROUP_ID} ${USERNAME} && \
useradd -u ${USER_ID} -g ${GROUP_ID} -M -d /home/${USERNAME} -s /bin/bash ${USERNAME} && \
chown ${USER_ID}:${GROUP_ID} /home/${USERNAME} && \
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
systemctl enable sshd.service && \
cd /tmp && ls -la && sudo -u ${USERNAME} git clone https://aur.archlinux.org/paru.git && cd paru && \
cd /tmp && sudo -u ${USERNAME} git clone https://aur.archlinux.org/paru.git && cd paru && \
sudo -u ${USERNAME} makepkg -si --noconfirm && \
sudo -u ${USERNAME} paru -S --noconfirm steamcmd bsdmainutils
sudo -u ${USERNAME} paru -S --noconfirm steamcmd bsdmainutils && \
echo "HostKey /home/${USERNAME}/.ssh/ssh_host_rsa_key" >> /etc/ssh/sshd_config && \
echo "HostKey /home/${USERNAME}/.ssh/ssh_host_ecdsa_key" >> /etc/ssh/sshd_config && \
echo "HostKey /home/${USERNAME}/.ssh/ssh_host_ed25519_key" >> /etc/ssh/sshd_config && \
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
echo "PermitRootLogin no" >> /etc/ssh/sshd_config && \
echo "PidFile /home/${USERNAME}/.ssh/sshd.pid" >> /etc/ssh/sshd_config
USER ${USERNAME}
WORKDIR /home/${USERNAME}
CMD top -b
COPY entrypoint.sh /opt/
CMD /opt/entrypoint.sh

View File

@ -5,6 +5,7 @@ services:
image: steam-container:latest
build: .
container_name: steam
hostname: steam-container
volumes:
- ./steam:/home/steam
ports:

10
entrypoint.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ -r ~/.ssh/ssh_host_rsa_key ]; then
/usr/bin/sshd -D -e
else
ssh-keygen -q -N "" -t rsa -b 4096 -f ~/.ssh/ssh_host_rsa_key
ssh-keygen -q -N "" -t ecdsa -f ~/.ssh/ssh_host_ecdsa_key
ssh-keygen -q -N "" -t ed25519 -f ~/.ssh/ssh_host_ed25519_key
/usr/bin/sshd -D -e
fi