Skip to content

Commit 7942e9e

Browse files
committed
Remove the named user, change permissions to 'g+w'
1 parent 01c4137 commit 7942e9e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ RUN apk add --no-cache \
5151
postgresql-libs \
5252
ttf-ubuntu-font-family
5353

54-
RUN addgroup -S -g 101 netbox \
55-
&& adduser -DHS -u 101 netbox \
56-
&& adduser netbox netbox
57-
5854
WORKDIR /opt
5955

6056
COPY --from=builder /install /usr/local
@@ -73,10 +69,11 @@ COPY configuration/configuration.py /etc/netbox/config/configuration.py
7369
WORKDIR /opt/netbox/netbox
7470

7571
# Must set permissions for '/opt/netbox/netbox/static' directory
76-
# to a+w so that `./manage.py collectstatic` can be executed during
72+
# to g+w so that `./manage.py collectstatic` can be executed during
7773
# container startup.
78-
# Not satisfying
79-
RUN mkdir static && chmod a+w static media
74+
# Must set permissions for '/opt/netbox/netbox/media' directory
75+
# to g+w so that pictures can be uploaded to netbox.
76+
RUN mkdir static && chmod g+w static media
8077

8178
ENTRYPOINT [ "/opt/netbox/docker-entrypoint.sh" ]
8279

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- redis
88
- netbox-worker
99
env_file: env/netbox.env
10-
user: netbox
10+
user: '101'
1111
volumes:
1212
- ./startup_scripts:/opt/netbox/startup_scripts:z,ro
1313
- ./initializers:/opt/netbox/initializers:z,ro

0 commit comments

Comments
 (0)