Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions A2_oci_package_repository/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out
56 changes: 56 additions & 0 deletions A2_oci_package_repository/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# OCI Images

Build an example of using OCI registry as a package manager for chainguard.

Related [81_oras](../81_oras/README.md)
Related [94_regctl](../94_regctl/README.md)

TODO:

* Build a volume containing lots of deb and apk files
* Build a base image
* Build a tarball

## Contents

- [OCI Images](#oci-images)
- [Contents](#contents)
- [Tarball](#tarball)
- [Create](#create)
- [Push](#push)
- [Resources](#resources)

## Tarball

Generate a bunch of files with leading zeros.

### Create

```sh
file="pkg"
extension="apk"
outpath="./out/packages/"
mkdir -p ${outpath}
for index in $(seq 0 10);
do
filepath=`printf %s%s%04d.%s ${outpath} ${file} ${index} ${extension}`
echo "Creating ${filepath}"
dd if=/dev/urandom of=$filepath bs=1024 count=1
#touch $filepath
sleep 1
done

tar -czvf ./out/packages.tar.gz ./out/packages/
tar -tf ./out/packages.tar.gz
ll -a ./out/packages.tar.gz
```

### Push

```sh
./bins/regctl-darwin-amd64 artifact put registry-1.docker.io/chrisguest/demo --file ./README.md --artifact-type application/vnd.oci.readme.md
```


## Resources

3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ https://www.andreafortuna.org/2019/11/26/cve-2019-14271-a-docker-cp-container-es
1. https://adamo.wordpress.com/2022/05/05/removing-all-containers-via-ssh/ ssh remote_user@remote_host "docker ps -a -q|xargs -n 1 docker rm -f "
1. https://github.com/google/gvisor
2. https://github.com/tonistiigi/binfmt - docker desktop supports it
1. https://github.com/jwilder/dockerize
1. https://github.com/jwilder/dockerize
2. https://docs.docker.com/build/exporters/oci-docker/