Another attempt to fix this. Changes from previous iteration:
use string.rfind('/') to extract folder instead of os.path.dirname
join RUN commands
Disclaimer, I've not been able to test this on Windows.
If mkdir should not be used, this is a WORKDIR solution:
FROM tiltdev/restart-helper:2021-11-03 as restart-helper
- FROM {ref}
+ FROM {ref} as workdir
+ WORKDIR "{folder}"
RUN ["touch", "{file}"]
RUN ["chmod", "666", "{file}"]
+
+ FROM {ref}
+ COPY --from=workdir "{file}" "{file}"
COPY --from=restart-helper /tilt-restart-wrapper /
COPY --from=restart-helper /entr /
Sometimes the container root filesystem has sticky bit enabled and restart commands are ran with a different user. We can work around that by creating an intermediate folder that has "0777" permissions.
The folder name is parsed with string.rfind because os.path.dirname won't work on Windows.
Another attempt to fix this. Changes from previous iteration:
Disclaimer, I've not been able to test this on Windows.
If
mkdir
should not be used, this is a WORKDIR solution:Sometimes the container root filesystem has sticky bit enabled and restart commands are ran with a different user. We can work around that by creating an intermediate folder that has "0777" permissions.
The folder name is parsed with
string.rfind
because os.path.dirname won't work on Windows.Refs #540