first working prototype
This commit is contained in:
parent
35eda98e69
commit
1fd5e83338
17
Dockerfile
17
Dockerfile
|
@ -11,17 +11,24 @@ ENV USERNAME=steam
|
||||||
VOLUME [ "/home/${USERNAME}" ]
|
VOLUME [ "/home/${USERNAME}" ]
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm && \
|
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} && \
|
groupadd -g ${GROUP_ID} ${USERNAME} && \
|
||||||
useradd -u ${USER_ID} -g ${GROUP_ID} -M -d /home/${USERNAME} -s /bin/bash ${USERNAME} && \
|
useradd -u ${USER_ID} -g ${GROUP_ID} -M -d /home/${USERNAME} -s /bin/bash ${USERNAME} && \
|
||||||
chown ${USER_ID}:${GROUP_ID} /home/${USERNAME} && \
|
chown ${USER_ID}:${GROUP_ID} /home/${USERNAME} && \
|
||||||
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
|
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
|
||||||
systemctl enable sshd.service && \
|
cd /tmp && sudo -u ${USERNAME} git clone https://aur.archlinux.org/paru.git && cd paru && \
|
||||||
cd /tmp && ls -la && sudo -u ${USERNAME} git clone https://aur.archlinux.org/paru.git && cd paru && \
|
|
||||||
sudo -u ${USERNAME} makepkg -si --noconfirm && \
|
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}
|
USER ${USERNAME}
|
||||||
WORKDIR /home/${USERNAME}
|
WORKDIR /home/${USERNAME}
|
||||||
|
|
||||||
CMD top -b
|
COPY entrypoint.sh /opt/
|
||||||
|
|
||||||
|
CMD /opt/entrypoint.sh
|
|
@ -5,6 +5,7 @@ services:
|
||||||
image: steam-container:latest
|
image: steam-container:latest
|
||||||
build: .
|
build: .
|
||||||
container_name: steam
|
container_name: steam
|
||||||
|
hostname: steam-container
|
||||||
volumes:
|
volumes:
|
||||||
- ./steam:/home/steam
|
- ./steam:/home/steam
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -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
|
Reference in New Issue