Search code examples
dockerpodman

How to perform podman login inside a docker container?


I am trying to use podman inside a docker container, with no intention to run containers. podman will be used only for login, pull and push.

I am using python:3.7-bullseye docker image, and install the following packages:

RUN apt-get -y install runc
RUN apt-get -y install podman

Post install, podman is working and accessible:

root@992b0476dcf2:~# podman ps
CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
root@992b0476dcf2:~# podman version
Version:      3.0.1
API Version:  3.0.0
Go Version:   go1.15.9
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/amd64

When I try to perform a podman login, I get errored as below:

root@992b0476dcf2:~# podman login my-special-registry:8080
Username: my-special-user
Password:
Error: error authenticating creds for "my-special-registry:8080": error creating new docker client: readdirent: not a directory

Could someone please help in explaining what is the path being referenced here which is not a directory?


Solution

  • The error message was a bit misleading. After spending a few hours on this, figured out the issue was because of a badly formatted ca-certificate which I placed on the /etc/containers path.

    It may help to add --log-level=debug to pinpoint issues related to podman.