1
0
mirror of /repos/baseimage-docker.git synced 2025-12-30 08:01:31 +01:00

Avoid suggesting that there should be a comment line before the shebang.

This commit is contained in:
Daniel Knoppel (Phusion) 2015-05-20 09:44:52 +02:00
parent c983f03960
commit d04ad47930

View File

@ -153,13 +153,15 @@ The shell script must be called `run`, must be executable, and is to be placed i
Here's an example showing you how a memcached server runit entry can be made. Here's an example showing you how a memcached server runit entry can be made.
### In memcached.sh (make sure this file is chmod +x): In `memcached.sh` (make sure this file is chmod +x):
#!/bin/sh #!/bin/sh
# `/sbin/setuser memcache` runs the given command as the user `memcache`. # `/sbin/setuser memcache` runs the given command as the user `memcache`.
# If you omit that part, the command will be run as root. # If you omit that part, the command will be run as root.
exec /sbin/setuser memcache /usr/bin/memcached >>/var/log/memcached.log 2>&1 exec /sbin/setuser memcache /usr/bin/memcached >>/var/log/memcached.log 2>&1
### In Dockerfile: In `Dockerfile`:
RUN mkdir /etc/service/memcached RUN mkdir /etc/service/memcached
ADD memcached.sh /etc/service/memcached/run ADD memcached.sh /etc/service/memcached/run
@ -177,11 +179,13 @@ All scripts must exit correctly, e.g. with exit code 0. If any script exits with
The following example shows how you can add a startup script. This script simply logs the time of boot to the file /tmp/boottime.txt. The following example shows how you can add a startup script. This script simply logs the time of boot to the file /tmp/boottime.txt.
### In logtime.sh (make sure this file is chmod +x): In `logtime.sh` (make sure this file is chmod +x):
#!/bin/sh #!/bin/sh
date > /tmp/boottime.txt date > /tmp/boottime.txt
### In Dockerfile: In `Dockerfile`:
RUN mkdir -p /etc/my_init.d RUN mkdir -p /etc/my_init.d
ADD logtime.sh /etc/my_init.d/logtime.sh ADD logtime.sh /etc/my_init.d/logtime.sh