summaryrefslogtreecommitdiff
path: root/libre/docker/Makefile
blob: 61c2b40413ccddd96994ea1770800fe477f85873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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"