Adding a POC for basic OCI images

This commit is contained in:
Patrick MARIE 2024-03-22 15:51:40 +01:00
parent 37c49982f5
commit 6f0834519e
2 changed files with 31 additions and 0 deletions

14
poc-oci/check.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
nix build -f default.nix
ls -l
sh result > oci
IMGID=$(podman load < oci 2>&1 | tail -1 | awk '{ print $3 }')
rm -f oci result
echo
echo ${IMGID}
echo "dive podman://${IMGID}"

17
poc-oci/default.nix Normal file
View File

@ -0,0 +1,17 @@
{
pkgs ? import <nixpkgs> {},
}:
let
manifests = pkgs.writeText "bla" ''
here be dragons
'';
in
pkgs.dockerTools.streamLayeredImage {
name = "blah";
includeStorePaths = false;
fakeRootCommands = ''
cp -Lr ${manifests} my-text-file
cat my-text-file
rm -fr nix
'';
}