From e9c1c172071b9283af83dc0f539010a1449a91ab Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 16 Nov 2018 09:24:48 +0000 Subject: [PATCH] Do not manually fix permissions issues by manipulating /etc/passwd If permissions problems exist, they should be overcome properly. For examples see: LINK: https://github.com/docker-library/rabbitmq/pull/60 LINK: https://github.com/docker-library/cassandra/pull/48 LINK: https://github.com/docker-library/mongo/pull/81 LINK: https://github.com/docker-library/redis/pull/48 LINK: https://github.com/docker-library/mysql/pull/161 LINK: https://github.com/docker-library/mariadb/pull/59 LINK: https://github.com/docker-library/percona/pull/21 LINK: https://github.com/docker-library/ghost/pull/54 LINK: https://github.com/docker-library/postgres/pull/253 As suggested by @tianon LINK: https://github.com/docker-library/official-images/pull/3724#issuecomment-355423609 This is part of an effort to make FluentD part of Docker's Official Images. Signed-off-by: Lee Jones --- README.md | 4 ---- entrypoint.sh.erb | 20 -------------------- v0.12/alpine-onbuild/entrypoint.sh | 15 --------------- v0.12/alpine/entrypoint.sh | 15 --------------- v0.12/debian-onbuild/entrypoint.sh | 16 ---------------- v0.12/debian/entrypoint.sh | 16 ---------------- v0.14/alpine-onbuild/entrypoint.sh | 15 --------------- v0.14/alpine/entrypoint.sh | 15 --------------- v0.14/debian-onbuild/entrypoint.sh | 16 ---------------- v0.14/debian/entrypoint.sh | 16 ---------------- v1.0/alpine-onbuild/entrypoint.sh | 15 --------------- v1.0/alpine/entrypoint.sh | 15 --------------- v1.0/debian-onbuild/entrypoint.sh | 16 ---------------- v1.0/debian/entrypoint.sh | 16 ---------------- v1.1/alpine-onbuild/entrypoint.sh | 15 --------------- v1.1/alpine/entrypoint.sh | 15 --------------- v1.1/debian-onbuild/entrypoint.sh | 16 ---------------- v1.1/debian/entrypoint.sh | 16 ---------------- v1.2/alpine-onbuild/entrypoint.sh | 18 ------------------ v1.2/alpine/entrypoint.sh | 15 --------------- v1.2/armhf/alpine-onbuild/entrypoint.sh | 15 --------------- v1.2/armhf/alpine/entrypoint.sh | 15 --------------- v1.2/armhf/debian-onbuild/entrypoint.sh | 16 ---------------- v1.2/armhf/debian/entrypoint.sh | 16 ---------------- v1.2/debian-onbuild/entrypoint.sh | 16 ---------------- v1.2/debian/entrypoint.sh | 16 ---------------- v1.2/windows/entrypoint.sh | 16 ---------------- v1.3/alpine-onbuild/entrypoint.sh | 15 --------------- v1.3/alpine/entrypoint.sh | 15 --------------- v1.3/armhf/debian-onbuild/entrypoint.sh | 16 ---------------- v1.3/armhf/debian/entrypoint.sh | 16 ---------------- v1.3/debian-onbuild/entrypoint.sh | 16 ---------------- v1.3/debian/entrypoint.sh | 16 ---------------- v1.3/windows/entrypoint.sh | 16 ---------------- 34 files changed, 525 deletions(-) diff --git a/README.md b/README.md index 1b7a704a..372f276f 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,6 @@ of `docker run`). Use this variable to specify other Fluentd command line options, like `-v` or `-q`. -### `FLUENT_UID` - -Use this variable to specify user id of fluent user. - ## Image versions This image is based on the popular [Alpine Linux project][1], available in diff --git a/entrypoint.sh.erb b/entrypoint.sh.erb index e9e49d19..59621f1a 100644 --- a/entrypoint.sh.erb +++ b/entrypoint.sh.erb @@ -1,22 +1,6 @@ <% is_alpine = (dockerfile.split("/").last.split("-").first == "alpine") %> #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -<% if is_alpine %> -adduser -D -g '' -u ${uid} -h /home/fluent fluent -<% else %> -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent -<% end %> - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -26,10 +10,6 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - <% if is_alpine %> exec su-exec fluent "$@" <% else %> diff --git a/v0.12/alpine-onbuild/entrypoint.sh b/v0.12/alpine-onbuild/entrypoint.sh index f9b5e04a..8d9165ba 100644 --- a/v0.12/alpine-onbuild/entrypoint.sh +++ b/v0.12/alpine-onbuild/entrypoint.sh @@ -1,16 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v0.12/alpine/entrypoint.sh b/v0.12/alpine/entrypoint.sh index f9b5e04a..8d9165ba 100644 --- a/v0.12/alpine/entrypoint.sh +++ b/v0.12/alpine/entrypoint.sh @@ -1,16 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v0.12/debian-onbuild/entrypoint.sh b/v0.12/debian-onbuild/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v0.12/debian-onbuild/entrypoint.sh +++ b/v0.12/debian-onbuild/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v0.12/debian/entrypoint.sh b/v0.12/debian/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v0.12/debian/entrypoint.sh +++ b/v0.12/debian/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v0.14/alpine-onbuild/entrypoint.sh b/v0.14/alpine-onbuild/entrypoint.sh index 6515d970..4849959d 100644 --- a/v0.14/alpine-onbuild/entrypoint.sh +++ b/v0.14/alpine-onbuild/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v0.14/alpine/entrypoint.sh b/v0.14/alpine/entrypoint.sh index 6515d970..4849959d 100644 --- a/v0.14/alpine/entrypoint.sh +++ b/v0.14/alpine/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v0.14/debian-onbuild/entrypoint.sh b/v0.14/debian-onbuild/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v0.14/debian-onbuild/entrypoint.sh +++ b/v0.14/debian-onbuild/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v0.14/debian/entrypoint.sh b/v0.14/debian/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v0.14/debian/entrypoint.sh +++ b/v0.14/debian/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.0/alpine-onbuild/entrypoint.sh b/v1.0/alpine-onbuild/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.0/alpine-onbuild/entrypoint.sh +++ b/v1.0/alpine-onbuild/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.0/alpine/entrypoint.sh b/v1.0/alpine/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.0/alpine/entrypoint.sh +++ b/v1.0/alpine/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.0/debian-onbuild/entrypoint.sh b/v1.0/debian-onbuild/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v1.0/debian-onbuild/entrypoint.sh +++ b/v1.0/debian-onbuild/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.0/debian/entrypoint.sh b/v1.0/debian/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v1.0/debian/entrypoint.sh +++ b/v1.0/debian/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.1/alpine-onbuild/entrypoint.sh b/v1.1/alpine-onbuild/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.1/alpine-onbuild/entrypoint.sh +++ b/v1.1/alpine-onbuild/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.1/alpine/entrypoint.sh b/v1.1/alpine/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.1/alpine/entrypoint.sh +++ b/v1.1/alpine/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.1/debian-onbuild/entrypoint.sh b/v1.1/debian-onbuild/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v1.1/debian-onbuild/entrypoint.sh +++ b/v1.1/debian-onbuild/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.1/debian/entrypoint.sh b/v1.1/debian/entrypoint.sh index a21b79d5..221267cd 100644 --- a/v1.1/debian/entrypoint.sh +++ b/v1.1/debian/entrypoint.sh @@ -1,19 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.2/alpine-onbuild/entrypoint.sh b/v1.2/alpine-onbuild/entrypoint.sh index f9b5e04a..e371f6ae 100644 --- a/v1.2/alpine-onbuild/entrypoint.sh +++ b/v1.2/alpine-onbuild/entrypoint.sh @@ -1,27 +1,9 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -#source vars if file exists -DEFAULT=/etc/default/fluentd - if [ -r $DEFAULT ]; then set -o allexport source $DEFAULT set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.2/alpine/entrypoint.sh b/v1.2/alpine/entrypoint.sh index f9b5e04a..8d9165ba 100644 --- a/v1.2/alpine/entrypoint.sh +++ b/v1.2/alpine/entrypoint.sh @@ -1,16 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.2/armhf/alpine-onbuild/entrypoint.sh b/v1.2/armhf/alpine-onbuild/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.2/armhf/alpine-onbuild/entrypoint.sh +++ b/v1.2/armhf/alpine-onbuild/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.2/armhf/alpine/entrypoint.sh b/v1.2/armhf/alpine/entrypoint.sh index 6515d970..4849959d 100644 --- a/v1.2/armhf/alpine/entrypoint.sh +++ b/v1.2/armhf/alpine/entrypoint.sh @@ -1,18 +1,3 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.2/armhf/debian-onbuild/entrypoint.sh b/v1.2/armhf/debian-onbuild/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.2/armhf/debian-onbuild/entrypoint.sh +++ b/v1.2/armhf/debian-onbuild/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.2/armhf/debian/entrypoint.sh b/v1.2/armhf/debian/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.2/armhf/debian/entrypoint.sh +++ b/v1.2/armhf/debian/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.2/debian-onbuild/entrypoint.sh b/v1.2/debian-onbuild/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.2/debian-onbuild/entrypoint.sh +++ b/v1.2/debian-onbuild/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.2/debian/entrypoint.sh b/v1.2/debian/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.2/debian/entrypoint.sh +++ b/v1.2/debian/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.2/windows/entrypoint.sh b/v1.2/windows/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.2/windows/entrypoint.sh +++ b/v1.2/windows/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.3/alpine-onbuild/entrypoint.sh b/v1.3/alpine-onbuild/entrypoint.sh index f9b5e04a..8d9165ba 100644 --- a/v1.3/alpine-onbuild/entrypoint.sh +++ b/v1.3/alpine-onbuild/entrypoint.sh @@ -1,16 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.3/alpine/entrypoint.sh b/v1.3/alpine/entrypoint.sh index f9b5e04a..8d9165ba 100644 --- a/v1.3/alpine/entrypoint.sh +++ b/v1.3/alpine/entrypoint.sh @@ -1,16 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -adduser -D -g '' -u ${uid} -h /home/fluent fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec su-exec fluent "$@" diff --git a/v1.3/armhf/debian-onbuild/entrypoint.sh b/v1.3/armhf/debian-onbuild/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.3/armhf/debian-onbuild/entrypoint.sh +++ b/v1.3/armhf/debian-onbuild/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.3/armhf/debian/entrypoint.sh b/v1.3/armhf/debian/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.3/armhf/debian/entrypoint.sh +++ b/v1.3/armhf/debian/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.3/debian-onbuild/entrypoint.sh b/v1.3/debian-onbuild/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.3/debian-onbuild/entrypoint.sh +++ b/v1.3/debian-onbuild/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.3/debian/entrypoint.sh b/v1.3/debian/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.3/debian/entrypoint.sh +++ b/v1.3/debian/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@" diff --git a/v1.3/windows/entrypoint.sh b/v1.3/windows/entrypoint.sh index 50262851..1fb5a611 100644 --- a/v1.3/windows/entrypoint.sh +++ b/v1.3/windows/entrypoint.sh @@ -1,17 +1,5 @@ #!/usr/bin/dumb-init /bin/sh -uid=${FLUENT_UID:-1000} - -# check if a old fluent user exists and delete it -cat /etc/passwd | grep fluent -if [ $? -eq 0 ]; then - deluser fluent -fi - -# (re)add the fluent user with $FLUENT_UID -useradd -u ${uid} -o -c "" -m fluent -export HOME=/home/fluent - #source vars if file exists DEFAULT=/etc/default/fluentd @@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then set +o allexport fi -# chown home and data folder -chown -R fluent /home/fluent -chown -R fluent /fluentd - exec gosu fluent "$@"