mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
docker: add support for arbitrary user ids (for OpenShift compatibility)
This solves a compatibility problem with OpenShift. In OpenShift security model, the containers are run by arbitrary user ids, but the users are always a member of the root group. This PR adjusts the permissions accordingly. Documentation reference: https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#use-uid
This commit is contained in:
parent
79406051fa
commit
ffc718e8c0
1 changed files with 7 additions and 4 deletions
11
Dockerfile
11
Dockerfile
|
@ -25,13 +25,13 @@ ENV NODE_ENV=development
|
||||||
# that do not allow images running as root.
|
# that do not allow images running as root.
|
||||||
RUN useradd --uid 5001 --create-home etherpad
|
RUN useradd --uid 5001 --create-home etherpad
|
||||||
|
|
||||||
RUN mkdir /opt/etherpad-lite && chown etherpad:etherpad /opt/etherpad-lite
|
RUN mkdir /opt/etherpad-lite && chown etherpad:0 /opt/etherpad-lite
|
||||||
|
|
||||||
USER etherpad:etherpad
|
USER etherpad
|
||||||
|
|
||||||
WORKDIR /opt/etherpad-lite
|
WORKDIR /opt/etherpad-lite
|
||||||
|
|
||||||
COPY --chown=etherpad:etherpad ./ ./
|
COPY --chown=etherpad:0 ./ ./
|
||||||
|
|
||||||
# install node dependencies for Etherpad
|
# install node dependencies for Etherpad
|
||||||
RUN bin/installDeps.sh && \
|
RUN bin/installDeps.sh && \
|
||||||
|
@ -44,7 +44,10 @@ RUN bin/installDeps.sh && \
|
||||||
RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}"; done
|
RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}"; done
|
||||||
|
|
||||||
# Copy the configuration file.
|
# Copy the configuration file.
|
||||||
COPY --chown=etherpad:etherpad ./settings.json.docker /opt/etherpad-lite/settings.json
|
COPY --chown=etherpad:0 ./settings.json.docker /opt/etherpad-lite/settings.json
|
||||||
|
|
||||||
|
# Fix permissions for root group
|
||||||
|
RUN chmod -R g=u .
|
||||||
|
|
||||||
EXPOSE 9001
|
EXPOSE 9001
|
||||||
CMD ["node", "node_modules/ep_etherpad-lite/node/server.js"]
|
CMD ["node", "node_modules/ep_etherpad-lite/node/server.js"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue