Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Update docker image to permit running as non-root and other tweaks for complement build #11431

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ COPY --from=builder /install /usr/local
COPY ./docker/start.py /start.py
COPY ./docker/conf /conf

RUN mkdir /data

# Set permissions for GID=0 to be able to interact with /conf and /data
# Allows container to be deployed in OpenShift without UID 0
# https://docs.openshift.com/container-platform/4.7/openshift_images/create-images.html#images-create-guide-openshift_create-images
RUN chgrp -R 0 /conf /data && \
chmod -R g+rw /conf /data
Comment on lines +90 to +91
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly surprised this is needed. What is the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chmod -R g+w is the only absolutely required change; normally these are u+rw ; g+r

I duplicated the change from synapse-workers where there are cases of things being different; it seemed to me to be a good way to clearly state what was intended, rather than rely on the default not changing. It doesn't make much change to the build speed.


VOLUME ["/data"]

EXPOSE 8008/tcp 8009/tcp 8448/tcp
Expand Down
3 changes: 0 additions & 3 deletions docker/Dockerfile-workers
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ COPY ./docker/conf-workers/* /conf/
# Expose nginx listener port
EXPOSE 8080/tcp

# Volume for user-editable config files, logs etc.
VOLUME ["/data"]

# A script to read environment variables and create the necessary
# files to run the desired worker configuration. Will start supervisord.
COPY ./docker/configure_workers_and_start.py /configure_workers_and_start.py
Expand Down