Skip to content

Commit f790faa

Browse files
committed
fix: fix permissions for registries.conf file in OpenShift 3
The .config directory in the product is shared between several entities: - snyk protect creates it as part of storing metadata - we mount registries.conf to override some image pulling properties On OpenShift the mounting over an existing directory acts weird and makes the .config directory completely inaccessible to our user and breaking the registries.conf support that we have. This fix pre-creates the directory with the right permissions in the Dockerfile so the OpenShift 3 behaviour is fixed.
1 parent c7dd833 commit f790faa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ COPY --chown=snyk:snyk --from=skopeo-build /etc/containers/policy.json /etc/cont
3535
# Add manifest files and install before adding anything else to take advantage of layer caching
3636
ADD --chown=snyk:snyk package.json package-lock.json .snyk ./
3737

38+
# The `.config` directory is used by `snyk protect` and we also mount a K8s volume there at runtime.
39+
# This clashes with OpenShift 3 which mounts things differently and prevents access to the directory.
40+
# TODO: Remove this line once OpenShift 3 comes out of support.
41+
RUN mkdir -p .config
42+
3843
RUN npm install
3944

4045
# add the rest of the app files

0 commit comments

Comments
 (0)