Skip to content

Commit d57fc1e

Browse files
author
Lee Jones
committed
Properly introduce the 'fluent' user
The FluentD package does not provide a 'fluent' user. Until now hacks exist in the entrypoint.sh which provide one manually at run-time. Instead of doing that, let's create the user when the container is created. This issue was highlighted by @tianon LINK: docker-library/official-images#3724 (comment) Signed-off-by: Lee Jones <[email protected]>
1 parent af5aa64 commit d57fc1e

File tree

16 files changed

+52
-0
lines changed

16 files changed

+52
-0
lines changed

Dockerfile.template.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ RUN mkdir -p /fluentd/log
168168
# configuration/plugins path (default: copied from .)
169169
RUN mkdir -p /fluentd/etc /fluentd/plugins
170170

171+
<% if is_alpine %>
172+
RUN addgroup -S fluent && adduser -S -g fluent fluent
173+
<% else %>
174+
RUN groupadd -r fluent && useradd -r -g fluent fluent
175+
<% end %>
176+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
177+
171178
COPY fluent.conf /fluentd/etc/
172179
COPY entrypoint.sh /bin/
173180
RUN chmod +x /bin/entrypoint.sh

v0.12/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN mkdir -p /fluentd/log
3535
# configuration/plugins path (default: copied from .)
3636
RUN mkdir -p /fluentd/etc /fluentd/plugins
3737

38+
RUN addgroup -S fluent && adduser -S -g fluent fluent
39+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
40+
3841
COPY fluent.conf /fluentd/etc/
3942
COPY entrypoint.sh /bin/
4043
RUN chmod +x /bin/entrypoint.sh

v0.12/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ RUN mkdir -p /fluentd/log
5252
# configuration/plugins path (default: copied from .)
5353
RUN mkdir -p /fluentd/etc /fluentd/plugins
5454

55+
RUN groupadd -r fluent && useradd -r -g fluent fluent
56+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
57+
5558
COPY fluent.conf /fluentd/etc/
5659
COPY entrypoint.sh /bin/
5760
RUN chmod +x /bin/entrypoint.sh

v0.14/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN mkdir -p /fluentd/log
3535
# configuration/plugins path (default: copied from .)
3636
RUN mkdir -p /fluentd/etc /fluentd/plugins
3737

38+
RUN addgroup -S fluent && adduser -S -g fluent fluent
39+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
40+
3841
COPY fluent.conf /fluentd/etc/
3942
COPY entrypoint.sh /bin/
4043
RUN chmod +x /bin/entrypoint.sh

v0.14/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ RUN mkdir -p /fluentd/log
5353
# configuration/plugins path (default: copied from .)
5454
RUN mkdir -p /fluentd/etc /fluentd/plugins
5555

56+
RUN groupadd -r fluent && useradd -r -g fluent fluent
57+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
58+
5659
COPY fluent.conf /fluentd/etc/
5760
COPY entrypoint.sh /bin/
5861
RUN chmod +x /bin/entrypoint.sh

v1.0/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN mkdir -p /fluentd/log
3535
# configuration/plugins path (default: copied from .)
3636
RUN mkdir -p /fluentd/etc /fluentd/plugins
3737

38+
RUN addgroup -S fluent && adduser -S -g fluent fluent
39+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
40+
3841
COPY fluent.conf /fluentd/etc/
3942
COPY entrypoint.sh /bin/
4043
RUN chmod +x /bin/entrypoint.sh

v1.0/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ RUN mkdir -p /fluentd/log
5353
# configuration/plugins path (default: copied from .)
5454
RUN mkdir -p /fluentd/etc /fluentd/plugins
5555

56+
RUN groupadd -r fluent && useradd -r -g fluent fluent
57+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
58+
5659
COPY fluent.conf /fluentd/etc/
5760
COPY entrypoint.sh /bin/
5861
RUN chmod +x /bin/entrypoint.sh

v1.1/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ RUN mkdir -p /fluentd/log
3636
# configuration/plugins path (default: copied from .)
3737
RUN mkdir -p /fluentd/etc /fluentd/plugins
3838

39+
RUN addgroup -S fluent && adduser -S -g fluent fluent
40+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
41+
3942
COPY fluent.conf /fluentd/etc/
4043
COPY entrypoint.sh /bin/
4144
RUN chmod +x /bin/entrypoint.sh

v1.1/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ RUN mkdir -p /fluentd/log
5353
# configuration/plugins path (default: copied from .)
5454
RUN mkdir -p /fluentd/etc /fluentd/plugins
5555

56+
RUN groupadd -r fluent && useradd -r -g fluent fluent
57+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
58+
5659
COPY fluent.conf /fluentd/etc/
5760
COPY entrypoint.sh /bin/
5861
RUN chmod +x /bin/entrypoint.sh

v1.2/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ RUN mkdir -p /fluentd/log
3434
# configuration/plugins path (default: copied from .)
3535
RUN mkdir -p /fluentd/etc /fluentd/plugins
3636

37+
RUN addgroup -S fluent && adduser -S -g fluent fluent
38+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
39+
3740
COPY fluent.conf /fluentd/etc/
3841
COPY entrypoint.sh /bin/
3942
RUN chmod +x /bin/entrypoint.sh

v1.2/armhf/alpine-onbuild/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ RUN mkdir -p /fluentd/log
3838
# configuration/plugins path (default: copied from .)
3939
RUN mkdir -p /fluentd/etc /fluentd/plugins
4040

41+
RUN addgroup -S fluent && adduser -S -g fluent fluent
42+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
43+
4144
COPY fluent.conf /fluentd/etc/
4245
COPY entrypoint.sh /bin/
4346
RUN chmod +x /bin/entrypoint.sh

v1.2/armhf/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ RUN mkdir -p /fluentd/log
3838
# configuration/plugins path (default: copied from .)
3939
RUN mkdir -p /fluentd/etc /fluentd/plugins
4040

41+
RUN groupadd -r fluent && useradd -r -g fluent fluent
42+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
43+
4144
COPY fluent.conf /fluentd/etc/
4245
COPY entrypoint.sh /bin/
4346
RUN chmod +x /bin/entrypoint.sh

v1.2/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ RUN mkdir -p /fluentd/log
5151
# configuration/plugins path (default: copied from .)
5252
RUN mkdir -p /fluentd/etc /fluentd/plugins
5353

54+
RUN groupadd -r fluent && useradd -r -g fluent fluent
55+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
56+
5457
COPY fluent.conf /fluentd/etc/
5558
COPY entrypoint.sh /bin/
5659
RUN chmod +x /bin/entrypoint.sh

v1.3/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN mkdir -p /fluentd/log
3535
# configuration/plugins path (default: copied from .)
3636
RUN mkdir -p /fluentd/etc /fluentd/plugins
3737

38+
RUN addgroup -S fluent && adduser -S -g fluent fluent
39+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
40+
3841
COPY fluent.conf /fluentd/etc/
3942
COPY entrypoint.sh /bin/
4043
RUN chmod +x /bin/entrypoint.sh

v1.3/armhf/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ RUN mkdir -p /fluentd/log
4747
# configuration/plugins path (default: copied from .)
4848
RUN mkdir -p /fluentd/etc /fluentd/plugins
4949

50+
RUN groupadd -r fluent && useradd -r -g fluent fluent
51+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
52+
5053
COPY fluent.conf /fluentd/etc/
5154
COPY entrypoint.sh /bin/
5255
RUN chmod +x /bin/entrypoint.sh

v1.3/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ RUN mkdir -p /fluentd/log
5252
# configuration/plugins path (default: copied from .)
5353
RUN mkdir -p /fluentd/etc /fluentd/plugins
5454

55+
RUN groupadd -r fluent && useradd -r -g fluent fluent
56+
RUN chown -R fluent /fluentd && chgrp -R fluent /fluentd
57+
5558
COPY fluent.conf /fluentd/etc/
5659
COPY entrypoint.sh /bin/
5760
RUN chmod +x /bin/entrypoint.sh

0 commit comments

Comments
 (0)