diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-06-06 22:28:49 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-06-09 00:30:12 -0700 |
commit | ff95b980d4913e90bc334227f8f3f7b3daf18b36 (patch) | |
tree | 08799eda970630ea1cc59142698fa99068db8fc6 /releng/docker.xsh | |
parent | 98e847514795f53f485b6dbd029ecb545ce38236 (diff) |
Implement docker upload in the releng tools
This uses skopeo to not think about docker daemons. I, however, noticed
that the docker image we had would have totally terrible cache hits, so
I rewrote it.
Fixes: https://git.lix.systems/lix-project/lix/issues/252
Change-Id: I3c5b6c1f3ba0b9dfcac212b2148f390e0cd542b7
Diffstat (limited to 'releng/docker.xsh')
-rw-r--r-- | releng/docker.xsh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/releng/docker.xsh b/releng/docker.xsh new file mode 100644 index 000000000..1ed2330cf --- /dev/null +++ b/releng/docker.xsh @@ -0,0 +1,13 @@ +from .environment import DockerTarget, RelengEnvironment +from .version import VERSION +from pathlib import Path + +def check_all_logins(env: RelengEnvironment): + for target in env.docker_targets: + check_login(target) + +def check_login(target: DockerTarget): + skopeo login @(target.registry_name()) + +def upload_docker_image(target: DockerTarget, path: Path): + skopeo --insecure-policy copy docker-archive:@(path) docker://@(target.resolve(version=VERSION)) |