Browse Source

Debian test

master
Siroco 5 months ago
commit
f8d0215d69
Signed by: siroco
GPG Key ID: 1324098302A514B0
  1. 13
      Dockerfile
  2. 15
      docker-compose.yml
  3. 34
      entrypoint.sh

13
Dockerfile

@ -0,0 +1,13 @@
FROM debian:buster-slim
RUN apt update -y && apt upgrade -y
RUN apt install -y openssh-server rsyslog git ca-certificates
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
VOLUME ["/home"]
EXPOSE 22
CMD ["/entrypoint.sh"]

15
docker-compose.yml

@ -0,0 +1,15 @@
version: "3.3"
services:
debian:
build: .
restart: always
hostname: random333
ports:
- "2222:22"
volumes:
- ./data:/home
stdin_open: true
tty: true
#init: true
environment:
- LANG=C.UTF-8

34
entrypoint.sh

@ -0,0 +1,34 @@
#!/bin/bash
trap "exit" SIGINT SIGTERM
touch /var/log/auth.log
touch /var/log/syslog
service rsyslog start
# Permit Root SSH Login
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
## Custom install
while IFS= read -r line
do
echo "$line"
apt install -y $line
done < <(cat /home/development)
# Root Passw
echo
PASS=`openssl rand -base64 24`
echo root:$PASS | chpasswd
echo $PASS
echo
echo ---
echo
service ssh start
## Custom services
tail -f /var/log/auth.log /var/log/syslog
Loading…
Cancel
Save