`awk` and `jq` not found.

When running bluebuild build ./recipes/recipe.yml locally, I get the following error:
l/morrigan:latest => 0.075 /tmp/scripts/exports.sh: line 48: awk: command not found
l/morrigan:latest => 0.078 /tmp/scripts/run_module.sh: line 55: jq: command not found
l/morrigan:latest => ------
l/morrigan:latest => Containerfile:49
l/morrigan:latest => --------------------
l/morrigan:latest => 48 | # Module RUNs
l/morrigan:latest => 49 | >>> RUN \
l/morrigan:latest => 50 | >>> --mount=type=bind,from=stage-files,src=/files,dst=/tmp/files,rw \
l/morrigan:latest => 51 | >>> --mount=type=bind,from=ghcr.io/blue-build/modules/script:latest,src=/modules,dst=/tmp/modules,rw \
l/morrigan:latest => 52 | >>> --mount=type=bind,from=ghcr.io/blue-build/cli/build-scripts:v0.9.10,src=/scripts/,dst=/tmp/scripts/ \
l/morrigan:latest => 53 | >>> /tmp/scripts/run_module.sh 'script' '{"type":"script","scripts":["installdock.sh"]}'
l/morrigan:latest => 54 |
l/morrigan:latest => --------------------
l/morrigan:latest => ERROR: failed to solve: process "bash -c /tmp/scripts/run_module.sh 'script' '{\"type\":\"script\",\"scripts\":[\"installdock.sh\"]}'" did not complete successfully: exit code: 127
l/morrigan:latest => 0.075 /tmp/scripts/exports.sh: line 48: awk: command not found
l/morrigan:latest => 0.078 /tmp/scripts/run_module.sh: line 55: jq: command not found
l/morrigan:latest => ------
l/morrigan:latest => Containerfile:49
l/morrigan:latest => --------------------
l/morrigan:latest => 48 | # Module RUNs
l/morrigan:latest => 49 | >>> RUN \
l/morrigan:latest => 50 | >>> --mount=type=bind,from=stage-files,src=/files,dst=/tmp/files,rw \
l/morrigan:latest => 51 | >>> --mount=type=bind,from=ghcr.io/blue-build/modules/script:latest,src=/modules,dst=/tmp/modules,rw \
l/morrigan:latest => 52 | >>> --mount=type=bind,from=ghcr.io/blue-build/cli/build-scripts:v0.9.10,src=/scripts/,dst=/tmp/scripts/ \
l/morrigan:latest => 53 | >>> /tmp/scripts/run_module.sh 'script' '{"type":"script","scripts":["installdock.sh"]}'
l/morrigan:latest => 54 |
l/morrigan:latest => --------------------
l/morrigan:latest => ERROR: failed to solve: process "bash -c /tmp/scripts/run_module.sh 'script' '{\"type\":\"script\",\"scripts\":[\"installdock.sh\"]}'" did not complete successfully: exit code: 127
My CI build fails for the same reason: https://github.com/AbooMinister25/morrigan/actions/runs/14477719246/job/40607276868. It had just worked a few moments ago when I ran the build, but when I try to run the build again (without anything changing), it seems to have broken. Any idea why?
5 Replies
Luke Skywunker
Interestingly the setup script couldn't detect the OS for that stage
[19:27:36 g.i/a/morrigan:latest] => #52 [nwg-dock 3/4] RUN --mount=type=bind,from=stage-bins,src=/bins/,dst=/tmp/bins/ --mount=type=bind,from=ghcr.io/blue-build/cli/build-scripts:80a768cc49bd7f16a443ef000b0382610c4af32f,src=/scripts/,dst=/tmp/scripts/ /tmp/scripts/setup.sh
[19:27:36 g.i/a/morrigan:latest] => #52 0.069 OS not detected, proceeding without setup
[19:27:36 g.i/a/morrigan:latest] => #52 0.069 /tmp/scripts/setup.sh: line 4: awk: command not found
[19:27:36 g.i/a/morrigan:latest] => #52 DONE 0.2s
[19:27:36 g.i/a/morrigan:latest] => #52 [nwg-dock 3/4] RUN --mount=type=bind,from=stage-bins,src=/bins/,dst=/tmp/bins/ --mount=type=bind,from=ghcr.io/blue-build/cli/build-scripts:80a768cc49bd7f16a443ef000b0382610c4af32f,src=/scripts/,dst=/tmp/scripts/ /tmp/scripts/setup.sh
[19:27:36 g.i/a/morrigan:latest] => #52 0.069 OS not detected, proceeding without setup
[19:27:36 g.i/a/morrigan:latest] => #52 0.069 /tmp/scripts/setup.sh: line 4: awk: command not found
[19:27:36 g.i/a/morrigan:latest] => #52 DONE 0.2s
It appears that stage is using the fedora image
[19:27:32 g.i/a/morrigan:latest] => #49 [nwg-dock 1/4] FROM docker.io/library/fedora:latest@sha256:ee88ab8a5c8bf78687ddcecadf824767e845adc19d8cdedb56f48521eb162b43
[19:27:32 g.i/a/morrigan:latest] => #49 [nwg-dock 1/4] FROM docker.io/library/fedora:latest@sha256:ee88ab8a5c8bf78687ddcecadf824767e845adc19d8cdedb56f48521eb162b43
That script is pretty small too
#!/bin/sh

if [ -f /etc/os-release ]; then
export ID="$(awk -F= '/^ID=/ {gsub(/"/, "", $2); print $2}' /etc/os-release)"

if [ "$ID" = "alpine" ]; then
echo "Setting up Alpine based image to run BlueBuild modules"
apk update
apk add --no-cache bash curl coreutils wget grep jq
elif [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
echo "Setting up Ubuntu based image to run BlueBuild modules"
apt-get update
apt-get install -y bash curl coreutils wget jq
elif [ "$ID" = "fedora" ]; then
echo "Settig up Fedora based image to run BlueBuild modules"
dnf install -y --refresh bash curl wget coreutils jq
else
echo "OS not detected, proceeding without setup"
fi
fi
#!/bin/sh

if [ -f /etc/os-release ]; then
export ID="$(awk -F= '/^ID=/ {gsub(/"/, "", $2); print $2}' /etc/os-release)"

if [ "$ID" = "alpine" ]; then
echo "Setting up Alpine based image to run BlueBuild modules"
apk update
apk add --no-cache bash curl coreutils wget grep jq
elif [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
echo "Setting up Ubuntu based image to run BlueBuild modules"
apt-get update
apt-get install -y bash curl coreutils wget jq
elif [ "$ID" = "fedora" ]; then
echo "Settig up Fedora based image to run BlueBuild modules"
dnf install -y --refresh bash curl wget coreutils jq
else
echo "OS not detected, proceeding without setup"
fi
fi
So the /etc/os-release of the image doesn't appear to have the correct info OH! The image itself doesn't have awk Well... That's a flaw I'll have to try to fix I'm pushing out a patch for this
fiftydinar
fiftydinar2w ago
wayblue has awk, weird
Luke Skywunker
I ended up going with a sh built-in solution to get that information instead so we don't have to worry about external deps
aboo
abooOP2w ago
hmm so this was a bug? the weird part is this was working just fine earlier today, and I don't believe I changed anything (for what it's worth, the base image was wayblue) and thank you for the quick solution :)

Did you find this page helpful?