Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman build fails with local image as FROM argument #10914

Closed
srcshelton opened this issue Jul 12, 2021 · 22 comments
Closed

podman build fails with local image as FROM argument #10914

srcshelton opened this issue Jul 12, 2021 · 22 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@srcshelton
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

podman-3.2.2 (buildah-1.21.0):

...
STEP 5: FROM localhost/gentoo-env:latest
Trying to pull localhost/gentoo-env:latest...
time="2021-07-12T21:17:07+01:00" level=warning msg="failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-12T21:17:09+01:00" level=warning msg="failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-12T21:17:11+01:00" level=warning msg="failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
Error: error creating build container: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

podman-3.2.1 (also buildah-1.21.0) and prior:

...
STEP 5: FROM localhost/gentoo-env:latest
STEP 6: ARG env_name
...

It appears that podman-3.2.2 is trying to make a registry request for any FROM image, even if prefixed with localhost/.

This may be a buildah issue - containers/buildah#2904 appears similar, but was resolved by adding localhost/ so I suspect this is something different.

I've raised containers/buildah#3375 but since the first affected podman version (3.2.2) and the last unaffected podman version (3.2.1) both incorporate the same release of buildah, this might actually be a podman issue.

This is reproducible on multiple architectures (output below from arm64 as I'd already downgraded the amd64 host to podman-3.2.1).

Output of podman version:

podman version 3.2.2

Output of podman info --debug:

host:
  arch: arm64
  buildahVersion: 1.21.0
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  cgroupManager: cgroupfs
  cgroupVersion: v2
  conmon:
    package: app-emulation/conmon-2.0.29
    path: /usr/bin/conmon
    version: 'conmon version 2.0.29, commit: 7e6de6678f6ed8a18661e1d5721b81ccee293b9b'
  cpus: 4
  distribution:
    distribution: gentoo
    version: unknown
  eventLogger: file
  hostname: turnpike
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.10.17-v8+
  linkmode: dynamic
  memFree: 4054306816
  memTotal: 8191815680
  ociRuntime:
    name: crun
    package: app-emulation/crun-0.20.1
    path: /usr/bin/crun
    version: |-
      crun version 0.20.1
      commit: 38271d1c8d9641a2cdc70acfa3dcb6996d124b3d
      spec: 1.0.0
      +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 8589144064
  swapTotal: 8589930496
  uptime: 1111h 53m 56.58s (Approximately 46.29 days)
registries:
  localhost:5000:
    Blocked: false
    Insecure: true
    Location: localhost:5000
    MirrorByDigestOnly: false
    Mirrors: []
    Prefix: localhost:5000
  search:
  - docker.io
  - docker.pkg.github.com
  - quay.io
  - public.ecr.aws
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 4
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /storage/containers/podman/images
    overlay.mountopt: nodev
  graphRoot: /storage/containers/podman/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 108
  runRoot: /storage/containers/podman/run
  volumePath: /storage/containers/podman/volumes
version:
  APIVersion: 3.2.2
  Built: 1624837847
  BuiltTime: Mon Jun 28 00:50:47 2021
  GitCommit: d577c44e359f9f8284b38cf984f939b3020badc3
  GoVersion: go1.16.5
  OsArch: linux/arm64
  Version: 3.2.2

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 12, 2021
@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2021

@vrothberg PTAL

@vrothberg
Copy link
Member

I cannot reproduce:

$ podman version| head -n1
Version:      3.2.2

$ cat F
FROM localhost/busybox
RUN echo "IT works"

$ podman images
REPOSITORY         TAG         IMAGE ID      CREATED      SIZE
localhost/busybox  latest      69593048aa3a  5 weeks ago  1.46 MB

$ podman build -f F
STEP 1: FROM localhost/busybox
STEP 2: RUN echo "IT works"
IT works
STEP 3: COMMIT
--> 6b21ffa8b28
6b21ffa8b28ea674cd5c1f66d1eb1a357adc9d755cba0547e5f5b83dd316f7a3

@srcshelton, if possible, could share the output of podman images? I suspect Podman/Buildah don't find localhost/gentoo-env:latest in the local storage. Only then, they should attempt to pull the image.

@srcshelton
Copy link
Contributor Author

To confirm, I can do:

  1. Downgrade to podman-3.2.1
  2. podman build succeeds
  3. Upgrade to podman-3.2.2
  4. podman build fails
  5. Downgrade to podman-3.2.1
  6. podman build succeeds again

… on every one of a variety of hosts, some amd64 and some arm64, with no other changes in between.

Working case (with podman-3.2.1):

$ sudo podman --version ; sudo podman image ls env ; sudo DEBUG=1 TRACE=1 ./gentoo-init.docker --env --stage3; sudo podman image ls env

podman version 3.2.1

REPOSITORY            TAG     IMAGE ID      CREATED        SIZE
localhost/gentoo-env  latest  8ad0611beb7e  4 minutes ago  15 kB

INFO:  Using default image 'gentoo-base:latest'
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --env '
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Creating image '\''localhost/gentoo-env:latest'\'' ...'
+ '[' -z ' * Creating image '\''localhost/gentoo-env:latest'\'' ...' ']'
+ echo -e ' * Creating image '\''localhost/gentoo-env:latest'\'' ...'
 * Creating image 'localhost/gentoo-env:latest' ...
+ output
+ '[' -z '' ']'
+ echo

+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg PROFILE_PATH=17.0 --build-arg CHOST=aarch64-unknown-linux-gnu --build-arg NATIVE=-mcpu=native --build-arg JOBS=3 --build-arg MAXLOAD=3.00 --build-arg SET_TERM=screen-256color --build-arg 'SET_USE_ESSENTIAL=asm ipv6 ithreads mdev nptl threads tls-heartbeat zlib cpu_flags_arm_edsp cpu_flags_arm_neon cpu_flags_arm_thumb cpu_flags_arm_vfp cpu_flags_arm_vfpv3 cpu_flags_arm_vfpv4 cpu_flags_arm_vfp-d32 cpu_flags_arm_crc32 cpu_flags_arm_v4 cpu_flags_arm_v5 cpu_flags_arm_v6 cpu_flags_arm_v7 cpu_flags_arm_thumb2' --compress --file Dockerfile.env --loglevel 3 --network none --no-cache --tag gentoo-env:latest --rm .
+ tee ../log/docker.gentoo-env.log
STEP 1: FROM scratch
STEP 2: LABEL maintainer="[email protected]"
--> 2dad8f72aab
STEP 3: LABEL Description="docker shared environment variables"
--> 78925662f33
STEP 4: ARG SET_TERM
--> 3a34ab3ba67
STEP 5: ENV TERM="${SET_TERM}"
--> 14580e12980
STEP 6: ARG JOBS
--> 2f260ee3896
STEP 7: ARG MAXLOAD
--> c32fa0c5f90
STEP 8: ENV JOBS="${JOBS}"     MAXLOAD="${MAXLOAD}"
--> 1462ea44afc
STEP 9: ARG ARCH="amd64"
--> 35a3537cf99
STEP 10: ARG PROFILE_PATH="17.1/no-multilib"
--> 8209d9c8cd1
STEP 11: ARG CHOST="x86_64-pc-linux-gnu"
--> 70e6502b8df
STEP 12: ARG NATIVE="-march=native"
--> 1beaf5931de
STEP 13: ENV GENTOO_PROFILE="default/linux/${ARCH}/${PROFILE_PATH}"     CHOST="${CHOST}"     LIBDIR_x32="lib32"     SYMLINK_LIB="no"     CFLAGS="-O2 ${NATIVE} -pipe"     CXXFLAGS="-O2 ${NATIVE} -pipe"     LDFLAGS="-Wl,-O1 -Wl,--as-needed"     MAKEOPTS="-j${JOBS}" 
--> 1dcb37c2988
STEP 14: ARG SET_USE_ESSENTIAL
--> adde398cf1c
STEP 15: ENV use_essential="${SET_USE_ESSENTIAL}"
--> 5a7c2650475
STEP 16: ARG PKGHOST="docker"
--> 079c7913330
STEP 17: ARG PKGCACHE="/var/cache/portage/pkg"
--> c292839f9ca
STEP 18: ENV PKGDIR="${PKGCACHE:-/var/cache/portage/pkg}/${ARCH}/${PKGHOST:-docker}"     DISTDIR="/var/cache/portage/dist"     PORTAGE_LOGDIR="/var/log/portage"     PORTAGE_TMPDIR="/var/tmp"     RPMDIR="/var/cache/portage/rpm"
--> 2a6ad236946
STEP 19: ARG FEATURES_COMMON="                                                           binpkg-logs binpkg-multi-instance buildpkg                             -collision-protect clean-logs compress-build-logs                  compressdebug                                                           fixlafiles                                                              multilib-strict                                          news                                                                    -protect-owned parallel-fetch parallel-install                           qa-unresolved-soname-deps                                        sfperms split-elog split-log splitdebug strict                           unknown-features-filter unknown-features-warn unmerge-orphans           userfetch userpriv usersync                                      xattr                                                                    ipc-sandbox mount-sandbox network-sandbox pid-sandbox                   usersandbox                                                 "
--> 796fe2984e2
STEP 20: ENV FEATURES="${FEATURES_COMMON}"
--> fa219b7b822
STEP 21: ENV CONFIG_PROTECT="/etc /etc/env.d /lib/rcscripts/addons /usr/share/gnupg/qualified.txt /var/www/localhost/htdocs/phpBB /var/www/localhost/htdocs/roundcube/config /var/www/localhost/htdocs/wordpress"     CONFIG_PROTECT_MASK="/etc/X11/xkb /etc/ca-certificates.conf /etc/env.d /etc/fonts /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"     INSTALL_MASK="AUTHORS.gz AUTHORS.bz2 BACKLOG.gz BACKLOG.bz2 BLURB.gz BLURB.bz2 CHANGELOG.gz CHANGELOG.bz2 Changelog.gz Changelog.bz2 ChangeLog.gz ChangeLog.bz2 ChangeLog.0.gz ChangeLog.1.gz CHANGES.gz CHANGES.bz2 Changes.gz Changes.bz2 COPYING.gz COPYING.bz2 Copying.gz Copying.bz2 CREDITS.gz CREDITS.bz2 INSTALL.gz INSTALL.bz2 MANIFEST.gz MANIFEST.bz2 NEWS.gz NEWS.bz2 PORTING.gz PORTING.bz2 THANKS.gz THANKS.bz2 TODO.gz TODO.bz2 WHATS_NEW.gz WHATS_NEW.bz2 /usr/lib/debug /usr/share/locale -/usr/share/locale/locale.alias -/usr/share/locale/en -/usr/share/locale/en_GB -/usr/share/locale/en_US /usr/share/X11/locale -/usr/share/X11/locale/compose.dir -/usr/share/X11/locale/locale.alias -/usr/share/X11/locale/locale.dir -/usr/share/X11/locale/C -/usr/share/X11/locale/en_US.UTF-8 -/usr/share/X11/locale/iso8859-1 -/usr/share/X11/locale/iso8859-15 /usr/share/man -/usr/share/man/man0 -/usr/share/man/man0p -/usr/share/man/man1 -/usr/share/man/man1p -/usr/share/man/man2 -/usr/share/man/man3 -/usr/share/man/man3p -/usr/share/man/man4 -/usr/share/man/man5 -/usr/share/man/man6 -/usr/share/man/man7 -/usr/share/man/man8 -/usr/share/man/mann -/usr/share/man/cat0 -/usr/share/man/cat0p -/usr/share/man/cat1 -/usr/share/man/cat1p -/usr/share/man/cat2 -/usr/share/man/cat3 -/usr/share/man/cat3p -/usr/share/man/cat4 -/usr/share/man/cat5 -/usr/share/man/cat6 -/usr/share/man/cat7 -/usr/share/man/cat8 -/usr/share/man/catn /usr/lib64/python*/site-packages/mercurial/locale /usr/share/binutils-data/x86_64-pc-linux-gnu/*/locale /usr/share/gcc-data/x86_64-pc-linux-gnu/*/locale /usr/lib/systemd /usr/lib/tmpfiles.d /usr/lib/sysusers.d /lib/systemd /etc/systemd"
--> 4f265d5b8fe
STEP 22: ARG EMERGE_COMMON_OPTS="--autounmask-write=y --backtrack=100 --binpkg-changed-deps=y --binpkg-respect-use=y --buildpkg=y --color=y --deep --ignore-soname-deps=n --keep-going=y --rebuild-if-new-slot=y --verbose=y --verbose-conflicts"
--> 98e5a607f0d
STEP 23: ENV EMERGE_DEFAULT_OPTS="${EMERGE_COMMON_OPTS}"
--> c15fd1d9cd4
STEP 24: ENV PEAR_CACHEDIR="/var/cache/pear"     PEAR_DOWNLOADDIR="/var/tmp/pear"     PEAR_TEMPDIR="/var/tmp"
--> 54f4bb6e7be
STEP 25: ENV PORTAGE_ELOG_MAILFROM="portage@xxx"     PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"     PORTAGE_ELOG_MAILURI="stuart@xxx smtp.xxx"     PORTAGE_ELOG_CLASSES="log warn error"     PORTAGE_ELOG_SYSTEM="echo save mail_summary"     PORTAGE_COMPRESS="xz"     PORTAGE_COMPRESS_FLAGS="-9eT0"
STEP 26: COMMIT gentoo-env:latest
--> 22fb08eb102
Successfully tagged localhost/gentoo-env:latest
22fb08eb102144230b257d9666746e75216e1465bf3e2973d5a74767c4809682
+ output ' -> 0'
+ '[' -z ' -> 0' ']'
+ echo -e ' -> 0'
 -> 0
+ '[' '--env --stage3' = --env ']'
++ podman image ls '--format={{.ID}}' localhost/gentoo-env:latest
+ env_id=22fb08eb1021
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...'
+ '[' -z ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...' ']'
+ echo -e ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...'
 * Stage 'env' complete, next is 'stage3' ...
+ output
+ '[' -z '' ']'
+ echo

++ grep -- '^ARG stage3_image=' Dockerfile.stage3
++ cut '-d"' -f 2
+ stage3_image=docker.io/gentoo/stage3
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --stage3 '
+ '[' -z 22fb08eb1021 ']'
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Creating image' ''\''localhost/gentoo-stage3:latest'\'' ...'
+ '[' -z ' * Creating image '\''localhost/gentoo-stage3:latest'\'' ...' ']'
+ echo -e ' * Creating image '\''localhost/gentoo-stage3:latest'\'' ...'
 * Creating image 'localhost/gentoo-stage3:latest' ...
+ output
+ '[' -z '' ']'
+ echo

+ rc=0
+ trap '' INT
+ '[' arm64 = latest ']'
+ podman image pull docker.io/gentoo/stage3:arm64
Trying to pull docker.io/gentoo/stage3:arm64...
Getting image source signatures
Copying blob 4f7422ccd0a5 [--------------------------------------] 0.0b / 0.0b
Copying config c671b4ca37 done
Writing manifest to image destination
Storing signatures
c671b4ca37cf502614ce0840d09949ef20b64936ac128a018c7b8c51e34ea195
+ trap - INT
+ '[' 0 -eq 0 ']'
++ podman image ls '--format={{.ID}}' localhost/docker.io/gentoo/stage3:arm64
+ stage3_id=
+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg env_id=22fb08eb1021 --build-arg env_name=gentoo-env --build-arg stage3_id= --build-arg stage3_image=docker.io/gentoo/stage3 --build-arg stage3_tag=arm64 --compress --file Dockerfile.stage3 --loglevel 3 --network none --no-cache --tag gentoo-stage3:latest .
+ tee ../log/docker.gentoo-stage3.log
STEP 1: FROM docker.io/gentoo/stage3:arm64 AS stage3  
STEP 2: ARG ARCH
--> 8f46f405333
STEP 3: ARG python_target_override
--> d67daae967e
STEP 4: RUN echo "USE=\"$(         cat /var/db/pkg/*/*/USE |         xargs -n 1 echo |         grep -v '^python_targets_' |         sed -r "s/^(python_single_target_)(.*)$/\1${python_target_override:-\2}\npython_targets_${python_target_override:-\2}/" |         sort |         uniq |         grep -v '^static' |         xargs echo -n     )\"" >/usr/libexec/stage3.info 2>/dev/null
--> 16ccc7c984a
STEP 5: FROM gentoo-env:latest
STEP 6: ARG env_name
--> e8ca9a37100
STEP 7: ARG env_id
--> 4175d32773d
STEP 8: ARG stage3_image
--> d41ba17b6d8
STEP 9: ARG stage3_id
--> ced32007c01
STEP 10: LABEL envrionment_from="${env_name}:${env_id}"
--> 601b16e74ac
STEP 11: LABEL stage3_from="${stage3_image}:${stage3_id}"
--> bfd3641ffc9
STEP 12: COPY --from=stage3 / /
--> ec37f9f0ec3
STEP 13: RUN test ! -e /var/db/repos || rm -r /var/db/repos
STEP 14: COMMIT gentoo-stage3:latest
--> 07c978333df
Successfully tagged localhost/gentoo-stage3:latest
07c978333df4088cff07744b1ab350be6f5b0f0a879fd1f5b893c11c39f5f312
+ output ' -> 0'
+ '[' -z ' -> 0' ']'
+ echo -e ' -> 0'
 -> 0
+ '[' '--env --stage3' = --stage3 ']'
++ podman image ls '--format={{.ID}}' localhost/gentoo-stage3:latest
+ local_stage3_id=07c978333df4
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Stage '\''stage3'\'' complete, next is '\''init'\'' ...'
+ '[' -z ' * Stage '\''stage3'\'' complete, next is '\''init'\'' ...' ']'
+ echo -e ' * Stage '\''stage3'\'' complete, next is '\''init'\'' ...'
 * Stage 'stage3' complete, next is 'init' ...
+ output
+ '[' -z '' ']'
+ echo

+ '[' -n '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --init '
++ podman image ls localhost/gentoo-init
+ images='REPOSITORY             TAG     IMAGE ID      CREATED            SIZE
localhost/gentoo-init  latest  ac3205994a26  About an hour ago  839 MB'
+ echo 'REPOSITORY             TAG     IMAGE ID      CREATED            SIZE
localhost/gentoo-init  latest  ac3205994a26  About an hour ago  839 MB'
+ grep -Eq -- '^(localhost/)?gentoo-init'
++ podman image inspect '--format={{.Config.Labels.entrypoint_sum}}' localhost/gentoo-init:latest
+ imagesum=361e89c6d78c4b4b5804b146de3cb948359cc24c   
+ '[' 361e89c6d78c4b4b5804b146de3cb948359cc24c '!=' 361e89c6d78c4b4b5804b146de3cb948359cc24c ']'
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --init '
+ checkids gentoo-stage3
+ local name=gentoo-stage3
+ local tag=
+ local images= stage3_env_id= stage3_src_id=
+ '[' -z gentoo-stage3 ']'
+ false
+ '[' -z podman ']'
+ '[' -z gentoo-stage3 ']'
+ '[' -z 22fb08eb1021 ']'
+ relation='inherited by'
+ '[' gentoo-stage3 = gentoo-stage3 ']'
+ relation='about to be linked to'
++ podman image ls localhost/gentoo-stage3:latest
+ images='REPOSITORY               TAG     IMAGE ID      CREATED        SIZE
localhost/gentoo-stage3  latest  07c978333df4  7 seconds ago  838 MB'
+ echo 'REPOSITORY               TAG     IMAGE ID      CREATED        SIZE
localhost/gentoo-stage3  latest  07c978333df4  7 seconds ago  838 MB'
+ grep -Eq -- '^(localhost/)?gentoo-stage3'
++ podman image inspect '--format={{.Config.Labels.envrionment_from}}' localhost/gentoo-stage3:latest
+ stage3_env_id=gentoo-env:22fb08eb1021
++ echo gentoo-env:22fb08eb1021
++ cut -d: -f 2-
+ stage3_env_id=22fb08eb1021
+ '[' 22fb08eb1021 '!=' 22fb08eb1021 ']'
+ '[' -n '' ']'
+ return 0
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --base '
+ checkids gentoo-init
+ local name=gentoo-init
+ local tag=
+ local images= stage3_env_id= stage3_src_id=
+ '[' -z gentoo-init ']'
+ false
+ '[' -z podman ']'
+ '[' -z gentoo-stage3 ']'
+ '[' -z 22fb08eb1021 ']'
+ relation='inherited by'
+ '[' gentoo-init = gentoo-stage3 ']'
++ podman image ls localhost/gentoo-init:latest
+ images='REPOSITORY             TAG     IMAGE ID      CREATED            SIZE
localhost/gentoo-init  latest  ac3205994a26  About an hour ago  839 MB'
+ echo 'REPOSITORY             TAG     IMAGE ID      CREATED            SIZE
localhost/gentoo-init  latest  ac3205994a26  About an hour ago  839 MB'
+ grep -Eq -- '^(localhost/)?gentoo-init'
++ podman image inspect '--format={{.Config.Labels.envrionment_from}}' localhost/gentoo-stage3:latest
+ stage3_env_id=gentoo-env:22fb08eb1021
++ echo gentoo-env:22fb08eb1021
++ cut -d: -f 2-
+ stage3_env_id=22fb08eb1021
+ '[' 22fb08eb1021 '!=' 22fb08eb1021 ']'
+ '[' -n '' ']'
+ return 0
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --build '
+ checkids gentoo-base
+ local name=gentoo-base
+ local tag=
+ local images= stage3_env_id= stage3_src_id=
+ '[' -z gentoo-base ']'
+ false
+ '[' -z podman ']'
+ '[' -z gentoo-stage3 ']'
+ '[' -z 22fb08eb1021 ']'
+ relation='inherited by'
+ '[' gentoo-base = gentoo-stage3 ']'
++ podman image ls localhost/gentoo-base:latest
+ images='REPOSITORY             TAG     IMAGE ID      CREATED       SIZE
localhost/gentoo-base  latest  2d895f9f4d62  39 hours ago  2.1 GB'
+ echo 'REPOSITORY             TAG     IMAGE ID      CREATED       SIZE
localhost/gentoo-base  latest  2d895f9f4d62  39 hours ago  2.1 GB'
+ grep -Eq -- '^(localhost/)?gentoo-base'
++ podman image inspect '--format={{.Config.Labels.envrionment_from}}' localhost/gentoo-stage3:latest
+ stage3_env_id=gentoo-env:22fb08eb1021
++ echo gentoo-env:22fb08eb1021
++ cut -d: -f 2-
+ stage3_env_id=22fb08eb1021
+ '[' 22fb08eb1021 '!=' 22fb08eb1021 ']'
+ '[' -n '' ']'
+ return 0
+ set +o xtrace

REPOSITORY            TAG     IMAGE ID      CREATED        SIZE
localhost/gentoo-env  latest  22fb08eb1021  3 minutes ago  15 kB
$ sudo buildah images | grep env
localhost/gentoo-env                        latest       22fb08eb1021   7 minutes ago       15 KB

Non-working case (with podman-3.2.2):

$ sudo podman --version ; sudo podman image ls env ; sudo DEBUG=1 TRACE=1 ./gentoo-init.docker --env --stage3; sudo podman image ls env

podman version 3.2.2

REPOSITORY            TAG         IMAGE ID      CREATED         SIZE
localhost/gentoo-env  latest      22fb08eb1021  10 minutes ago  15 kB

INFO:  Using default image 'gentoo-base:latest'
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --env '
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Creating image '\''localhost/gentoo-env:latest'\'' ...'
+ '[' -z ' * Creating image '\''localhost/gentoo-env:latest'\'' ...' ']'
+ echo -e ' * Creating image '\''localhost/gentoo-env:latest'\'' ...'
 * Creating image 'localhost/gentoo-env:latest' ...
+ output
+ '[' -z '' ']'
+ echo

+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg PROFILE_PATH=17.0 --build-arg CHOST=aarch64-unknown-linux-gnu --build-arg NATIVE=-mcpu=native --build-arg JOBS=3 --build-arg MAXLOAD=3.00 --build-arg SET_TERM=screen-256color --build-arg 'SET_USE_ESSENTIAL=asm ipv6 ithreads mdev nptl threads tls-heartbeat zlib cpu_flags_arm_edsp cpu_flags_arm_neon cpu_flags_arm_thumb cpu_flags_arm_vfp cpu_flags_arm_vfpv3 cpu_flags_arm_vfpv4 cpu_flags_arm_vfp-d32 cpu_flags_arm_crc32 cpu_flags_arm_v4 cpu_flags_arm_v5 cpu_flags_arm_v6 cpu_flags_arm_v7 cpu_flags_arm_thumb2' --compress --file Dockerfile.env --loglevel 3 --network none --no-cache --tag gentoo-env:latest --rm .
+ tee ../log/docker.gentoo-env.log
STEP 1: FROM scratch
STEP 2: LABEL maintainer="[email protected]"
--> 21e45aa43a4
STEP 3: LABEL Description="docker shared environment variables"
--> 8d0d72264df
STEP 4: ARG SET_TERM
--> 8f529cc47dd
STEP 5: ENV TERM="${SET_TERM}"
--> fa923c99781
STEP 6: ARG JOBS
--> 2f6b7908794
STEP 7: ARG MAXLOAD
--> 000df420723
STEP 8: ENV JOBS="${JOBS}"     MAXLOAD="${MAXLOAD}"
--> 9ae84c6b769
STEP 9: ARG ARCH="amd64"
--> 326d87450bb
STEP 10: ARG PROFILE_PATH="17.1/no-multilib"
--> cb9f2352b85
STEP 11: ARG CHOST="x86_64-pc-linux-gnu"
--> 27727dece6c
STEP 12: ARG NATIVE="-march=native"
--> cf04af83b12
STEP 13: ENV GENTOO_PROFILE="default/linux/${ARCH}/${PROFILE_PATH}"     CHOST="${CHOST}"     LIBDIR_x32="lib32"     SYMLINK_LIB="no"     CFLAGS="-O2 ${NATIVE} -pipe"     CXXFLAGS="-O2 ${NATIVE} -pipe"     LDFLAGS="-Wl,-O1 -Wl,--as-needed"     MAKEOPTS="-j${JOBS}"
--> d5a6aa6f0ac
STEP 14: ARG SET_USE_ESSENTIAL
--> 5aa10203409
STEP 15: ENV use_essential="${SET_USE_ESSENTIAL}"
--> 66b302b9c9d
STEP 16: ARG PKGHOST="docker"
--> a13cc56d2e0
STEP 17: ARG PKGCACHE="/var/cache/portage/pkg"
--> 52ef7892a26
STEP 18: ENV PKGDIR="${PKGCACHE:-/var/cache/portage/pkg}/${ARCH}/${PKGHOST:-docker}"     DISTDIR="/var/cache/portage/dist"     PORTAGE_LOGDIR="/var/log/portage"     PORTAGE_TMPDIR="/var/tmp"     RPMDIR="/var/cache/portage/rpm"
--> fcdf376eaf9
STEP 19: ARG FEATURES_COMMON="                                                           binpkg-logs binpkg-multi-instance buildpkg                             -collision-protect clean-logs compress-build-logs                  compressdebug                                                           fixlafiles                                                              multilib-strict                                          news                                                                    -protect-owned parallel-fetch parallel-install                           qa-unresolved-soname-deps                                        sfperms split-elog split-log splitdebug strict                           unknown-features-filter unknown-features-warn unmerge-orphans           userfetch userpriv usersync                                      xattr                                                                    ipc-sandbox mount-sandbox network-sandbox pid-sandbox                   usersandbox                                                 "
--> 363d6719fbd
STEP 20: ENV FEATURES="${FEATURES_COMMON}"
--> 8f67238a203
STEP 21: ENV CONFIG_PROTECT="/etc /etc/env.d /lib/rcscripts/addons /usr/share/gnupg/qualified.txt /var/www/localhost/htdocs/phpBB /var/www/localhost/htdocs/roundcube/config /var/www/localhost/htdocs/wordpress"     CONFIG_PROTECT_MASK="/etc/X11/xkb /etc/ca-certificates.conf /etc/env.d /etc/fonts /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"     INSTALL_MASK="AUTHORS.gz AUTHORS.bz2 BACKLOG.gz BACKLOG.bz2 BLURB.gz BLURB.bz2 CHANGELOG.gz CHANGELOG.bz2 Changelog.gz Changelog.bz2 ChangeLog.gz ChangeLog.bz2 ChangeLog.0.gz ChangeLog.1.gz CHANGES.gz CHANGES.bz2 Changes.gz Changes.bz2 COPYING.gz COPYING.bz2 Copying.gz Copying.bz2 CREDITS.gz CREDITS.bz2 INSTALL.gz INSTALL.bz2 MANIFEST.gz MANIFEST.bz2 NEWS.gz NEWS.bz2 PORTING.gz PORTING.bz2 THANKS.gz THANKS.bz2 TODO.gz TODO.bz2 WHATS_NEW.gz WHATS_NEW.bz2 /usr/lib/debug /usr/share/locale -/usr/share/locale/locale.alias -/usr/share/locale/en -/usr/share/locale/en_GB -/usr/share/locale/en_US /usr/share/X11/locale -/usr/share/X11/locale/compose.dir -/usr/share/X11/locale/locale.alias -/usr/share/X11/locale/locale.dir -/usr/share/X11/locale/C -/usr/share/X11/locale/en_US.UTF-8 -/usr/share/X11/locale/iso8859-1 -/usr/share/X11/locale/iso8859-15 /usr/share/man -/usr/share/man/man0 -/usr/share/man/man0p -/usr/share/man/man1 -/usr/share/man/man1p -/usr/share/man/man2 -/usr/share/man/man3 -/usr/share/man/man3p -/usr/share/man/man4 -/usr/share/man/man5 -/usr/share/man/man6 -/usr/share/man/man7 -/usr/share/man/man8 -/usr/share/man/mann -/usr/share/man/cat0 -/usr/share/man/cat0p -/usr/share/man/cat1 -/usr/share/man/cat1p -/usr/share/man/cat2 -/usr/share/man/cat3 -/usr/share/man/cat3p -/usr/share/man/cat4 -/usr/share/man/cat5 -/usr/share/man/cat6 -/usr/share/man/cat7 -/usr/share/man/cat8 -/usr/share/man/catn /usr/lib64/python*/site-packages/mercurial/locale /usr/share/binutils-data/x86_64-pc-linux-gnu/*/locale /usr/share/gcc-data/x86_64-pc-linux-gnu/*/locale /usr/lib/systemd /usr/lib/tmpfiles.d /usr/lib/sysusers.d /lib/systemd /etc/systemd"
--> 588ce076546
STEP 22: ARG EMERGE_COMMON_OPTS="--autounmask-write=y --backtrack=100 --binpkg-changed-deps=y --binpkg-respect-use=y --buildpkg=y --color=y --deep --ignore-soname-deps=n --keep-going=y --rebuild-if-new-slot=y --verbose=y --verbose-conflicts"
--> 31f2126d55f
STEP 23: ENV EMERGE_DEFAULT_OPTS="${EMERGE_COMMON_OPTS}"
--> 70aebf97a25
STEP 24: ENV PEAR_CACHEDIR="/var/cache/pear"     PEAR_DOWNLOADDIR="/var/tmp/pear"     PEAR_TEMPDIR="/var/tmp"
--> a64c06740aa
STEP 25: ENV PORTAGE_ELOG_MAILFROM="portage@xxx"     PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"     PORTAGE_ELOG_MAILURI="stuart@xxx smtp.xxx"     PORTAGE_ELOG_CLASSES="log warn error"     PORTAGE_ELOG_SYSTEM="echo save mail_summary"     PORTAGE_COMPRESS="xz"     PORTAGE_COMPRESS_FLAGS="-9eT0"
STEP 26: COMMIT gentoo-env:latest
--> 21276a8b58c
Successfully tagged localhost/gentoo-env:latest
21276a8b58c000b3d97dde0051a0645a2a1e4f18693face9619e479061c74ee9
+ output ' -> 0'
+ '[' -z ' -> 0' ']'
+ echo -e ' -> 0'
 -> 0
+ '[' '--env --stage3' = --env ']'
++ podman image ls '--format={{.ID}}' localhost/gentoo-env:latest
+ env_id=21276a8b58c0
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...'
+ '[' -z ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...' ']'
+ echo -e ' * Stage '\''env'\'' complete, next is '\''stage3'\'' ...'
 * Stage 'env' complete, next is 'stage3' ...
+ output
+ '[' -z '' ']'
+ echo

++ grep -- '^ARG stage3_image=' Dockerfile.stage3
++ cut '-d"' -f 2
+ stage3_image=docker.io/gentoo/stage3
+ '[' -z '--env --stage3' ']'
+ echo ' --env --stage3 '
+ grep -Fq -- ' --stage3 '
+ '[' -z 21276a8b58c0 ']'
+ output
+ '[' -z '' ']'
+ echo

+ output ' * Creating image' ''\''localhost/gentoo-stage3:latest'\'' ...'
+ '[' -z ' * Creating image '\''localhost/gentoo-stage3:latest'\'' ...' ']'
+ echo -e ' * Creating image '\''localhost/gentoo-stage3:latest'\'' ...'
 * Creating image 'localhost/gentoo-stage3:latest' ...
+ output
+ '[' -z '' ']'
+ echo

+ rc=0
+ trap '' INT
+ '[' arm64 = latest ']'
+ podman image pull docker.io/gentoo/stage3:arm64
Trying to pull docker.io/gentoo/stage3:arm64...
Getting image source signatures
Copying blob 4f7422ccd0a5 [--------------------------------------] 0.0b / 0.0b
Copying config c671b4ca37 done  
Writing manifest to image destination
Storing signatures
c671b4ca37cf502614ce0840d09949ef20b64936ac128a018c7b8c51e34ea195
+ trap - INT
+ '[' 0 -eq 0 ']'
++ podman image ls '--format={{.ID}}' localhost/docker.io/gentoo/stage3:arm64
+ stage3_id=
+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg env_id=21276a8b58c0 --build-arg env_name=gentoo-env --build-arg stage3_id= --build-arg stage3_image=docker.io/gentoo/stage3 --build-arg stage3_tag=arm64 --compress --file Dockerfile.stage3 --loglevel 3 --network none --no-cache --tag gentoo-stage3:latest .
+ tee ../log/docker.gentoo-stage3.log
STEP 1: FROM docker.io/gentoo/stage3:arm64 AS stage3
Trying to pull docker.io/gentoo/stage3:arm64...
Getting image source signatures
Copying blob sha256:4f7422ccd0a53f6d301bb1f7143aacfc2d5cca3ac50c89f404c718af6ed3c861
Copying config sha256:c671b4ca37cf502614ce0840d09949ef20b64936ac128a018c7b8c51e34ea195
Writing manifest to image destination
Storing signatures
STEP 2: ARG ARCH
--> c99a5a60f58
STEP 3: ARG python_target_override
--> 75f20fe66b8
STEP 4: RUN echo "USE=\"$(         cat /var/db/pkg/*/*/USE |         xargs -n 1 echo |         grep -v '^python_targets_' |         sed -r "s/^(python_single_target_)(.*)$/\1${python_target_override:-\2}\npython_targets_${python_target_override:-\2}/" |         sort |         uniq |         grep -v '^static' |         xargs echo -n     )\"" >/usr/libexec/stage3.info 2>/dev/null
--> 01bd09a222e
STEP 5: FROM gentoo-env:latest
Trying to pull localhost/gentoo-env:latest...
time="2021-07-14T19:21:30+01:00" level=warning msg="failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-14T19:21:32+01:00" level=warning msg="failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-14T19:21:34+01:00" level=warning msg="failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
Error: error creating build container: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

REPOSITORY            TAG         IMAGE ID      CREATED         SIZE
localhost/gentoo-env  latest      21276a8b58c0  16 seconds ago  15 kB
$ sudo buildah images | grep env
localhost/gentoo-env                        latest       21276a8b58c0   About a minute ago   15 KB

@srcshelton
Copy link
Contributor Author

Literal podman images output (… note all of the non-deleted intermediate stages - unsure whether this is intentional or a different bug):

$ sudo podman images
REPOSITORY                                 TAG         IMAGE ID      CREATED            SIZE
<none>                                     <none>      01bd09a222e6  5 minutes ago      838 MB
localhost/gentoo-env                       latest      21276a8b58c0  6 minutes ago      15 kB
<none>                                     <none>      a64c06740aa5  6 minutes ago      14.2 kB
<none>                                     <none>      70aebf97a251  6 minutes ago      13.9 kB
<none>                                     <none>      31f2126d55f4  6 minutes ago      13.6 kB
<none>                                     <none>      588ce0765468  6 minutes ago      12 kB
<none>                                     <none>      8f67238a2030  6 minutes ago      7.89 kB
<none>                                     <none>      363d6719fbdf  6 minutes ago      7.05 kB
<none>                                     <none>      fcdf376eaf9e  6 minutes ago      5.75 kB
<none>                                     <none>      52ef7892a267  6 minutes ago      5.26 kB
<none>                                     <none>      a13cc56d2e0d  6 minutes ago      4.67 kB
<none>                                     <none>      66b302b9c9d5  6 minutes ago      4.11 kB
<none>                                     <none>      9ae84c6b7698  6 minutes ago      1.74 kB
<none>                                     <none>      5aa102034090  6 minutes ago      3.65 kB
<none>                                     <none>      cf04af83b127  6 minutes ago      2.5 kB
<none>                                     <none>      27727dece6cc  6 minutes ago      2.28 kB
<none>                                     <none>      cb9f2352b85b  6 minutes ago      2.07 kB
<none>                                     <none>      326d87450bb6  6 minutes ago      1.9 kB
<none>                                     <none>      d5a6aa6f0ac4  6 minutes ago      3.1 kB
<none>                                     <none>      000df4207230  6 minutes ago      1.57 kB
<none>                                     <none>      2f6b79087947  6 minutes ago      1.43 kB
<none>                                     <none>      fa923c99781f  6 minutes ago      1.29 kB
<none>                                     <none>      8f529cc47dd8  6 minutes ago      1.15 kB
<none>                                     <none>      8d0d72264dfc  6 minutes ago      1.02 kB
<none>                                     <none>      21e45aa43a40  6 minutes ago      812 B
localhost/gentoo-stage3                    latest      07c978333df4  13 minutes ago     838 MB
<none>                                     <none>      bfd3641ffc96  16 minutes ago     16.1 kB
<none>                                     <none>      601b16e74ace  16 minutes ago     15.9 kB
<none>                                     <none>      16ccc7c984ab  16 minutes ago     838 MB
<none>                                     <none>      d41ba17b6d85  16 minutes ago     15.5 kB
<none>                                     <none>      4175d32773dd  16 minutes ago     15.3 kB
<none>                                     <none>      e8ca9a371003  16 minutes ago     15.2 kB
<none>                                     <none>      ced32007c010  16 minutes ago     15.7 kB
<none>                                     <none>      22fb08eb1021  17 minutes ago     15 kB
<none>                                     <none>      54f4bb6e7be7  17 minutes ago     14.2 kB
<none>                                     <none>      c15fd1d9cd48  17 minutes ago     13.9 kB
<none>                                     <none>      98e5a607f0de  17 minutes ago     13.6 kB
<none>                                     <none>      4f265d5b8fe5  17 minutes ago     12 kB
<none>                                     <none>      fa219b7b8226  17 minutes ago     7.89 kB
<none>                                     <none>      796fe2984e23  17 minutes ago     7.05 kB
<none>                                     <none>      2a6ad2369463  17 minutes ago     5.76 kB
<none>                                     <none>      c292839f9caa  17 minutes ago     5.26 kB
<none>                                     <none>      079c79133305  17 minutes ago     4.67 kB
<none>                                     <none>      1462ea44afc6  17 minutes ago     1.74 kB
<none>                                     <none>      5a7c2650475c  17 minutes ago     4.1 kB
<none>                                     <none>      1dcb37c2988a  17 minutes ago     3.1 kB
<none>                                     <none>      1beaf5931def  17 minutes ago     2.5 kB
<none>                                     <none>      70e6502b8df8  17 minutes ago     2.28 kB
<none>                                     <none>      35a3537cf998  17 minutes ago     1.9 kB
<none>                                     <none>      adde398cf1ce  17 minutes ago     3.65 kB
<none>                                     <none>      8209d9c8cd12  17 minutes ago     2.07 kB
<none>                                     <none>      78925662f33c  17 minutes ago     1.02 kB
<none>                                     <none>      c32fa0c5f901  17 minutes ago     1.57 kB
<none>                                     <none>      2f260ee38966  17 minutes ago     1.43 kB
<none>                                     <none>      2dad8f72aab3  17 minutes ago     811 B
<none>                                     <none>      3a34ab3ba673  17 minutes ago     1.15 kB
<none>                                     <none>      14580e129802  17 minutes ago     1.29 kB
<none>                                     <none>      bd5c35d7005e  21 minutes ago     838 MB
<none>                                     <none>      8ad0611beb7e  22 minutes ago     15 kB
<none>                                     <none>      242dfe3d83a3  22 minutes ago     14.2 kB
<none>                                     <none>      c894889908ea  22 minutes ago     13.9 kB
<none>                                     <none>      c86bba46f1b2  22 minutes ago     13.6 kB
<none>                                     <none>      d5077e88d5af  22 minutes ago     12 kB
<none>                                     <none>      255d8da16396  22 minutes ago     3.65 kB
<none>                                     <none>      18137b0a7a8c  22 minutes ago     7.06 kB
<none>                                     <none>      f86c9f33c12e  22 minutes ago     5.76 kB
<none>                                     <none>      d08e79671ed8  22 minutes ago     5.26 kB
<none>                                     <none>      b90057cc20df  22 minutes ago     4.67 kB
<none>                                     <none>      759113ebfa59  22 minutes ago     4.1 kB
<none>                                     <none>      ff53a99b1f0c  22 minutes ago     7.89 kB
<none>                                     <none>      aa480986c9bd  22 minutes ago     3.1 kB
<none>                                     <none>      5b641d173967  22 minutes ago     2.5 kB
<none>                                     <none>      08a88798ab24  22 minutes ago     2.28 kB
<none>                                     <none>      5d430dbec465  22 minutes ago     2.07 kB
<none>                                     <none>      cf85cb13d222  22 minutes ago     1.9 kB
<none>                                     <none>      bf7aa0de002b  22 minutes ago     1.74 kB
<none>                                     <none>      bb8ac7c8b79b  22 minutes ago     1.57 kB
<none>                                     <none>      42bab48ba0e1  22 minutes ago     1.29 kB
<none>                                     <none>      5c77295c73cc  22 minutes ago     1.42 kB
<none>                                     <none>      22e7e9425ccd  22 minutes ago     1.14 kB
<none>                                     <none>      eca13fd61593  22 minutes ago     1.02 kB
<none>                                     <none>      fb5df3467810  22 minutes ago     812 B
<none>                                     <none>      e35ee7c7fc34  About an hour ago  838 MB
<none>                                     <none>      5dd1d598014e  About an hour ago  15 kB
<none>                                     <none>      3beb5bd23d57  About an hour ago  14.2 kB
<none>                                     <none>      5b180d7b15d0  About an hour ago  13.9 kB
<none>                                     <none>      646fa42eec7f  About an hour ago  13.6 kB
<none>                                     <none>      7e6811f07ec5  About an hour ago  12 kB
<none>                                     <none>      88ca5ff561dc  About an hour ago  7.89 kB
<none>                                     <none>      c3a862bb6ed9  About an hour ago  7.05 kB
<none>                                     <none>      a2bae7829d05  About an hour ago  2.28 kB
<none>                                     <none>      35f3a1e8c659  About an hour ago  5.26 kB
<none>                                     <none>      a98277140a3c  About an hour ago  4.67 kB
<none>                                     <none>      8f0fee3f4a3e  About an hour ago  2.07 kB
<none>                                     <none>      5146d5172e53  About an hour ago  5.76 kB
<none>                                     <none>      25dd6b62cb4c  About an hour ago  3.1 kB
<none>                                     <none>      18fdae6137dc  About an hour ago  2.5 kB
<none>                                     <none>      2bb16751a8b0  About an hour ago  3.65 kB
<none>                                     <none>      b50843a0277a  About an hour ago  4.1 kB
<none>                                     <none>      b75279086599  About an hour ago  812 B
<none>                                     <none>      bd85a8f6710e  About an hour ago  1.02 kB
<none>                                     <none>      ec2bdf087ab5  About an hour ago  1.14 kB
<none>                                     <none>      3bc3909840f7  About an hour ago  1.29 kB
<none>                                     <none>      458add8440f1  About an hour ago  1.89 kB
<none>                                     <none>      c83b3ff4bf96  About an hour ago  1.57 kB
<none>                                     <none>      3aaaa42c04c5  About an hour ago  1.74 kB
<none>                                     <none>      d4a2999ac71c  About an hour ago  1.42 kB
localhost/gentoo-init                      latest      ac3205994a26  About an hour ago  839 MB
<none>                                     <none>      b24ac792cd9d  About an hour ago  16.1 kB
<none>                                     <none>      46612c7480d3  About an hour ago  15.9 kB
<none>                                     <none>      a253f079e73a  About an hour ago  15.7 kB
<none>                                     <none>      9c90ecb01c42  About an hour ago  15.5 kB
<none>                                     <none>      f1e95cf7b6df  About an hour ago  15.3 kB
<none>                                     <none>      62a85de5738b  About an hour ago  15.2 kB
<none>                                     <none>      2fbe4be004e7  About an hour ago  838 MB
<none>                                     <none>      8c6de875d0fe  About an hour ago  12 kB
<none>                                     <none>      bb52df3c3701  About an hour ago  14.2 kB
<none>                                     <none>      445e7c5a6abb  About an hour ago  13.9 kB
<none>                                     <none>      3ce02b5b6c88  About an hour ago  13.6 kB
<none>                                     <none>      9b34e11fa7cc  About an hour ago  15 kB
<none>                                     <none>      b2cab5982c12  About an hour ago  7.89 kB
<none>                                     <none>      de91f97be105  About an hour ago  7.06 kB
<none>                                     <none>      f1c3590d982b  About an hour ago  2.07 kB
<none>                                     <none>      6a5bcfe5bcd0  About an hour ago  5.26 kB
<none>                                     <none>      a9ea2ea05798  About an hour ago  4.67 kB
<none>                                     <none>      5396bbfd0ca5  About an hour ago  4.11 kB
<none>                                     <none>      c723a35028f6  About an hour ago  3.65 kB
<none>                                     <none>      ee2c916ef8f0  About an hour ago  2.51 kB
<none>                                     <none>      ccf8adc524ba  About an hour ago  3.1 kB
<none>                                     <none>      684af800147b  About an hour ago  2.28 kB
<none>                                     <none>      036e5084ef7e  About an hour ago  5.76 kB
<none>                                     <none>      a0094543edf7  About an hour ago  1.9 kB
<none>                                     <none>      c2088e03699c  About an hour ago  1.74 kB
<none>                                     <none>      770d3c76a94d  About an hour ago  1.57 kB
<none>                                     <none>      86bb8736c644  About an hour ago  1.43 kB
<none>                                     <none>      b9fdc84e2fc5  About an hour ago  1.29 kB
<none>                                     <none>      82e2ed53da17  About an hour ago  1.14 kB
<none>                                     <none>      04626d17e0f3  About an hour ago  812 B
<none>                                     <none>      bab014be865c  About an hour ago  1.02 kB
<none>                                     <none>      2a3e1ed16ff3  2 hours ago        16.1 kB
<none>                                     <none>      caa4333fd450  2 hours ago        15.9 kB
<none>                                     <none>      66b0db147f3b  2 hours ago        15.7 kB
<none>                                     <none>      d3e3c33ff761  2 hours ago        15.5 kB
<none>                                     <none>      6f48a5c6fa62  2 hours ago        15.3 kB
<none>                                     <none>      bdca20581f85  2 hours ago        15.2 kB
<none>                                     <none>      a23b7aa118ba  2 hours ago        838 MB
<none>                                     <none>      c98a77ae0789  2 hours ago        7.05 kB
<none>                                     <none>      b40735c8cee1  2 hours ago        15 kB
<none>                                     <none>      f12d6d1142db  2 hours ago        14.2 kB
<none>                                     <none>      354e3af9d2c5  2 hours ago        13.9 kB
<none>                                     <none>      e5f8b0e21100  2 hours ago        13.6 kB
<none>                                     <none>      d417b4c3231d  2 hours ago        12 kB
<none>                                     <none>      b4d680a37443  2 hours ago        7.89 kB
<none>                                     <none>      c317035a0d45  2 hours ago        5.26 kB
<none>                                     <none>      b3b93b570222  2 hours ago        5.76 kB
<none>                                     <none>      71017fdf0ba6  2 hours ago        1.29 kB
<none>                                     <none>      fcc627cea4a8  2 hours ago        1.14 kB
<none>                                     <none>      4b5fa4b9b9ee  2 hours ago        4.1 kB
<none>                                     <none>      6af41a4c59cf  2 hours ago        3.65 kB
<none>                                     <none>      ebb6c2db7444  2 hours ago        3.1 kB
<none>                                     <none>      8bfd6bcad880  2 hours ago        1.02 kB
<none>                                     <none>      c50903609c71  2 hours ago        2.28 kB
<none>                                     <none>      dcdb1219dd07  2 hours ago        2.07 kB
<none>                                     <none>      9cf8c006e113  2 hours ago        1.9 kB
<none>                                     <none>      0942c51d7a3c  2 hours ago        1.74 kB
<none>                                     <none>      fc5a4fcf8ebc  2 hours ago        1.57 kB
<none>                                     <none>      797c72781eda  2 hours ago        1.42 kB
<none>                                     <none>      a41539076831  2 hours ago        2.5 kB
<none>                                     <none>      dd1ac335f665  2 hours ago        4.67 kB
<none>                                     <none>      e112befe8a09  2 hours ago        811 B
<none>                                     <none>      9e311a252587  2 hours ago        839 MB
<none>                                     <none>      8d107166e481  2 hours ago        5.75 kB
<none>                                     <none>      38510f2b761b  2 hours ago        15 kB
<none>                                     <none>      644eb9af09c4  2 hours ago        14.2 kB
<none>                                     <none>      9285406d829c  2 hours ago        13.9 kB
<none>                                     <none>      1dd558a74c9d  2 hours ago        13.6 kB
<none>                                     <none>      1a773d4ade50  2 hours ago        12 kB
<none>                                     <none>      f1d2d49bc039  2 hours ago        7.88 kB
<none>                                     <none>      fc2e845f6061  2 hours ago        7.05 kB
<none>                                     <none>      4f22efbd27ca  2 hours ago        1.02 kB
<none>                                     <none>      baa692926fb9  2 hours ago        811 B
<none>                                     <none>      4d96fa8854d6  2 hours ago        4.66 kB
<none>                                     <none>      46359193ed4f  2 hours ago        4.1 kB
<none>                                     <none>      9dffc4769a20  2 hours ago        3.64 kB
<none>                                     <none>      bc9d0d5ae114  2 hours ago        3.1 kB
<none>                                     <none>      c6360210799d  2 hours ago        2.5 kB
<none>                                     <none>      d953069c6680  2 hours ago        2.28 kB
<none>                                     <none>      fafbcb7823a5  2 hours ago        2.07 kB
<none>                                     <none>      233cdb2a5cec  2 hours ago        1.9 kB
<none>                                     <none>      59846962d97d  2 hours ago        1.74 kB
<none>                                     <none>      bd9b4d8c80b5  2 hours ago        1.57 kB
<none>                                     <none>      bdb5108e2bd3  2 hours ago        1.42 kB
<none>                                     <none>      abf0460d6043  2 hours ago        1.29 kB
<none>                                     <none>      87dab6b07bae  2 hours ago        1.14 kB
<none>                                     <none>      7307d05aac31  2 hours ago        5.25 kB
docker.io/gentoo/stage3                    arm64       c671b4ca37cf  17 hours ago       838 MB
localhost/service.app-admin.syslog-ng      3.30.1      2e6d43989da4  27 hours ago       103 MB
localhost/service.net-misc.openntpd        6.2_p3-r2   00a4b903044d  28 hours ago       51.8 MB
localhost/service.net-misc.dhcp            4.4.2_p1    37683b6ce292  28 hours ago       60.5 MB
localhost/service.net-dns.bind             9.16.15-r1  12149ce42011  28 hours ago       356 MB
localhost/gentoo-build                     latest      5140e6243f54  39 hours ago       759 MB
localhost/gentoo-base                      latest      2d895f9f4d62  40 hours ago       2.1 GB
<none>                                     <none>      7444801e2831  46 hours ago       15 kB
<none>                                     <none>      ec89e4249372  2 days ago         838 MB
localhost/sys-kernel.gentoo-sources.clang  5.13.0      b915fa15b4ef  12 days ago        3.62 GB
docker.io/koalaman/shellcheck              v0.7.2      2da3e14fe1c5  2 months ago       20.5 MB

@srcshelton
Copy link
Contributor Author

(podman image ls '--format={{.ID}}' localhost/docker.io/gentoo/stage3:arm64 is wrong, but not in a way which should impact this issue - now corrected!)

diff'ing the two outputs above, I notice that we have -

Working:

+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg env_id=802f92db1d57 --build-arg env_name=gentoo-env --build-arg stage3_id= --build-arg stage3_image=docker.io/gentoo/stage3 --build-arg stage3_tag=arm64 --compress --file Dockerfile.stage3 --loglevel 3 --network none --no-cache --tag gentoo-stage3:latest .
STEP 1: FROM docker.io/gentoo/stage3:arm64 AS stage3
STEP 2: ARG ARCH
...

Broken:

+ podman image build --platform linux/arm64 --build-arg ARCH=arm64 --build-arg env_id=be0c119edc46 --build-arg env_name=gentoo-env --build-arg stage3_id= --build-arg stage3_image=docker.io/gentoo/stage3 --build-arg stage3_tag=arm64 --compress --file Dockerfile.stage3 --loglevel 3 --network none --no-cache --tag gentoo-stage3:latest .
STEP 1: FROM docker.io/gentoo/stage3:arm64 AS stage3
Trying to pull docker.io/gentoo/stage3:arm64...
Getting image source signatures
Copying blob sha256:4f7422ccd0a53f6d301bb1f7143aacfc2d5cca3ac50c89f404c718af6ed3c861
Copying config sha256:c671b4ca37cf502614ce0840d09949ef20b64936ac128a018c7b8c51e34ea195
Writing manifest to image destination
Storing signatures
STEP 2: ARG ARCH
...

… which is slightly surprising, but perhaps indicates some change in this specific area between 3.2.1 and 3.2.2?

@vrothberg
Copy link
Member

@srcshelton, there was a number of regressions in v3.2 with respect to multi-arch images. Many fixes haven been backported to the v3.2 branch (https://github.com/containers/podman/tree/v3.2). Any chance you could compile the v3.2 branch and test?

I am unable to extract a reproducer but maybe the regression has been fixed in the meantime. We plan to release v3.2.3 soon.

@srcshelton
Copy link
Contributor Author

I'll give that branch a try today!

Please note, however, that this issue also occurs on amd64 hosts, and whilst different architectures are affected, all assemble their own architecture only - I don't think that this is a multi-arch situation?

@srcshelton
Copy link
Contributor Author

@srcshelton, there was a number of regressions in v3.2 with respect to multi-arch images. Many fixes haven been backported to the v3.2 branch (https://github.com/containers/podman/tree/v3.2). Any chance you could compile the v3.2 branch and test?

I am unable to extract a reproducer but maybe the regression has been fixed in the meantime. We plan to release v3.2.3 soon.

I'm now on:

$ podman --version
podman version 3.2.3-dev

... and get slightly different (but still failing) output. Firstly, without localhost/ (as has worked always up to and including version 3.2.1):

STEP 5: FROM gentoo-env:latest
Resolving "gentoo-env" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/library/gentoo-env:latest...
Trying to pull docker.pkg.github.com/gentoo-env:latest...
Trying to pull quay.io/gentoo-env:latest...
Trying to pull public.ecr.aws/gentoo-env:latest...
Error: error creating build container: 4 errors occurred while pulling:
 * Error initializing source docker://gentoo-env:latest: Error reading manifest latest in docker.io/library/gentoo-env: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

 * Error initializing source docker://docker.pkg.github.com/gentoo-env:latest: Error reading manifest latest in docker.pkg.github.com/gentoo-env: StatusCode: 404, 404 page not found

 * Error initializing source docker://quay.io/gentoo-env:latest: Error reading manifest latest in quay.io/gentoo-env: StatusCode: 404, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final/...
 * Error initializing source docker://public.ecr.aws/gentoo-env:latest: Error reading manifest latest in public.ecr.aws/gentoo-env: StatusCode: 404, 404 page not found

... and with localhost/:

STEP 5: FROM localhost/gentoo-env:latest
Trying to pull localhost/gentoo-env:latest...
time="2021-07-15T13:45:15+01:00" level=warning msg="failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-15T13:45:17+01:00" level=warning msg="failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-15T13:45:19+01:00" level=warning msg="failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
Error: error creating build container: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

Immediately afterwards:

$ sudo podman image ls gentoo-env
REPOSITORY            TAG         IMAGE ID      CREATED         SIZE
localhost/gentoo-env  latest      2f56726fd0a4  21 minutes ago  16.1 kB

The image in question is based on scratch and exists solely to propagate shared variables, but I get this output:

$ sudo podman run -it --rm localhost/gentoo-env:latest
Error: no command or entrypoint provided, and no CMD or ENTRYPOINT from image

... so running a container seems to find the image in question, so it definitely appears to be a change around the interaction with buildah (even though the versions bundled are the same between 3.2.1 and .3.2.2 and after.

@srcshelton
Copy link
Contributor Author

$ sudo buildah images | grep gentoo
localhost/gentoo-env                        latest       a53433eb1a77   22 minutes ago   16.1 KB
localhost/gentoo-build                      latest       122ef560ec1b   11 hours ago     758 MB
docker.io/gentoo/stage3                     arm64        6cd1ce14d687   11 hours ago     838 MB
localhost/gentoo-base                       latest       e2656bd3cb4b   12 hours ago     1.59 GB
localhost/gentoo-init                       latest       1bbede10f78e   13 hours ago     839 MB
localhost/gentoo-stage3                     latest       e7ddb9a27aa8   13 hours ago     838 MB
localhost/sys-kernel.gentoo-sources.clang   5.13.0       b915fa15b4ef   13 days ago      3.62 GB
$ sudo buildah from localhost/gentoo-env:latest
gentoo-env-working-container-1
$ buildah --version
buildah version 1.21.2 (image-spec 1.0.1-dev, runtime-spec 1.0.2-dev)

@vrothberg
Copy link
Member

@srcshelton, can you try with buildah bud instead of podman build?

Thanks for your cooperation, which is super helpful to isolate the source of the issue.

@srcshelton
Copy link
Contributor Author

Looks as if it's a buildah problem after all:

+ buildah bud --platform linux/arm64 --build-arg ARCH=arm64 --build-arg env_id=c052aa2b6221 --build-arg env_name=gentoo-env --build-arg stage3_id=6cd1ce14d687 --build-arg stage3_image=docker.io/gentoo/stage3 --build-arg stage3_tag=arm64 --compress --file Dockerfile.stage3 --loglevel 3 --network none --no-cache --tag gentoo-stage3:latest .
STEP 1: FROM docker.io/gentoo/stage3:arm64 AS stage3
Trying to pull docker.io/gentoo/stage3:arm64...
Getting image source signatures
Copying blob sha256:a1d58913841e4d32eabef4400c7528ddb767e9697c48838e771e15d4623f11fc
Copying config sha256:6cd1ce14d6874086310c50acdf296632ad2a2f644f820cd82a86650a7b695dba
Writing manifest to image destination
Storing signatures
STEP 2: ARG ARCH
STEP 3: ARG python_target_override
STEP 4: RUN echo "USE=\"$(         cat /var/db/pkg/*/*/USE |         xargs -n 1 echo |         grep -v '^python_targets_' |         sed -r "s/^(python_single_target_)(.*)$/\1${python_target_override:-\2}\npython_targets_${python_target_override:-\2}/" |         sort |         uniq |         grep -v '^static' |         xargs echo -n     )\"" >/usr/libexec/stage3.info 2>/dev/null
STEP 5: FROM localhost/gentoo-env:latest
Trying to pull localhost/gentoo-env:latest...
time="2021-07-15T14:25:29+01:00" level=warning msg="failed, retrying in 2s ... (1/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-15T14:25:31+01:00" level=warning msg="failed, retrying in 2s ... (2/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
time="2021-07-15T14:25:33+01:00" level=warning msg="failed, retrying in 2s ... (3/3). Error: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get \"https://localhost/v2/\": dial tcp [::1]:443: connect: connection refused"
error creating build container: Error initializing source docker://localhost/gentoo-env:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

@vrothberg
Copy link
Member

@srcshelton, thanks for checking. Any chance you can share the reproducer? Then you're off the hook and I can start running :)

@srcshelton
Copy link
Contributor Author

I've not tested this on a host not running Gentoo to begin with (... although the intent is that it should run from anywhere!), but hopefully if you clone https://github.com/srcshelton/docker-gentoo-build then it should be as simple as running ./gentoo-init.docker as root.

(I have this in /opt/containers/docker-gentoo-build, but that shouldn't be hard-coded anywhere)

Let me try this on a non-Gentoo host system and see if any changes are needed...

@srcshelton
Copy link
Contributor Author

Yup, so there are a few uses of the Gentoo-specific portageq utility, but nothing fatal until after the error with podman-3.2.2 and above has already occurred (on Ubuntu, at least!)

The error occurs during the 'stage3' section (the second part, immediately after 'env').

@vrothberg
Copy link
Member

Thanks, @srcshelton. FWIW, I can reproduce but it does not work with Podman v3.2.1 or any other version of Podman/Buildah I've tried.

Whatever version I use, it always attempts to pull localhost/gentoo-env:latest.

@srcshelton
Copy link
Contributor Author

Could you post the full output?

I did a test install on Ubuntu 21.04 using their standard packages (podman-3.0.1) straight out of the box, and it passed the point in question.

Note that the process as a whole will fail if not run on Gentoo right now, but the STEP 5: FROM gentoo-env:latest pull (no localhost/ prefix on the checked-in version) did succeed for me on Ubuntu/amd64.

@vrothberg
Copy link
Member

What I did was:

diff --git a/gentoo-init.docker b/gentoo-init.docker
index d5d84f4ccbf1..535ecd4a159e 100755
--- a/gentoo-init.docker
+++ b/gentoo-init.docker
@@ -245,8 +245,8 @@ if [ -z "${*:-}" ] || echo " ${*} " | grep -Fq -- ' --env '; then
        # USED_BY: stage3 build
 
        # shellcheck disable=SC2086
-       $docker image build \
-                       --platform "linux/${docker_arch}" \
+       $PODMAN build \
+               --platform "linux/${docker_arch}" \
                        --build-arg ARCH="${arch}" \
                        --build-arg PROFILE_PATH="${profile:-}" \
                        --build-arg CHOST="${chost:-}" \
$
sudo PODMAN=$HOME/containers/podman/bin/podman ./gentoo-init.docker
[...]
STEP 5: FROM gentoo-env:latest
Trying to pull localhost/gentoo-env:latest...
[...]

Just tried the v3.0.1-rhel branch but it also fails.

@srcshelton
Copy link
Contributor Author

srcshelton commented Jul 16, 2021

So on an Ubuntu laptop (e.g. bare-metal, not virtualised or within a chroot() environment, etc.) which is rarely used but was upgraded to Ubuntu 21.04, I literally did:

 2001  sudo apt-get update && sudo apt-get --purge dist-upgrade -y && sudo apt-get --purge autoremove -y && sudo apt-get autoclean
 2002  sudo apt-get install podman
 2003  sudo apt-get install crun
 2004  sudo podman --version
 2005  ls
 2006  mkdir containers
 2007  cd containers/
 2008  git clone https://github.com/srcshelton/docker-gentoo-build
 2009  cd docker-gentoo-build/
 2010  ls
 2011  sudo ./gentoo-init.docker 

... which succeeded past STEP 5 and left me (after pruning hundreds of images labelled <none>) with:

...
 * Stage 'env' complete, next is 'stage3' ...


 * Creating image 'localhost/gentoo-stage3:latest' ...

Trying to pull docker.io/gentoo/stage3:amd64-nomultilib...
Getting image source signatures
Copying blob e2a0e8a04782 [--------------------------------------] 0.0b / 0.0b
Copying config 44d6dff32b done  
Writing manifest to image destination
Storing signatures
44d6dff32b7a90cc8ae86ee75488879a28d0a72a513cb2aeda2b6b2640a766c2
time="2021-07-15T18:04:15+01:00" level=warning msg="missing \"python_target_override\" build argument. Try adding \"--build-arg python_target_override=<VALUE>\" to the command line"
STEP 1: FROM docker.io/gentoo/stage3:amd64-nomultilib AS stage3
STEP 2: ARG ARCH
--> 4599e5c7dc0
STEP 3: ARG python_target_override
--> 90f89896c02
STEP 4: RUN echo "USE=\"$(         cat /var/db/pkg/*/*/USE |         xargs -n 1 echo |         grep -v '^python_targets_' |         sed -r "s/^(python_single_target_)(.*)$/\1${python_target_override:-\2}\npython_targets_${python_target_override:-\2}/" |         sort |         uniq |         grep -v '^static' |         xargs echo -n     )\"" >/usr/libexec/stage3.info 2>/dev/null
--> 74a8417a0b9
STEP 5: FROM gentoo-env:latest
STEP 6: ARG env_name
--> a2959b86822
...

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="21.04 (Hirsute Hippo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 21.04"
VERSION_ID="21.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=hirsute
UBUNTU_CODENAME=hirsute

$ dpkg -l | grep podman
ii  podman                                           3.0.1+dfsg1-1ubuntu1                                                 amd64        engine to run OCI-based containers in Pods

$ sudo podman image ls
REPOSITORY               TAG               IMAGE ID      CREATED       SIZE
localhost/gentoo-init    latest            be5261bd256d  18 hours ago  882 MB
localhost/gentoo-stage3  latest            ac9561de84e7  18 hours ago  882 MB
localhost/gentoo-env     latest            1f8f8cfc15d6  18 hours ago  16.1 kB
docker.io/gentoo/stage3  amd64-nomultilib  44d6dff32b7a  34 hours ago  882 MB

... so I guess the question has to be, what are the possible differences between your environment and that of a stock Ubuntu installation (or, indeed, the original Gentoo installations) which cause this to always fail for you, but only fail for Gentoo after podman-3.2.2 (with 3.2.1 working correctly for me) and Ubuntu's podman-3.0.1 working for me (but the RHEL build not for you?!)

@vrothberg
Copy link
Member

Just noticed that I had to change another $docker image build in the init script. I am on it 👍

vrothberg added a commit to vrothberg/common that referenced this issue Jul 16, 2021
Commit bee8cae enforced the pull policy to "always" when a custom
platform was specified.  The reason for always pulling is that many
multi-arch images are broken; wrong configs, wrong platforms, etc.

We cannot perform reliable platform checks.  While we may to have to
revisit this strategy in the future, it is more important to keep
existing workloads running; a bit between a rock and hard place.

This change complements commit bee8cae: if attempt to pull an image
that resolves to "localhost/", set the pull policy "newer" instead of
"always" such that the image may be used instead of erroring out.
Ultimately to preserve previous behavior.

Context: containers/podman/issues/10914
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member

@srcshelton thank you again for your great help in debugging the issue. I opened containers/common#679 to fix the issue. I hope to get that backported today to Podman v3.2 (Cc @mheon @rhatdan)

@srcshelton
Copy link
Contributor Author

Phew - I was still kinda worried it was just me 😅

Glad to help!

vrothberg added a commit to vrothberg/common that referenced this issue Jul 16, 2021
Commit bee8cae enforced the pull policy to "always" when a custom
platform was specified.  The reason for always pulling is that many
multi-arch images are broken; wrong configs, wrong platforms, etc.

We cannot perform reliable platform checks.  While we may to have to
revisit this strategy in the future, it is more important to keep
existing workloads running; a bit between a rock and hard place.

This change complements commit bee8cae: if attempt to pull an image
that resolves to "localhost/", set the pull policy "newer" instead of
"always" such that the image may be used instead of erroring out.
Ultimately to preserve previous behavior.

Context: containers/podman/issues/10914
Signed-off-by: Valentin Rothberg <[email protected]>
vrothberg added a commit to vrothberg/common that referenced this issue Jul 16, 2021
Commit bee8cae enforced the pull policy to "always" when a custom
platform was specified.  The reason for always pulling is that many
multi-arch images are broken; wrong configs, wrong platforms, etc.

We cannot perform reliable platform checks.  While we may to have to
revisit this strategy in the future, it is more important to keep
existing workloads running; a bit between a rock and hard place.

This change complements commit bee8cae: if attempt to pull an image
that resolves to "localhost/", set the pull policy "newer" instead of
"always" such that the image may be used instead of erroring out.
Ultimately to preserve previous behavior.

Context: containers/podman/issues/10914
Signed-off-by: Valentin Rothberg <[email protected]>
vrothberg added a commit to vrothberg/common that referenced this issue Jul 16, 2021
Commit bee8cae enforced the pull policy to "always" when a custom
platform was specified.  The reason for always pulling is that many
multi-arch images are broken; wrong configs, wrong platforms, etc.

We cannot perform reliable platform checks.  While we may to have to
revisit this strategy in the future, it is more important to keep
existing workloads running; a bit between a rock and hard place.

This change complements commit bee8cae: if attempt to pull an image
that resolves to "localhost/", set the pull policy "newer" instead of
"always" such that the image may be used instead of erroring out.
Ultimately to preserve previous behavior.

Context: containers/podman/issues/10914
Signed-off-by: Valentin Rothberg <[email protected]>
vrothberg added a commit to vrothberg/common that referenced this issue Jul 16, 2021
* pull with custom platform: handle "localhost/"
  (containers/podman/issues/10914)

Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member

This is now fixed in the main branch and was backported to v3.2.3.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

3 participants