Skip to content

Commit

Permalink
Do not manually fix permissions issues by manipulating /etc/passwd
Browse files Browse the repository at this point in the history
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: docker-library/redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: docker-library/ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Lee Jones committed Nov 16, 2018
1 parent 19cdb99 commit 3f6bae6
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 289 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -80,10 +80,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
Expand Down
20 changes: 0 additions & 20 deletions 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

Expand All @@ -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 %>
Expand Down
15 changes: 0 additions & 15 deletions 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

Expand All @@ -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 "$@"
16 changes: 0 additions & 16 deletions 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

Expand All @@ -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 "$@"
15 changes: 0 additions & 15 deletions 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 "$@"
16 changes: 0 additions & 16 deletions 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 "$@"
15 changes: 0 additions & 15 deletions 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 "$@"
16 changes: 0 additions & 16 deletions 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 "$@"
15 changes: 0 additions & 15 deletions 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 "$@"
16 changes: 0 additions & 16 deletions 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 "$@"
15 changes: 0 additions & 15 deletions 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

Expand All @@ -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 "$@"
15 changes: 0 additions & 15 deletions 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 "$@"
16 changes: 0 additions & 16 deletions 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

Expand All @@ -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 "$@"
16 changes: 0 additions & 16 deletions 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

Expand All @@ -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 "$@"
16 changes: 0 additions & 16 deletions 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

Expand All @@ -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 "$@"
15 changes: 0 additions & 15 deletions 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

Expand All @@ -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 "$@"
16 changes: 0 additions & 16 deletions 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

Expand All @@ -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 "$@"

0 comments on commit 3f6bae6

Please sign in to comment.