Compare commits

...

3 Commits

Author SHA1 Message Date
Siroco a55b31e847
Update README 5 months ago
Siroco f7b11d9bdd
Add README info && touch configuration files 5 months ago
Siroco 01008a59ab
Add shutdown/reboot utility 5 months ago
  1. 4
      Dockerfile
  2. 31
      README.md
  3. 1
      bin/shutdown
  4. 4
      docker-compose.yml
  5. 8
      entrypoint.sh

4
Dockerfile

@ -4,7 +4,9 @@ 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
COPY bin/shutdown /sbin/shutdown
COPY bin/shutdown /sbin/reboot
RUN chmod +x entrypoint.sh /sbin/reboot /sbin/shutdown
VOLUME ["/home"]

31
README.md

@ -1,3 +1,7 @@
# GNU/Linux Debian image for development
## Configure
Create _data_ dir
```
@ -15,3 +19,30 @@ Read logs for root password
```
docker-compose logs -f
```
**Only /home directory is persistent**
## User configure
Configuration files
* /home/packages : Install packages on restart container
* /home/services : Start services on restart container
Add packages on _/home/packages_ (like _apt install <package>_) and _reboot_
Add services on _/home/services)_ (like _service <service> start_) and _reboot_
Example:
/home/packages
```
nginx-full
php-fpm
```
/home/services
```
nginx
```

1
bin/shutdown

@ -0,0 +1 @@
kill -s SIGHUP 1

4
docker-compose.yml

@ -1,4 +1,4 @@
version: "3.3"
version: "3.9"
services:
debian:
build: .
@ -10,6 +10,6 @@ services:
- ./data:/home
stdin_open: true
tty: true
#init: true
init: true
environment:
- LANG=C.UTF-8

8
entrypoint.sh

@ -1,9 +1,9 @@
#!/bin/bash
trap "exit" SIGINT SIGTERM
touch /var/log/auth.log
touch /var/log/syslog
touch /home/packages
touch /home/services
service rsyslog start
@ -18,6 +18,7 @@ do
done < <(cat /home/packages)
# Root Passw
echo ---
echo
PASS=`openssl rand -base64 24`
echo root:$PASS | chpasswd
@ -35,5 +36,4 @@ do
service $line start
done < <(cat /home/services)
tail -f /var/log/auth.log /var/log/syslog
tail -f /var/log/auth.log

Loading…
Cancel
Save