Resolve cyberchef and radicale images using nix-snapshotter

Increase inotify max user instances to 256
Disable tailscale by default
This commit is contained in:
Pim Kunis 2024-08-25 17:04:31 +02:00
parent 52efd614fe
commit e9899c0d0f
11 changed files with 129 additions and 81 deletions

View file

@ -30,12 +30,16 @@ in
let
images = {
cyberchef = {
cyberchef = {
image-name = "mpepping/cyberchef";
image-tag = "latest";
};
name = "mpepping/cyberchef";
tag = "latest";
};
radicale = {
name = "tomsquest/docker-radicale";
tag = "3.2.2.0";
};
};
imagesJSON = builtins.toFile "images.json" (builtins.toJSON images);
in
pkgs.writers.writePython3Bin "prefetch-container-images"
@ -55,31 +59,28 @@ in
with open(images_file_name, 'r') as file:
data = json.load(file)
for project_name, images in data.items():
print(f"Prefetching images for project {project_name}", file=sys.stderr)
for image_name, image in data.items():
name = image["name"]
tag = image["tag"]
for image_name, image in images.items():
name = image["image-name"]
tag = image["image-tag"]
print(f"Prefetching image {name}:{tag}", file=sys.stderr)
print(f"Prefetching image {name}:{tag}", file=sys.stderr)
prefetch_args = [
prefetch_docker_cmd,
"--os", "linux",
"--arch", "amd64",
"--image-name", name,
"--image-tag", tag,
"--json",
"--quiet"
]
result = subprocess.run(prefetch_args,
check=True,
capture_output=True,
text=True)
prefetch_args = [
prefetch_docker_cmd,
"--os", "linux",
"--arch", "amd64",
"--image-name", name,
"--image-tag", tag,
"--json",
"--quiet"
]
result = subprocess.run(prefetch_args,
check=True,
capture_output=True,
text=True)
prefetch_data = json.loads(result.stdout)
results[project_name][image_name] = prefetch_data
prefetch_data = json.loads(result.stdout)
results[image_name] = prefetch_data
with tempfile.NamedTemporaryFile(mode='w+', suffix='.json') as temp_file:
json.dump(results, temp_file, indent=4)