Skip to content

Commit

Permalink
The /tmp directory has often caused permission issues. (#183)
Browse files Browse the repository at this point in the history
Therefore, it is being cleared out and restored to its default state before the image is used for anything else.
Unfortunately, this will not save memory as deleting directories in Docker does not actually reduce the image size.
  • Loading branch information
veritas9872 authored Dec 31, 2023
1 parent f650f1c commit 31ad7d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ RUN { echo "fpath+=${PURE_PATH}"; \
} >> ${ZDOTDIR}/.zprofile && \
# Change `ZDOTDIR` directory permissions to allow configuration sharing.
chmod 755 ${ZDOTDIR} && \
# Clear out `/tmp` and restore its default permissions.
rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp && \
ldconfig # Update dynamic link cache.

ENV PATH=/opt/conda/bin:${PATH}
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/ngc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ RUN ln -s /opt/conda/lib/$(python -V | awk -F '[ \.]' '{print "python" $2 "." $3
} >> ${ZDOTDIR}/.zprofile && \
# Change `ZDOTDIR` directory permissions to allow configuration sharing.
chmod 755 ${ZDOTDIR} && \
# Clear out `/tmp` and restore its default permissions.
rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp && \
ldconfig # Update dynamic link cache.

# No alternative to adding the `/opt/conda/bin` directory to `PATH`.
Expand Down
2 changes: 2 additions & 0 deletions dockerfiles/simple.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ RUN { echo "fpath+=${PURE_PATH}"; \
} >> ${ZDOTDIR}/.zprofile && \
# Change `ZDOTDIR` directory permissions to allow configuration sharing.
chmod 755 ${ZDOTDIR} && \
# Clear out `/tmp` and restore its default permissions.
rm -rf /tmp && mkdir /tmp && chmod 1777 /tmp && \
ldconfig # Update dynamic link cache.

ENV PATH=/opt/conda/bin:${PATH}
Expand Down

0 comments on commit 31ad7d3

Please sign in to comment.