bazel-contrib / bazel-contrib/rules_oci
Support apple/container container runtime
- Dominant language
- Starlark
- Stars
- 423
- Forks
- 213
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
While on v2.2.6, I tried patch rules_oci to use `container` CLI (from https://github.com/apple/container) to load a tarball.
```patch
--- oci/private/load.sh.tpl
+++ oci/private/load.sh.tpl
@@ -16,2 +16,4 @@
-elif command -v podman &> /dev/null; then
- CONTAINER_CLI="podman"
+elif command -v podman &> /dev/null; then
+ CONTAINER_CLI="podman"
+elif command -v container &> /dev/null; then
+ CONTAINER_CLI="container"
@@ -31,1 +31,1 @@
-"$CONTAINER_CLI" load --input <(
+"$CONTAINER_CLI" image load --input <(
```
The output path for oci_load target was `bazel-bin/helloworld/bin/app_load.sh`.
Running `bazel run //helloworld/bin:app_load` yielded an error:
```
Error: unknown: "Error Domain=NSCocoaErrorDomain Code=512 "The file “63” couldn’t be saved in the folder “fd”." UserInfo={NSFilePath=/dev/fd/63, NSUnderlyingError=0xa4c4101b0 {Error Domain=NSPOSIXErrorDomain Code=9 "Bad file descriptor"}}"
tar: Write error
```
Contributor guide
Research direction
Start with oci/private/load.sh.tpl and the generated bazel-bin/helloworld/bin/app_load.sh, then run bazel run //helloworld/bin:app_load using the container CLI. Compare the process-substitution input and image load invocation with the reported /dev/fd/63 error; done means the oci_load target loads the tarball successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100