nginx-container
nginx-container copied to clipboard
pull access denied for rhscl/s2i-core-rhel7
I wasn't able to build on my Ubuntu 18.04 LTS. How can I change default registry from hub.docker.com to registry.access.redhat.com?
Here are the messages I got when running make build TARGET=centos7 VERSIONS=1.12 command.
$ make build TARGET=rhel7 VERSIONS=1.12
make[1]: Entering directory '/home/will/build/nginx-container'
VERSION="1.12" SKIP_SQUASH=0 UPDATE_BASE= OS=rhel7 CLEAN_AFTER= DOCKER_BUILD_CONTEXT=. OPENSHIFT_NAMESPACES="" CUSTOM_REPO="" /usr/bin/env bash common/build.sh
-> Version 1.12: building image from 'Dockerfile.rhel7' ...
Sending build context to Docker daemon 57.86kB
Step 1/15 : FROM rhscl/s2i-core-rhel7:1
pull access denied for rhscl/s2i-core-rhel7, repository does not exist or may require 'docker login'
common/common.mk:75: recipe for target '1.12' failed
make[1]: *** [1.12] Error 1
make[1]: Leaving directory '/home/will/build/nginx-container'
common/common.mk:64: recipe for target 'build-serial' failed
make: *** [build-serial] Error 2
Not sure how it is done on Ubuntu, but on my Fedora, you can change the order of the registries in config files under /etc/containers/.
For all the Dockerfile example in this repo are all using FROM rhscl/s2i-core-rhel7:1 which means use registry.access.redhat.com by default. How is that possible for everyone? Is this mean Red Hat provide a "RedHat"-specific docker client version?
That's true that RHEL-7 includes a docker daemon with a correct configuration already, so it works there out of the box. Anyway, this is an interesting issue, because if we included full registry url in FROM clause (FROM registry.access.redhat.com/rhscl/s2i-core-rhel7:1), then we would miss ability to builds with pre-release version of the rhscl/s2i-core-rhel7 image, that we have available only locally. I'm not entirely sure whether this is a valid use case though.
Anyway, just as a brainstorming -- what if the make build changed the FROM by default to include the full registry url, then it would work out of the box for all.
However, as we haven't heard this kind of feedback yet, I'm not sure how common problem it is, whether we shouldn't rather just document what is expected to do on non-RHEL distros, because the parent image retrieval is not the only problem -- once you get it, you'll see another issue which is missing repositories. Building RHEL-7 images is only working on RHEL-7 host, because the subscription is inherited to the container and without subscription, you cannot retrieve the RHEL RPMs. So the recommendation would probably be: run RHEL-7 VM, subscribe it and then the building should work out of the box (because the default registry is the registry.access.redhat.com).
Closing this issue as it is not valid.
You can use either quay.io/nginx image like here: https://quay.io/repository/sclorg/nginx-124-c9s or login to RedHat Certified catalog and you will be able to pull this image.
Feel free to reopen this issue in case of any problems or even file a new PR.