From c2d2e914b635f4563763864734b8d484191a3ef3 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Wed, 16 Jan 2019 10:46:45 -0800 Subject: [PATCH] double typo (#96) * final tweak * final tweak2 * typos for days --- Dockerfile | 6 +----- Dockerfile.arm64 | 2 +- manifest_generator.py | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 manifest_generator.py diff --git a/Dockerfile b/Dockerfile index 5b0194b..04e8806 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,7 @@ ENV DEBUG="False" COPY / /app -RUN \ - python3 -m pip install -r /app/requirements.txt && \ - chown -R abc:abc \ - /config \ - /app +RUN python3 -m pip install -r /app/requirements.txt WORKDIR /app diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 28f1c42..5922d9a 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -6,7 +6,7 @@ ENV DEBUG="False" COPY / /app -COPY /tmp/qemu-arm-static /usr/bin/qemu-aarch64-static +COPY /tmp/qemu-aarch64-static /usr/bin/qemu-aarch64-static RUN python3 -m pip install -r /app/requirements.txt diff --git a/manifest_generator.py b/manifest_generator.py new file mode 100644 index 0000000..db200db --- /dev/null +++ b/manifest_generator.py @@ -0,0 +1,37 @@ +import yaml + +from varken import VERSION + +org = 'boerderij' +project = 'varken' +namespace = f"{org}/{project}" + +yaml_arr = [] +tags = ['latest', VERSION] + +# Docker image, arch, variant, os +arch_list = [('arm', 'arm', 'v6', 'linux'), + ('armhf', 'arm', 'v7', 'linux'), + ('arm64', 'arm64', 'v8', 'linux'), + ('amd64', 'amd64', None, 'linux')] + +for tag in tags: + yaml_doc = { + 'image': f'{namespace}:{tag}', + 'manifests': [] + } + for arch in arch_list: + info = { + 'image': f"{namespace}:{tag}-{arch[0]}", + 'platform': { + 'architecture': arch[1], + 'os': arch[3] + } + } + if arch[2]: + info['platform']['variant'] = arch[2] + yaml_doc['manifests'].append(info) + yaml_arr.append(yaml_doc) + +with open(f".manifest.yaml", 'w') as file: + yaml.dump_all(yaml_arr, file, default_flow_style=False)