diff --git a/A2_oci_package_repository/.gitignore b/A2_oci_package_repository/.gitignore new file mode 100644 index 0000000..1fcb152 --- /dev/null +++ b/A2_oci_package_repository/.gitignore @@ -0,0 +1 @@ +out diff --git a/A2_oci_package_repository/README.md b/A2_oci_package_repository/README.md new file mode 100644 index 0000000..0529e35 --- /dev/null +++ b/A2_oci_package_repository/README.md @@ -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 + diff --git a/TODO.md b/TODO.md index 8c8f958..4076bd4 100644 --- a/TODO.md +++ b/TODO.md @@ -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 \ No newline at end of file +1. https://github.com/jwilder/dockerize +2. https://docs.docker.com/build/exporters/oci-docker/ \ No newline at end of file