containers / containers/podman-py

[RFE] login with client inside a container when host socket is mounted

Open
#628 9 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
381
Forks
140
Avg merge
5h 30m
Merged PRs (30d)
1

Description

Hi all,
I'm trying to build images with podman-py but can't use base images from a private registry, despite pulling them work after login.
Note: this is done inside a container started with "--userns=keep-id" and -v "/run/user/XXX/podman/podman.sock:/run/podman/podman.sock:z"

```python
import podman
client = podman.PodmanClient(base_url="/run/podman/podman.sock")
client.login(registry='my_private_reg', username=..., password=...)
client.images.pull('my_private_reg/docker/python:3.14') # Works as expected
# Dockerfile contains "FROM my_private_reg/docker/python:3.12"
client.images.build(dockerfile='Dockerfile', ...) # Fails
```
Error message:
```
podman.errors.exceptions.BuildError: creating build container: initializing source docker://my_private_reg/docker/python:3.12: reading manifest 3.12 in my_private_reg/docker/python: unauthorized: The client does not have permission for manifest: Download request for repo:path 'docker-cache:python/3.12/list.manifest.json' is forbidden for user: 'anonymous'.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.