-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·30 lines (27 loc) · 923 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·30 lines (27 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# For systems without journald.
mkdir -p /var/log/journal
if [ -z "${METADATA_AGENT_URL:-}" -a -n "${METADATA_AGENT_HOSTNAME:-}" ]; then
METADATA_AGENT_URL="http://${METADATA_AGENT_HOSTNAME}:8000"
fi
if [ -n "$METADATA_AGENT_URL" ]; then
sed -i "s,http://local-metadata-agent.stackdriver.com:8000,$METADATA_AGENT_URL," \
/etc/google-fluentd/google-fluentd.conf
fi
# This docker image supports sending either a flag or a command as the docker
# command. When a flag is sent, it will be passed on to the fluentd process.
# Anything else will be interpreted as the command to be run.
#
# Passing a flag.
# $ docker run -it {image:tag} -o /var/log/google-fluentd.log
#
# Passing a command.
# $ docker run -it {image:tag} /bin/bash
#
# Default behavior uses CMD defined in Dockerfile.
# $ docker run -it {image:tag}
if [ "${1:0:1}" = '-' ]; then
exec "/usr/sbin/google-fluentd" "$@"
else
exec "$@"
fi