-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made services installation optional during build
You can user `ENV` directive in Dockerfile to disable the installation for some services or change `image/buildconfig`. The flags are : DISABLE_SSHD DISABLE_CRON DISABLE_SYSLOG
- Loading branch information
1 parent
7425da2
commit 9adbd42
Showing
25 changed files
with
138 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
export LC_ALL=C | ||
export DEBIAN_FRONTEND=noninteractive | ||
minimal_apt_get_install='apt-get install -y --no-install-recommends' | ||
|
||
# Default services | ||
# Set 1 to the service you want to disable | ||
export DISABLE_SYSLOG=${DISABLE_SYSLOG:-0} | ||
export DISABLE_SSH=${DISABLE_SSH:-0} | ||
export DISABLE_CRON=${DISABLE_CRON:-0} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -e | ||
source /bd_build/buildconfig | ||
set -x | ||
|
||
$minimal_apt_get_install cron | ||
mkdir /etc/service/cron | ||
chmod 600 /etc/crontab | ||
cp /bd_build/services/cron/cron.runit /etc/service/cron/run | ||
|
||
## Remove useless cron entries. | ||
# Checks for lost+found and scans for mtab. | ||
rm -f /etc/cron.daily/standard | ||
rm -f /etc/cron.daily/upstart | ||
rm -f /etc/cron.daily/dpkg | ||
rm -f /etc/cron.daily/password | ||
rm -f /etc/cron.weekly/fstrim |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
source /bd_build/buildconfig | ||
set -x | ||
|
||
SSHD_BUILD_PATH=/bd_build/services/sshd | ||
|
||
## Install the SSH server. | ||
$minimal_apt_get_install openssh-server | ||
mkdir /var/run/sshd | ||
mkdir /etc/service/sshd | ||
touch /etc/service/sshd/down | ||
cp $SSHD_BUILD_PATH/sshd.runit /etc/service/sshd/run | ||
cp $SSHD_BUILD_PATH/sshd_config /etc/ssh/sshd_config | ||
cp $SSHD_BUILD_PATH/00_regen_ssh_host_keys.sh /etc/my_init.d/ | ||
|
||
## Install default SSH key for root and app. | ||
mkdir -p /root/.ssh | ||
chmod 700 /root/.ssh | ||
chown root:root /root/.ssh | ||
cp $SSHD_BUILD_PATH/keys/insecure_key.pub /etc/insecure_key.pub | ||
cp $SSHD_BUILD_PATH/keys/insecure_key /etc/insecure_key | ||
chmod 644 /etc/insecure_key* | ||
chown root:root /etc/insecure_key* | ||
cp $SSHD_BUILD_PATH/enable_insecure_key /usr/sbin/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -e | ||
source /bd_build/buildconfig | ||
set -x | ||
|
||
SYSLOG_NG_BUILD_PATH=/bd_build/services/syslog-ng | ||
|
||
## Install a syslog daemon. | ||
$minimal_apt_get_install syslog-ng-core | ||
mkdir /etc/service/syslog-ng | ||
cp $SYSLOG_NG_BUILD_PATH/syslog-ng.runit /etc/service/syslog-ng/run | ||
mkdir -p /var/lib/syslog-ng | ||
cp $SYSLOG_NG_BUILD_PATH/syslog_ng_default /etc/default/syslog-ng | ||
touch /var/log/syslog | ||
chmod u=rw,g=r,o= /var/log/syslog | ||
cp $SYSLOG_NG_BUILD_PATH/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf | ||
|
||
## Install syslog to "docker logs" forwarder. | ||
mkdir /etc/service/syslog-forwarder | ||
cp $SYSLOG_NG_BUILD_PATH/syslog-forwarder.runit /etc/service/syslog-forwarder/run | ||
|
||
## Install logrotate. | ||
$minimal_apt_get_install logrotate | ||
cp $SYSLOG_NG_BUILD_PATH/logrotate_syslogng /etc/logrotate.d/syslog-ng |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters