s3-oci
is a lightweight server that mimics the Amazon S3 API while using OCI images as the storage backend. This allows S3-compatible tools (like the AWS CLI) to read from and write to container registries as if they were object storage buckets.
Make sure you have Go installed, have a valid registry ready (e.g. ghcr.io with a token with write:packages scope together with your github user), then start the server:
export YOUR_GITHUB_USER=jakobmoellerdev
go run ./... \
--credentials.username ${YOUR_GITHUB_USER} \
--credentials.password $(gh auth token) \
--prefix ${YOUR_GITHUB_USER}/oci/s3/ \
--registry ghcr.io
--credentials.*
: Registry credentials for authentication.--prefix
: Path prefix used in the target OCI registry (e.g.ghcr.io/jakobmoellerdev/oci/s3/
).
Use a custom profile to interact with your server:
Set the following values:
aws configure set region us-east-1 --profile s3-oci
aws configure set aws_access_key_id MY_ACCESS --profile s3-oci
aws configure set aws_secret_access_key MY_SECRET --profile s3-oci
aws configure set endpoint_url http://localhost:9000 --profile s3-oci
Note: Replace
MY_ACCESS
andMY_SECRET
with the credentials you used to start the server. The values here are placeholder and need to be aligned with config.yaml contents.
You can now use standard S3 commands to interact with the server:
# Set the AWS profile to use, we just configured this!
export AWS_PROFILE=s3-oci
# Create a bucket
aws s3api create-bucket --bucket mybucket
# Upload a file
echo "foobar" | aws s3 cp - s3://mybucket/hello.txt
# Download and print the file
aws s3 cp s3://mybucket/hello.txt -
# Output: foobar
- Store versioned artifacts in OCI registries using familiar S3 tooling.
- Integrate with CI/CD pipelines using
aws s3
commands. - Bridge tools that require S3 but need to work with OCI-native formats.
This project is experimental. Expect API changes and contribute with feedback!