From 6f0834519ed97c3127f56028d67e9326e04846b7 Mon Sep 17 00:00:00 2001 From: Patrick MARIE Date: Fri, 22 Mar 2024 15:51:40 +0100 Subject: [PATCH] Adding a POC for basic OCI images --- poc-oci/check.sh | 14 ++++++++++++++ poc-oci/default.nix | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 poc-oci/check.sh create mode 100644 poc-oci/default.nix diff --git a/poc-oci/check.sh b/poc-oci/check.sh new file mode 100644 index 0000000..fcd478b --- /dev/null +++ b/poc-oci/check.sh @@ -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}" \ No newline at end of file diff --git a/poc-oci/default.nix b/poc-oci/default.nix new file mode 100644 index 0000000..d4cbc73 --- /dev/null +++ b/poc-oci/default.nix @@ -0,0 +1,17 @@ +{ + pkgs ? import {}, +}: +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 + ''; + }