Skip to content

Commit bf991fd

Browse files
committed
Add soci standalone convert docs
Signed-off-by: Praful Gupta <prafulgupta6@gmail.com>
1 parent da56669 commit bf991fd

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

docs/cli-usage.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This command creates a new SOCI-enabled image that packages the original image a
5454
> [!NOTE]
5555
> SOCI Index Manifest v2 is the recommended approach for production deployments as it provides immutable binding between the image and SOCI index, preventing runtime behavior changes.
5656
57-
Usage: ```soci convert [flags] <source_image_ref> <dest_image_ref> ```
57+
Usage: ```soci convert [flags] <source> <dest> ```
5858

5959
Flags:
6060

@@ -64,6 +64,8 @@ Flags:
6464
- `xattr` : When true, adds DisableXAttrs annotation to SOCI index. This annotation often helps performance at pull time.
6565
- ```--all-platforms``` : Convert all platforms of a multi-platform image
6666
- ```--platform``` : Convert only the specified platform (e.g., linux/amd64)
67+
- ```--standalone``` : Run in standalone mode without a containerd runtime. Reads an OCI image layout (tar or directory) from disk and writes a converted OCI image layout without requiring a running containerd instance. See [Standalone mode](#standalone-mode) below.
68+
- ```--format``` : Output format for standalone mode: ```oci-archive``` (tar, default) or ```oci-dir``` (directory). Only used with ```--standalone```.
6769

6870
**Example:**
6971
```
@@ -75,6 +77,31 @@ soci convert public.ecr.aws/soci-workshop-examples/ffmpeg:latest public.ecr.aws/
7577
soci convert --all-platforms public.ecr.aws/soci-workshop-examples/ffmpeg:latest public.ecr.aws/soci-workshop-examples/ffmpeg:latest-soci
7678
```
7779

80+
#### Standalone mode
81+
82+
Standalone mode enables SOCI conversion without a running containerd daemon. This is useful in CI/CD pipelines and other environments where containerd is unavailable or running it would require privileged access.
83+
84+
In standalone mode, ```<source>``` and ```<dest>``` are file paths (not image references). The source can be an OCI image layout tar archive or directory. The output format is controlled by the ```--format``` flag.
85+
86+
Standalone mode does not require containerd, sudo, or any other daemon. You can use tools like [skopeo](https://github.com/containers/skopeo) or [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane) to download and push images.
87+
88+
> [!NOTE]
89+
> The input tar or directory must be in **OCI image layout** format. Docker-style tarballs (e.g., from `docker save` or `crane pull` without `--format oci`) are not compatible.
90+
91+
**Tar output format workflow** (using skopeo):
92+
```shell
93+
skopeo copy docker://public.ecr.aws/soci-workshop-examples/ffmpeg:latest oci-archive:ffmpeg.tar
94+
soci convert --standalone ffmpeg.tar ffmpeg-soci.tar
95+
skopeo copy oci-archive:ffmpeg-soci.tar docker://public.ecr.aws/soci-workshop-examples/ffmpeg:latest-soci
96+
```
97+
98+
**Directory output format workflow** (using skopeo):
99+
```shell
100+
skopeo copy docker://public.ecr.aws/soci-workshop-examples/ffmpeg:latest oci:ffmpeg-oci
101+
soci convert --standalone --format oci-dir ffmpeg-oci ffmpeg-soci-oci
102+
skopeo copy oci:ffmpeg-soci-oci docker://public.ecr.aws/soci-workshop-examples/ffmpeg:latest-soci
103+
```
104+
78105
### soci push
79106
Push SOCI artifacts to a registry by image reference (SOCI Index Manifest v1 only)
80107

docs/getting-started.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ sudo soci convert docker.io/library/rabbitmq:latest $REGISTRY/rabbitmq:latest
102102
sudo nerdctl push $REGISTRY/rabbitmq:latest
103103
```
104104

105+
> **Note**
106+
> If containerd is not available (e.g., in CI/CD pipelines), you can use `soci convert --standalone` to convert OCI image layouts on disk without a running containerd instance. See the [CLI usage documentation](./cli-usage.md#standalone-mode) for details.
107+
105108
After this step, please check your registry to confirm the image and SOCI index are present.
106109
You can go to your registry console or use your registry's CLI (e.g. for ECR, you
107110
can use `aws ecr describe-images --repository-name rabbitmq --region $AWS_REGION`).

docs/soci-index-manifest-v2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ sudo nerdctl pull --snapshotter soci \
3838

3939
See [the getting started guide](./getting-started.md) for more information.
4040

41+
> **Note**
42+
> If containerd is not available (e.g., in CI/CD pipelines), you can use `soci convert --standalone` to convert OCI image layouts on disk without a running containerd instance. See the [CLI usage documentation](./cli-usage.md#standalone-mode) for details.
43+
4144
## Continuing to Use SOCI Index Manifest v1
4245

4346
There are some use-cases where the dynamic nature of SOCI Index Manifest v1 adds significant value. For those users, SOCI Index Manifest v1 is still available in the SOCI snapshotter; however, it is disabled by default. By re-enabling it, you should be aware that adding a SOCI index to an existing image can change the runtime characteristics of the image. We strongly recommend that you migrate to SOCI-enabled images and SOCI Index Manifest V2 which immutably binds a SOCI index to a new image and allows you to manage changes to your production workloads through deployments, just like you would for any other change.

0 commit comments

Comments
 (0)