Skip to content

Commit 34ed7d5

Browse files
author
Lee Jones
committed
Do not manually fix permissions issues by manipulating /etc/passwd
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]>
1 parent 87f6b9a commit 34ed7d5

File tree

34 files changed

+0
-525
lines changed

34 files changed

+0
-525
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ of `docker run`).
8989
Use this variable to specify other Fluentd command line options,
9090
like `-v` or `-q`.
9191

92-
### `FLUENT_UID`
93-
94-
Use this variable to specify user id of fluent user.
95-
9692
## Image versions
9793

9894
This image is based on the popular [Alpine Linux project][1], available in

entrypoint.sh.erb

-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
<% is_alpine = (dockerfile.split("/").last.split("-").first == "alpine") %>
22
#!/usr/bin/dumb-init /bin/sh
33

4-
uid=${FLUENT_UID:-1000}
5-
6-
# check if a old fluent user exists and delete it
7-
cat /etc/passwd | grep fluent
8-
if [ $? -eq 0 ]; then
9-
deluser fluent
10-
fi
11-
12-
# (re)add the fluent user with $FLUENT_UID
13-
<% if is_alpine %>
14-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
15-
<% else %>
16-
useradd -u ${uid} -o -c "" -m fluent
17-
export HOME=/home/fluent
18-
<% end %>
19-
204
#source vars if file exists
215
DEFAULT=/etc/default/fluentd
226

@@ -26,10 +10,6 @@ if [ -r $DEFAULT ]; then
2610
set +o allexport
2711
fi
2812

29-
# chown home and data folder
30-
chown -R fluent /home/fluent
31-
chown -R fluent /fluentd
32-
3313
<% if is_alpine %>
3414
exec su-exec fluent "$@"
3515
<% else %>

v0.12/alpine-onbuild/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
143
#source vars if file exists
154
DEFAULT=/etc/default/fluentd
165

@@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then
209
set +o allexport
2110
fi
2211

23-
# chown home and data folder
24-
chown -R fluent /home/fluent
25-
chown -R fluent /fluentd
26-
2712
exec su-exec fluent "$@"

v0.12/alpine/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
143
#source vars if file exists
154
DEFAULT=/etc/default/fluentd
165

@@ -20,8 +9,4 @@ if [ -r $DEFAULT ]; then
209
set +o allexport
2110
fi
2211

23-
# chown home and data folder
24-
chown -R fluent /home/fluent
25-
chown -R fluent /fluentd
26-
2712
exec su-exec fluent "$@"

v0.12/debian-onbuild/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
153
#source vars if file exists
164
DEFAULT=/etc/default/fluentd
175

@@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then
219
set +o allexport
2210
fi
2311

24-
# chown home and data folder
25-
chown -R fluent /home/fluent
26-
chown -R fluent /fluentd
27-
2812
exec gosu fluent "$@"

v0.12/debian/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
153
#source vars if file exists
164
DEFAULT=/etc/default/fluentd
175

@@ -21,8 +9,4 @@ if [ -r $DEFAULT ]; then
219
set +o allexport
2210
fi
2311

24-
# chown home and data folder
25-
chown -R fluent /home/fluent
26-
chown -R fluent /fluentd
27-
2812
exec gosu fluent "$@"

v0.14/alpine-onbuild/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v0.14/alpine/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v0.14/debian-onbuild/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

v0.14/debian/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

v1.0/alpine-onbuild/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v1.0/alpine/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v1.0/debian-onbuild/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

v1.0/debian/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

v1.1/alpine-onbuild/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v1.1/alpine/entrypoint.sh

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
adduser -D -g '' -u ${uid} -h /home/fluent fluent
13-
14-
# chown home and data folder
15-
chown -R fluent /home/fluent
16-
chown -R fluent /fluentd
17-
183
exec su-exec fluent "$@"

v1.1/debian-onbuild/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

v1.1/debian/entrypoint.sh

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
#!/usr/bin/dumb-init /bin/sh
22

3-
uid=${FLUENT_UID:-1000}
4-
5-
# check if a old fluent user exists and delete it
6-
cat /etc/passwd | grep fluent
7-
if [ $? -eq 0 ]; then
8-
deluser fluent
9-
fi
10-
11-
# (re)add the fluent user with $FLUENT_UID
12-
useradd -u ${uid} -o -c "" -m fluent
13-
export HOME=/home/fluent
14-
15-
# chown home and data folder
16-
chown -R fluent /home/fluent
17-
chown -R fluent /fluentd
18-
193
exec gosu fluent "$@"

0 commit comments

Comments
 (0)