c712b6ec by Adam Heath

Importing into a fresh repository.

1 parent 6a24afa0
1 FROM docker.brainfood.com/debian-support
2
3 RUN ["apt-docker", \
4 "-y", "install", "dumb-init", \
5 ";" ]
6
7 ADD /overlay/ /
8
9 ENTRYPOINT ["/usr/bin/dumb-init", "/usr/local/sbin/docker-init"]
1 version: '2'
2
3 services:
4 build:
5 image: docker.brainfood.com/dumb-init
6 build:
7 context: .
8 args:
9 - http_proxy
10 - https_proxy
11
1 #!/bin/bash
2
3 set -e
4
5 onexit() {
6 export PREVLEVEL=$RUNLEVEL RUNLEVEL=1
7 /etc/init.d/rc 1
8 # Turn services back off
9 echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d
10 rm -f /etc/init.d/.legacy-bootordering
11 }
12 trap onexit EXIT
13
14 rm -f /usr/sbin/policy-rc.d
15
16 if [[ -e /etc/docker-init/runtime/settings.sh ]]; then
17 . /etc/docker-init/runtime/settings.sh
18 fi
19
20 if [[ $UID && $GID ]]; then
21 addgroup --gid $GID hostuser
22 adduser --disabled-password --uid $UID --gid $GID --gecos "" hostuser
23 fi
24
25 for pre_config_service in /etc/docker-init/runtime/pre-config/*.sh; do
26 [[ -r $pre_config_service ]] || continue
27 (
28 . "$pre_config_service"
29 )
30 done
31 touch /etc/init.d/.legacy-bootordering
32 export RUNLEVEL=2 PREVLEVEL=
33 /etc/init.d/rc 2
34
35 if [[ $# -gt 0 ]]; then
36 "$@"
37 else
38 tail -f /var/log/syslog
39 fi