knative/func

func build failing for new installation

harshguptaserver opened this issue · 13 comments

Hello Func Team,

I am new to the community, your docs on installing knative is really well done!! Thank you.

Today, I installed the func cli and was trying to build a function (python) and got the error, even after repeating the build command the error exists.

Please node:

  • i am using podman as the build runtime
  • i am not using docker for register, for testing purposes i'm using canister as the registy.
    Here is the build log with the error:
~/tmp/knative_demo/01_hello_world/hello$ func build
? Registry for function images: cloud.canister.io/harshguptaserver/knative-faas-01-hello
Note: building a function the first time will take longer than subsequent builds
Building function image

2024/02/19 21:42:52.392482 DEBUG:  Pulling image ghcr.io/knative/builder-jammy-base:latest
673ee169339f: Already exists
69711f62c869: Already exists
c501d664298a: Already exists
7591c822bc83: Already exists
557a403a0ea9: Already exists
e46b3adeadf6: Already exists
4f390857cb83: Already exists
961f03ec1d7c: Already exists
3e1a492b5035: Already exists
9d292c7281e7: Already exists
48248d4270b0: Already exists
f20918bf85c8: Already exists
6c739858b3fc: Already exists
eec1ad103cd8: Already exists
68d2b4c377ad: Already exists
faf8745a9c0d: Already exists
4d1d6346fbeb: Already exists
d57f9e879fdf: Already exists
519298f87b78: Already exists
cade89328bc3: Already exists
29195fe905d9: Already exists
3e6bcfdc717e: Already exists
0f2fa577ea03: Already exists
2aed0e48796a: Already exists
11d2f30f0e5d: Already exists
2a70484b2fdc: Already exists
d8788782fbb2: Already exists
d66d6a6a3687: Already exists
fe469f015234: Already exists
4a4392e8c3e6: Already exists
890688e46f12: Already exists
c565dd7e3743: Already exists
9fd46cafacf9: Already exists
97d56310aaf6: Already exists
ffa6d15a818a: Already exists
8605326316d4: Already exists
f38b227d13da: Already exists
e3b33aa2f0de: Already exists
b97680bef7f0: Already exists
837a9b6010d8: Already exists
06d1dccbd831: Already exists
d893b6658e00: Already exists
44e988ff1c06: Already exists
9736106b3282: Already exists
9fbb15cfc993: Already exists
3d56dc524b2c: Already exists
ec33496306e6: Already exists
cc4efe94e0be: Already exists
a7fac868f048: Already exists
671b4310f322: Already exists
56bc22364572: Already exists
008b4a8c21ec: Already exists
a50795cbc73d: Already exists
1375e7a75611: Already exists
077478b0aa9c: Already exists
e44cdb8d8fa2: Already exists
c707a1f02ab8: Already exists
0d615b2769dc: Already exists
7e3080792e67: Already exists
058c03a891ba: Already exists
97831b21ba0d: Already exists
0d9aefc1bd83: Already exists
2bdb0cef05ff: Already exists
ec3e4b65b3f2: Already exists
759afc59cd05: Already exists
4617cfc1d8f5: Already exists
d6cd7e9abed5: Already exists
124c51c62cdc: Already exists
82d9079bc8db: Already exists
21a3acc5db3b: Already exists
6ba372240e44: Already exists
394263f64d17: Already exists
9e6b5fc76a04: Already exists
780c495940aa: Already exists
3f798b9f4c9c: Already exists
9763458f3e23: Already exists
ad5e7540b57e: Already exists
d7fc754e347d: Already exists
70c04d8c34cc: Already exists
31be819b2644: Already exists
343f7ca48976: Already exists
dc08dba03b61: Already exists
afd6e9a5bc1b: Already exists
779573a7c701: Already exists
f8ec9f186e6e: Already exists
367f9519e2c3: Already exists
ad4c83fe4a77: Already exists
e6c37a2281bd: Already exists
c98fa41a7189: Already exists
f122da836e53: Already exists
32adedb7e136: Already exists
732891a632ee: Already exists
29a7844508b3: Already exists
63dbd1deb6ae: Already exists
e879b0c77169: Already exists
44de89a4970e: Already exists
d80244ccb3ff: Already exists
4f4fb700ef54: Already exists
916cec4c066b: Already exists
024e82365d2f: Pulling fs layer
024e82365d2f: Download complete
024e82365d2f: Download complete
2024/02/19 21:42:54.535889 DEBUG:  Selected run image index.docker.io/paketobuildpacks/run-jammy-base:latest
2024/02/19 21:42:54.535899 DEBUG:  Pulling image index.docker.io/paketobuildpacks/run-jammy-base:latest

Error: failed to build the function: invalid run-image 'index.docker.io/paketobuildpacks/run-jammy-base:latest': Error response from daemon: failed to resolve image name: short-name "paketobuildpacks/run-jammy-base:latest" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"

Also

~/tmp/knative_demo/01_hello_world/hello$ func version
v0.39.0-1-g4b6247d0

@harshguptaserver This is matter of podman configuration, not func.

Just put unqualified-search-registries = ["index.docker.io"] into ~/.config/containers/registries.conf.
It will also help with another issues that you would encounter in future.

To explain. The docker/moby evaluates paketobuildpacks/run-jammy-base:latest => index.docker.io/paketobuildpacks/run-jammy-base:latest. The podman does not do that for security concerns. If you want podman to behave more like docker for compatibility reasons you need to set unqualified-search-registries.

@harshguptaserver do you use podman-desktop?

What version of podman do you use?

I cannot reproduce this issue, even thought I tried to disable unqualified-search-registries.

@harshguptaserver could you please provide more information?

@matejvasek ; apologies for the delay in response due to time-zone differences.

I am using podman in pop-os. Here is the output of podman version

 podman --version
podman version 3.4.4

I installed podman using apt, I'm not aware of podman-desktop. My reason behind using podman is to try to move away from docker as it is very tightly integrated with docker-hub. Please let me know if any more information is required. I'll also try to follow the config changes steps you have mentioned above and update here.

Thank you for the quick reply and the detailed explanation.

3.4.4 sounds quite old I would consider updating.

It's from Dec 8, 2021.

apt install podman has the latest version as 3.4.4 only.

Tried looking at podman website, steps to install from their github release doesn't exist :-( so cannot upgrade podman to newer versions ( ubuntu based os popos ) they i.e. podman do not specify the steps to install from linux binary

Your recommendation of using

Just put unqualified-search-registries = ["index.docker.io"] into ~/.config/containers/registries.conf.

fixed the build issue, thanks :-)

Wait that won't work, it does require podman itself.