瀏覽代碼

fix file permissions with arbitrary uids for image

Make all files accessible to support arbitrary user ids running the docker image. There was an problem when trying to run this image on a openshift cluster which runs images in containers with arbitrary user ids (uid) by default.
Tom Stein 3 年之前
父節點
當前提交
f490e4e6c8
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Dockerfile

+ 5 - 1
Dockerfile

@@ -31,5 +31,9 @@ RUN apk add --no-cache bash
 # Make our shell script executable
 RUN chmod +x /app/build/env.sh
 
+# Make all files accessible such that the image supports arbitrary  user ids
+RUN chgrp -R 0 /app && \
+    chmod -R g=u /app
+
 # RUN echo -e window.__version="{\"version\":\""$VERSION"\"}" > /app/build/version.js
-CMD [ "/bin/bash", "-c", "/app/build/env.sh && yarn start:prod" ]
+CMD [ "/bin/bash", "-c", "/app/build/env.sh && yarn start:prod" ]