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: redis/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 <[email protected]>
  • Loading branch information
Lee Jones committed Nov 30, 2018
1 parent 521b003 commit e9c1c17
Show file tree
Hide file tree
Showing 34 changed files with 0 additions and 525 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions entrypoint.sh.erb
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 v0.12/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 v0.12/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
15 changes: 0 additions & 15 deletions v0.14/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
16 changes: 0 additions & 16 deletions v0.14/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
15 changes: 0 additions & 15 deletions v1.0/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
16 changes: 0 additions & 16 deletions v1.0/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
15 changes: 0 additions & 15 deletions v1.1/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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-onbuild/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
16 changes: 0 additions & 16 deletions v1.1/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Loading

0 comments on commit e9c1c17

Please sign in to comment.