Skip to content

Commit 6fb264e

Browse files
rnavmpe
authored andcommitted
Fix detection of pulled images
While docker can pull images when prefixed with the registry url, it doesn't include the registry names in the local image repository. Due to this, trying to detect if an image is present in the local repository fails causing us to try and build the image again: $ make SRC=~/linux kernel@ppc64le@fedora@34 + docker images -q --filter=reference=docker.io/linuxppc/build:fedora-34 + docker build --pull -f fedora/Dockerfile ... <snip> Fix this by only appending the registry url for podman.
1 parent 11ce78d commit 6fb264e

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

build/scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if [[ -z "$version" ]]; then
151151
version=$(get_default_version $distro)
152152
fi
153153

154-
image="docker.io/linuxppc/build:$distro-$version"
154+
image="${DOCKER_REGISTRY}linuxppc/build:$distro-$version"
155155

156156
cmd+="$image "
157157
cmd+="/bin/container-build.sh $task"

build/scripts/image.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [[ -z "$version" ]]; then
1515
version=$(get_default_version $distro)
1616
fi
1717

18-
image="docker.io/linuxppc/build:$distro-$version"
18+
image="${DOCKER_REGISTRY}linuxppc/build:$distro-$version"
1919

2020
if [[ "$task" == "image" ]]; then
2121
cmd="$DOCKER images -q --filter=reference=$image"
@@ -68,10 +68,10 @@ if [[ -z "$GID" ]]; then
6868
GID=$(id -g)
6969
fi
7070

71-
from="docker.io/$distro:$version"
71+
from="${DOCKER_REGISTRY}$distro:$version"
7272

7373
if [[ "$distro" == "docs" ]]; then
74-
from="docker.io/ubuntu:$version"
74+
from="${DOCKER_REGISTRY}ubuntu:$version"
7575
elif [[ "$distro" == "korg" ]]; then
7676
cmd+="--build-arg compiler_version=$version "
7777

@@ -82,9 +82,9 @@ elif [[ "$distro" == "korg" ]]; then
8282

8383
# Use an older distro for the 5.x toolchains.
8484
if [[ "$version" == 5.* ]]; then
85-
from="docker.io/ubuntu:16.04"
85+
from="${DOCKER_REGISTRY}ubuntu:16.04"
8686
else
87-
from="docker.io/ubuntu:20.04"
87+
from="${DOCKER_REGISTRY}ubuntu:20.04"
8888
fi
8989
fi
9090

build/scripts/lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ function get_default_version()
9898

9999
DOCKER="docker"
100100
PODMAN_OPTS=""
101+
DOCKER_REGISTRY=""
101102
if command -v podman > /dev/null; then
102103
if (command -v docker && docker --version | grep -q podman) > /dev/null || ! command -v docker > /dev/null; then
103104
DOCKER="podman"
104105
PODMAN_OPTS="--security-opt label=disable --userns=keep-id"
106+
DOCKER_REGISTRY="docker.io/"
105107
fi
106108
fi

0 commit comments

Comments
 (0)