Bug 1884040

Summary: docker.io/centos mentioned in "Custom image builds with Buildah" is not s390x compatible
Product: OpenShift Container Platform Reporter: Tom Dale <tdale>
Component: DocumentationAssignee: Silke Niemann <sniemann>
Status: CLOSED CURRENTRELEASE QA Contact: Xiaoli Tian <xtian>
Severity: unspecified Docs Contact: Vikram Goyal <vigoyal>
Priority: unspecified    
Version: 4.5CC: adam.kaplan, aos-bugs, cfillekes, danili, jokerman, sniemann, tdale
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-22 14:50:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1905187    

Description Tom Dale 2020-09-30 20:09:00 UTC
Document URL: https://docs.openshift.com/container-platform/4.5/builds/custom-builds-buildah.html

Section Number and Name: "Creating custom build artifacts" procedure step 1

Describe the issue: Procedure starts with a Dockerfile using FROM docker.io/centos:7 . Centos images are not available for ibm-Z. 

Suggestions for improvement: Either another base image like ubi should be references, or a note should be included that this procedure does not work on IBM Z architecture.

Comment 1 Dan Li 2020-11-11 21:27:09 UTC
Hi Tom, is this a documentation issue? Seems like an image related bug

Comment 2 Tom Dale 2020-11-11 21:50:50 UTC
Dan, yes I think it is a documentation issue as centos is not s390x compatible that I'm aware of. Could this procedure be changed to use ubi?

Comment 3 Tom Dale 2020-11-18 19:58:55 UTC
Using docker.io/fedora:32 should work on both x86 and s390x (verified that it does work as image base for s390x). Can we change the documentation here to use fedora rather than centos? We could of course also use ubi, but then the user has to us rhsm in order to yum install buildah.

Comment 4 Adam Kaplan 2021-02-25 13:53:08 UTC
I helped write the original docs, which were written when OCP 4.0 was getting ready for release. At the time we didn't have a productized container image for buildah or UBI8. Now that

a) We have container images for UBI8 and buildah in the Red Hat Container catalog, and
b) Docker Hub now rate limits anonymous image pulls

we should remove docker.io image references to the furthest extent possible.

In the create custom build artifact section [1]:

1. Step 1 should just have a Dockerfile with registry.redhat.io/rhel8/buildah as the base image. The "Example output" header does not make any sense.

```
FROM registry.redhat.io/rhel8/buildah

# In this example, `/tmp/build` contains the inputs that build when this
# custom builder image is run. Normally the custom builder image fetches
# this content from some location at build time, by using git clone as an example.
ADD dockerfile.sample /tmp/input/dockerfile
ADD build.sh /usr/bin
RUN chmod a+x /usr/bin/build.sh
# /usr/bin/build.sh contains the actual custom build logic that will be run when
# this custom builder image is run.
ENTRYPOINT ["/usr/bin/build.sh"]
```

2. Step 2 - dockerfile.sample should have UBI8 as the base image

```
FROM registry.redhat.io/ubi8/ubi
RUN touch /tmp/built
```


[1] https://docs.openshift.com/container-platform/4.5/builds/custom-builds-buildah.html#builds-create-custom-build-artifacts_custom-builds-buildah

Comment 5 Tom Dale 2021-02-25 14:48:22 UTC
registry.redhat.io/rhel8/buildah is s390x compatible and solves this problem. Thanks Adam!

Comment 6 Tom Dale 2021-02-25 14:49:13 UTC
registry.redhat.io/rhel8/buildah is s390x compatible and solves this problem. Thanks Adam!

Comment 7 Silke Niemann 2021-03-26 13:00:12 UTC
Create a docs PR: https://github.com/openshift/openshift-docs/pull/30985

Comment 8 Dan Li 2021-04-01 13:49:12 UTC
Re-assigning to Silke since she has created the PR to fix the bug. Please re-assign if others should take this bug.