mirror of
/repos/baseimage-docker.git
synced 2025-12-31 08:11:29 +01:00
Enable cron
This commit is contained in:
parent
c4b9fe56f8
commit
16ccc1e40d
@ -26,9 +26,12 @@ Why use baseimage-docker instead of doing everything yourself in Dockerfile?
|
||||
| Fixes APT incompatibilities with Docker | See https://github.com/dotcloud/docker/issues/1024. |
|
||||
| syslog-ng | A syslog daemon is necessary so that many services - including the kernel itself - can correctly log to /var/log/syslog. If no syslog daemon is running, a lot of important messages are silently swallowed. <br><br>Only listens locally. |
|
||||
| ssh server | Allows you to easily login to your container to inspect or administer things. <br><br>Password and challenge-response authentication are disabled by default. Only key authentication is allowed.<br>It allows an predefined key by default to make debugging easy. You should replace this ASAP. See instructions. |
|
||||
| cron | The cron daemon must be running for cron jobs to work. |
|
||||
| [runit](http://smarden.org/runit/) | For service supervision and management. Much easier to use than SysV init and supports restarting daemons when they crash. Much easier to use and more lightweight than Upstart. |
|
||||
| `setuser` | A tool for running a command as another user. Easier to use than `su`, has a smaller attack vector than `sudo`, and unlike `chpst` this tool sets `$HOME` correctly. Available as `/sbin/setuser`. |
|
||||
|
||||
Baseimage-docker is very lightweight: it only consumes 4 MB of memory.
|
||||
|
||||
## Using baseimage-docker as base image
|
||||
|
||||
The image is called `phusion/baseimage`, and is available on the Docker registry.
|
||||
@ -41,6 +44,9 @@ By default, it allows SSH access for the key in `image/insecure_key`. This makes
|
||||
# a list of version numbers.
|
||||
FROM phusion/baseimage:<VERSION>
|
||||
|
||||
# Set correct environment variables.
|
||||
ENV HOME /root
|
||||
|
||||
# Remove authentication rights for insecure_key.
|
||||
RUN rm -f /root/.ssh/authorized_keys /home/*/.ssh/authorized_keys
|
||||
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
export LC_ALL=C
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
minimal_apt_get_install='apt-get install -y --no-install-recommends'
|
||||
|
||||
@ -9,7 +9,7 @@ echo deb http://archive.ubuntu.com/ubuntu precise-updates main universe >> /etc/
|
||||
apt-get update
|
||||
|
||||
## Install HTTPS support for APT.
|
||||
apt-get install -y apt-transport-https
|
||||
$minimal_apt_get_install apt-transport-https
|
||||
|
||||
## Fix some issues with APT packages.
|
||||
## See https://github.com/dotcloud/docker/issues/1024
|
||||
@ -18,8 +18,8 @@ ln -s /bin/true /sbin/initctl
|
||||
|
||||
## Upgrade all packages.
|
||||
echo "initscripts hold" | dpkg --set-selections
|
||||
apt-get upgrade -y
|
||||
apt-get upgrade -y --no-install-recommends
|
||||
|
||||
## Fix locale.
|
||||
apt-get install -y language-pack-en
|
||||
$minimal_apt_get_install language-pack-en
|
||||
locale-gen en_US
|
||||
|
||||
2
image/runit/cron
Executable file
2
image/runit/cron
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/cron -f
|
||||
@ -7,15 +7,15 @@ set -x
|
||||
cp /build/my_init /sbin/
|
||||
|
||||
## Install runit.
|
||||
apt-get install -y runit
|
||||
$minimal_apt_get_install runit
|
||||
|
||||
## Install a syslog daemon.
|
||||
apt-get install -y syslog-ng
|
||||
$minimal_apt_get_install syslog-ng-core
|
||||
mkdir /etc/service/syslog-ng
|
||||
cp /build/runit/syslog-ng /etc/service/syslog-ng/run
|
||||
|
||||
## Install the SSH server.
|
||||
apt-get install -y openssh-server
|
||||
$minimal_apt_get_install openssh-server
|
||||
mkdir /var/run/sshd
|
||||
mkdir /etc/service/sshd
|
||||
cp /build/runit/sshd /etc/service/sshd/run
|
||||
@ -26,3 +26,8 @@ mkdir -p /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
chown root:root /root/.ssh
|
||||
cat /build/insecure_key.pub > /root/.ssh/authorized_keys
|
||||
|
||||
## Install cron daemon.
|
||||
$minimal_apt_get_install cron
|
||||
mkdir /etc/service/cron
|
||||
cp /build/runit/cron /etc/service/cron/run
|
||||
|
||||
@ -4,7 +4,7 @@ source /build/buildconfig
|
||||
set -x
|
||||
|
||||
## Often used tools.
|
||||
apt-get install -y curl less nano vim psmisc
|
||||
$minimal_apt_get_install curl less nano vim psmisc
|
||||
|
||||
## This tool runs a command as another user and sets $HOME.
|
||||
cp /build/setuser /sbin/setuser
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user