5

I have configured Subuid and Subgid after installing Podman in RHEL7

I have created a simple Dockerfile to print hello world and was trying to build the image. My Dockerfile

FROM alpine
CMD ["echo", "Hello World"]

To test I am running below command

Podman build -t imagename .

I see the below error received.

STEP 1: FROM alpine
Error: error creating build container: The following failures happened while trying to pull image specified by "alpine" based on search registries in /etc/containers/registries.conf:
* "localhost/alpine": Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get https://localhost/v2/: dial tcp [::1]:443: connect: connection refused
* "registry.access.redhat.com/alpine": Error initializing source docker://registry.access.redhat.com/alpine:latest: error pinging docker registry registry.access.redhat.com: Get https://registry.access.redhat.com/v2/: read tcp 10.70.85.174:17758->23.54.147.129:443: read: connection reset by peer
* "registry.redhat.io/alpine": Error initializing source docker://registry.redhat.io/alpine:latest: error pinging docker registry registry.redhat.io: Get https://registry.redhat.io/v2/: read tcp 10.70.85.174:36028->104.79.150.216:443: read: connection reset by peer
* "docker.io/library/alpine": Error initializing source docker://alpine:latest: error pinging docker registry registry-1.docker.io: Get https://registry-1.docker.io/v2/: read tcp 10.70.85.174:53352->18.213.137.78:443: read: connection reset by peer

Am I missing any configuration ?

Thanks

BMitch
  • 231,797
  • 42
  • 475
  • 450
user804401
  • 1,990
  • 9
  • 38
  • 71

2 Answers2

0

I suggest that you first search your image in registries

podman search alpine

you should get a list of images available. Choose the one you want - version, name, tag etc and put that in the dockerfile.

to be sure it is accessible, do the 'pull' manually

podman pull alpine<version,tag>
Petronella
  • 2,327
  • 1
  • 15
  • 24
  • I tried what you have said, it give me more error ERRO[0001] error searching registry "registry.access.redhat.com": couldn't search registry "registry.access.redhat.com": error pinging docker registry registry.access.redhat.com: Get https://registry.access.redhat.com/v2/: read tcp 10.xxx:32528->xxx:443: read: connection reset by peer, error searching registry "docker.io": couldn't search registry "docker.io": error pinging docker registry index.docker.io: Get https://index.docker.io/v2/: read tcp x.x.x.:51053->3x.x.x.:443: read: error pinging docker registry – user804401 Feb 22 '21 at 14:07
  • Should I be configuring any localhost registry by updating registries conf ? – user804401 Feb 22 '21 at 14:09
  • ok, then you really have an issue with connecting to the registry. on some systems the registries configuration is in '/etc/containers/registries.conf' . On what system are you? VM from Red Hat? If you are not administrating the system, I would advise you to contact the administrator and relate the problem. – Petronella Feb 22 '21 at 14:26
0

Have you still the docket Daemon running and/or docker installed?

First stop the docker Daemon

 sudo systemctl stop docker 

OR

 sudo service docker stop

Then uninstall docker Ubuntu here but what ever you need you can Google :D

sudo apt-get remove docker docker-engine docker.io containerd runc

Try again,

If other fail now try a refreshed install of podman

sudo --reinstall install podman

Sources

https://www.cyberciti.biz/faq/debian-ubuntu-linux-reinstall-a-package-using-apt-get-command/
https://askubuntu.com/questions/935569/how-to-completely-uninstall-docker
https://intellipaat.com/community/43965/how-to-stop-docker
https://podman.io/getting-started/installation
BobMonk
  • 178
  • 1
  • 10
  • Thanks for your comment, but what is the need to stop docker and uninstall it ? Cant we have Podman also when Docker is running ? – user804401 Feb 23 '21 at 04:52
  • It is perfectly possible to use and have docker plus postman side by side. Kinda no need though as podman has more to it and is safer. The images, although docker and podman can use the same images, they do store them in different places and can get a tad confusing. Having the docker daemon running us the main culprit. – BobMonk Feb 24 '21 at 00:28
  • https://developers.redhat.com/blog/2019/02/21/podman-and-buildah-for-docker-users/ – BobMonk Feb 24 '21 at 00:35
  • Ok Bob, I will try your suggestion and let you know – user804401 Feb 24 '21 at 04:19
  • I have uninstalled Docker and reinstalled Podman, Now I face a new err podman build -t podmanimg1 . STEP 1: FROM registry.access.redhat.com/rhel7/rhel Getting image source signatures .... Storing signatures Error: error creating build container: Error committing the finished image: error adding layer with blob "sha256:b8e505a039d6d08bfb73": Error processing tar file(exit status 1): there might not be enough IDs available in the namespace (requested 192:192 for /run/systemd/netif): lchown /run/systemd/netif: invalid argument – user804401 Feb 24 '21 at 14:39
  • I did configure Subuid and Subgid – user804401 Feb 24 '21 at 14:40
  • Hi Bob, I see that this issue occurs only for LDAP users. We tried in a non LDAP user LINUX VM and see Podman works perfectly. The issue is with LDAP linked accounts. Do you have any idea if we can have Podman for LDAP users – user804401 Feb 25 '21 at 07:08