containers / containers/podman-py
[RFE] login with client inside a container when host socket is mounted
- 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
Assessment
This issue has not been assessed yet.