Skip to content

Commit 3aa725a

Browse files
authored
fix: corepack permissions (#330)
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 8178c04 commit 3aa725a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docker-image/Dockerfiles/Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,20 @@ ENV GRADLE_HOME=/usr/gradle-9.2.1
111111
COPY --from=builder /usr/local/corepack/ /usr/local/corepack/
112112
ENV COREPACK_HOME=/usr/local/corepack/cache
113113

114-
# Install Python via microdnf (cleanest approach for minimal images)
114+
# Install Python via microdnf and fix corepack cache permissions
115115
USER root
116-
RUN microdnf install -y python3 python3-pip && microdnf clean all
116+
RUN microdnf install -y python3 python3-pip \
117+
&& microdnf clean all \
118+
&& chown -R 1001:0 /usr/local/corepack/cache \
119+
&& chmod -R g+rwX /usr/local/corepack/cache
117120
USER 1001
118121

119-
# Update PATH (includes corepack bin for pnpm/yarn)
120-
ENV PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin:$GOLANG_HOME/bin:$GRADLE_HOME/bin:/usr/local/corepack/bin:/app/node_modules/.bin
122+
# Update PATH (corepack bin first for pnpm/yarn to be found reliably)
123+
ENV PATH=/usr/local/corepack/bin:/app/node_modules/.bin:$JAVA_HOME/bin:$MAVEN_HOME/bin:$GOLANG_HOME/bin:$GRADLE_HOME/bin:$PATH
124+
125+
# Set explicit paths for package managers (used by trustify-da-javascript-client)
126+
ENV TRUSTIFY_DA_PNPM_PATH=/usr/local/corepack/bin/pnpm
127+
ENV TRUSTIFY_DA_YARN_PATH=/usr/local/corepack/bin/yarn
121128

122129
# Copy jq executable from the builder stage
123130
COPY --from=builder /usr/bin/jq /usr/bin/jq

0 commit comments

Comments
 (0)