0

I have a strange problem with podman. I have a large Dockerfile of an open source project called spilo that I was always able to build. Today for some strange reason the same code doesn't work anymore. It's true that I haven't used podman for a month but today I got a strange problem. To simplify the error I created a simple Dockerfile just to show you the problem:

ARG BASE_IMAGE=ubuntu:18.04
ARG PGVERSION=14
ARG COMPRESS=false

FROM $BASE_IMAGE as builder-false

RUN apt-get update; apt-get install -y pgbackrest

FROM scratch as builder-true
COPY --from=builder-false / /

FROM builder-${COMPRESS}

Now if I run:

podman build . -t prova:latest

I got the following error:

[3/3] STEP 1/1: FROM builder-false
Resolving "builder-false" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/library/builder-false:latest...
Error: error creating build container: initializing source docker://builder-false:latest: reading manifest latest in docker.io/library/builder-false: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

It seems it try to search the builder-false image from docker.io repository instead try to build it from the row above. The steps to create the builder-false are not executed.

Can anyone help me to address this issue? The original spilo project Dockerfile always worked. I reinstalled the podman VM but no luck. I also restarted the Mac, no luck.

Salvatore D'angelo
  • 1,019
  • 3
  • 14
  • 39

1 Answers1

0

I think there is a bug somewhere in dependencies of pgbackrest. I got this on my podman (centos 8) executing RUN apt-get install -y pgbackrest:

chfn: PAM: System error
adduser: `/usr/bin/chfn -f PostgreSQL administrator postgres' returned error code 1. Exiting.
dpkg: error processing package postgresql-common (--configure):
 installed postgresql-common package post-installation script subprocess returned error exit status 1

With docker works fine.

Slava Kuravsky
  • 2,702
  • 10
  • 16
  • This is another problem. I was able to build the file above replacing ```FROM builder-${COMPRESS}``` with ```FROM builder-false``` for some strange reason the variable substitution just don't work. The file above is just an example, you can replace pgbackrest with whatever package you want. Now it's not clear to me why the variable replacement doesn't work. – Salvatore D'angelo Sep 30 '22 at 10:49
  • Replaced with wget, everything worked at the end. The variable substitution works by you, otherwise it has not constructed "builder-false". I suppose the real problem somewhere in previous steps of your build run. – Slava Kuravsky Sep 30 '22 at 10:57
  • Yes, I agree. For some strange reason the variable substitution here works: ```FROM $BASE_IMAGE as builder-false```; otherwise, as you said it wouldn't have built the builder-false image. Here not: ```FROM builder-${COMPRESS}```. Another strange thing is that the spilo project built successfully on my coworker Mac. So I expect there is something wrong in podman configuration. Any idea? – Salvatore D'angelo Sep 30 '22 at 11:00
  • compare "podman info" – Slava Kuravsky Sep 30 '22 at 11:02
  • In the large spilo project I was able to build it replacing: ```FROM builder-${COMPRESS}``` with ```FROM builder-false``` I really don't understand this. – Salvatore D'angelo Sep 30 '22 at 11:02
  • Now also on his machine there is the same issue. I suspect a podman bug. – Salvatore D'angelo Sep 30 '22 at 11:04
  • As I know buildah is responsible for build step in podman. My version is 1.22.3 – Slava Kuravsky Sep 30 '22 at 11:09