diff options
Diffstat (limited to 'libre/docker/Makefile')
-rwxr-xr-x | libre/docker/Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libre/docker/Makefile b/libre/docker/Makefile new file mode 100755 index 000000000..61c2b4041 --- /dev/null +++ b/libre/docker/Makefile @@ -0,0 +1,35 @@ +# Copyright (C) 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> +# This program is free software: you can redistribute it and/or modify +# it under the terms of the CC0 1.0 License. +# Maintainer: Parabola Hackers <dev@lists.parabola.nu> + +# This test requires network access, so we can't add it in the +# PKGBUILD itself as requiring network access for packages builds is +# very strongly discouraged. + +PKGVER ?= `makepkg --printsrcinfo | grep pkgver | awk '{print $$3}'` +PKGREL ?= `makepkg --printsrcinfo | grep pkgrel | awk '{print $$3}'` +ARCH ?= x86_64 +PACKAGE ?= docker-1:$(PKGVER)-$(PKGREL)-$(ARCH).pkg.tar.xz + +check: + set -e + rm -rf pkg/ src/ + makepkg -f + sudo pacman -U $(PACKAGE) --noconfirm + + # We need to (re)start the docker daemon for the changes to be + # taken into account. + sudo systemctl daemon-reload + sudo systemctl restart docker + + # This should fail if the registry has been changed and that + # no registry runs on localhost:5000 + sudo bash -c '! docker run -it --rm pureos/byzantium bash -c "echo hello world"' + + # This should work as we don't want to prevent users from + # using images from docker.io. + sudo docker run -it --rm registry-1.docker.io/pureos/byzantium bash -c "echo hello world" + + # Here this should work but currently fails. + # sudo docker run -it --rm docker.io/pureos/byzantium bash -c "echo hello world" |