Skip to content

MENDELU/install directory is created with correct ownership for test and cli#1282

Merged
milanmajchrak merged 1 commit intocustomer/mendelufrom
mendelu/fix-docker-install-permissions-cli-and-test
Mar 17, 2026
Merged

MENDELU/install directory is created with correct ownership for test and cli#1282
milanmajchrak merged 1 commit intocustomer/mendelufrom
mendelu/fix-docker-install-permissions-cli-and-test

Conversation

@Paurikova2
Copy link
Collaborator

Problem description

During the Docker build process, the following error occurs:

mkdir: cannot create directory ‘/install’: Permission denied

This happens in the build stage when running:

RUN mkdir /install \
    && chown -Rv dspace: /install \
    && chown -Rv dspace: /app

Root Cause

The base image dspace/dspace-dependencies:dspace-9_x now runs as a non-root user (dspace) by default.
Because of this change, the container no longer has permission to create directories in the root filesystem (/), which causes the build to fail when attempting to create /install.

Fix

The issue was resolved by explicitly switching to the root user before creating the directory:

USER root
RUN mkdir /install \
    && chown -Rv dspace: /install \
    && chown -Rv dspace: /app
USER dspace

This allows the directory to be created with sufficient permissions, after which ownership is assigned back to the dspace user and the build continues securely as a non-root user.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

@milanmajchrak milanmajchrak merged commit 83f4ec5 into customer/mendelu Mar 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants