Add Containerfile for the ansible host

This commit is contained in:
Ben 2022-04-25 22:58:39 +02:00
parent 1a6e612bb3
commit 0c6cee81e0
Signed by: ben
GPG Key ID: 0F54A7ED232D3319
5 changed files with 14 additions and 0 deletions

3
cnt-build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec podman build --tag localhost/debian-ssh -f debian-ssh.Containerfile .

3
cnt-run.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec podman run --detach --replace --name debian-ssh --publish=\[::\]:2222:22 localhost/debian-ssh

6
debian-ssh.Containerfile Normal file
View File

@ -0,0 +1,6 @@
FROM docker.io/debian:stable
RUN mkdir /etc/ssh
COPY ssh-config/* /etc/ssh/
RUN apt-get update && apt-get upgrade -y && apt-get install -y systemd kitty-terminfo openssh-server python3 && rm -rf /var/cache/apt/ && mkdir -m 0700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys && echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJKjThT/FYgychPF0LHvkaO/H1qPEQ9RXLzs6bmBtONu ben2019" >> ~/.ssh/authorized_keys
ENTRYPOINT ["/sbin/init"]

2
inventory Normal file
View File

@ -0,0 +1,2 @@
[matrix]
test ansible_host=::1 ansible_port=2222 ansible_user=root

0
ssh-config/.gitkeep Normal file
View File