Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
podman multi stage build is failing and giving below error :
Error: error creating build container: pull policy is always but image has been referred to by ID
Version-Release number of selected component (if applicable):
podman-3.2.3-0.11.module+el8.4.0+12050+ef972f71.x86_64
How reproducible:
Fully reproducible
Steps to Reproduce:
Dockerfile
-------------------
FROM ubuntu:focal as deployer
FROM ubi8/ubi:latest as builder
FROM deployer
-------------------
Build Command : podman build -f Dockerfile . --force-rm --no-cache --pull
Actual results:
Build fails
Expected results:
Successful Build
Additional info:
----------------------------------
func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullPolicy, options *PullOptions) ([]*Image, error) {
logrus.Debugf("Pulling image %s (policy: %s)", name, pullPolicy)
if options == nil {
options = &PullOptions{}
}
var possiblyUnqualifiedName string // used for short-name resolution
ref, err := alltransports.ParseImageName(name)
if err != nil {
// If the image clearly refers to a local one, we can look it up directly.
// In fact, we need to since they are not parseable
if strings.HasPrefix(name, "sha256:") || (len(name) == 64 && !strings.ContainsAny(name, "/.:@")) {
if pullPolicy == config.PullPolicyAlways {
return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", name)
}
// If we looked up the image by ID, we cannot really pull from anywhere.
if localImage != nil && strings.HasPrefix(localImage.ID(), imageName) {
switch pullPolicy {
case config.PullPolicyAlways:
return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", imageName)
default:
return []string{resolvedImageName}, nil
--------------------------------------
The commit Valentin points to in https://bugzilla.redhat.com/show_bug.cgi?id=2018949#c4 was in 1.22, but not 1.21, which is what podman 3.2 used. podman 3.3 used buildah 1.23, so this should be fixed in podman 3.3 or later.
Thanks Nalin, we have podman-3.3.x in 8.5 which is about to get released now. Targeting 8.6 then to not to miss QE on this one.
Can we get qa ack please?
Can reproduce with podman-3.2.3-0.11.module+el8.4.0+12050+ef972f71.x86_64.
And test with podman-3.4.5-0.4.module+el8.6.0+13880+7c3afcf8.x86_64 the build process works well as expected. So set this to verified. Details:
# podman build -f Dockerfile . --force-rm --no-cache --pull
[1/3] STEP 1/1: FROM quay.io/libpod/busybox:latest AS deployer
Trying to pull quay.io/libpod/busybox:latest...
Getting image source signatures
Copying blob 9758c28807f2 skipped: already exists
Copying config f0b02e9d09 done
Writing manifest to image destination
Storing signatures
--> f0b02e9d092
[2/3] STEP 1/1: FROM ubi8/ubi:latest AS builder
Trying to pull registry.access.redhat.com/ubi8/ubi:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob adffa6963146 skipped: already exists
Copying blob 26f1167feaf7 skipped: already exists
Copying config fca12da1dc done
Writing manifest to image destination
Storing signatures
--> fca12da1dc3
[3/3] STEP 1/1: FROM f0b02e9d092d905d0d87a8455a1ae3e9bb47b4aa3dc125125ca5cd10d6441c9f
[3/3] COMMIT
--> f0b02e9d092
f0b02e9d092d905d0d87a8455a1ae3e9bb47b4aa3dc125125ca5cd10d6441c9f
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Important: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2022:1762
Description of problem: podman multi stage build is failing and giving below error : Error: error creating build container: pull policy is always but image has been referred to by ID Version-Release number of selected component (if applicable): podman-3.2.3-0.11.module+el8.4.0+12050+ef972f71.x86_64 How reproducible: Fully reproducible Steps to Reproduce: Dockerfile ------------------- FROM ubuntu:focal as deployer FROM ubi8/ubi:latest as builder FROM deployer ------------------- Build Command : podman build -f Dockerfile . --force-rm --no-cache --pull Actual results: Build fails Expected results: Successful Build Additional info: ---------------------------------- func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullPolicy, options *PullOptions) ([]*Image, error) { logrus.Debugf("Pulling image %s (policy: %s)", name, pullPolicy) if options == nil { options = &PullOptions{} } var possiblyUnqualifiedName string // used for short-name resolution ref, err := alltransports.ParseImageName(name) if err != nil { // If the image clearly refers to a local one, we can look it up directly. // In fact, we need to since they are not parseable if strings.HasPrefix(name, "sha256:") || (len(name) == 64 && !strings.ContainsAny(name, "/.:@")) { if pullPolicy == config.PullPolicyAlways { return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", name) } // If we looked up the image by ID, we cannot really pull from anywhere. if localImage != nil && strings.HasPrefix(localImage.ID(), imageName) { switch pullPolicy { case config.PullPolicyAlways: return nil, errors.Errorf("pull policy is always but image has been referred to by ID (%s)", imageName) default: return []string{resolvedImageName}, nil --------------------------------------