Skip to content

Commit dab5575

Browse files
fix(cdk): Run runsc during build time to create required directories
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 9853edb commit dab5575

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

devlog/2025-03-sandboxing-2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ The solution addresses these issues by:
5454

5555
3. Pre-creating a static config.json file with the `spec` command hardcoded
5656
4. Copying this file to the OCI bundle directory during build
57-
5. Simplifying the wrapper script to use the pre-created directories and files
57+
5. Executing runsc once during build time as root to create any additional required directories
58+
6. Simplifying the wrapper script to use the pre-created directories and files
5859

5960
## Testing Results
6061

docker/sandbox-poc/Dockerfile.gvisor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ RUN mkdir -p /var/run/oci-bundle/rootfs && \
2727
chmod -R 777 /run/runsc && \
2828
chmod -R 777 /tmp/runsc
2929

30+
# Run runsc once as root during build to create any additional required directories
31+
RUN cd /var/run/oci-bundle && \
32+
runsc -TESTONLY-unsafe-nonroot run --bundle=/var/run/oci-bundle container-init || true
33+
3034
# Copy the OCI config
3135
COPY scripts/oci-config.json /var/run/oci-bundle/config.json
3236

0 commit comments

Comments
 (0)