-
Notifications
You must be signed in to change notification settings - Fork 751
Closed
Description
The problem
When building add-ons that use a base image from a private registry, the build fails because credentials are not passed to the build process.
Current behavior
- User configures registry credentials via the Supervisor API (
/docker/registries) - Credentials are stored in Supervisor's own config file (
docker.json), NOT in~/.docker/config.json - When building an add-on with a private base image:
- Build runs
docker buildx build --pullinside a Docker-in-Docker container - The Docker socket is mounted, using the host's Docker daemon
- BuildKit attempts to pull the base image but has no access to credentials
- Build fails with authentication error
- Build runs
Root cause
In supervisor/addons/build.py, the get_docker_args() method constructs the build command but doesn't pass any credentials:
return {
"command": build_cmd,
"volumes": {
SOCKET_DOCKER: {"bind": "/var/run/docker.sock", "mode": "rw"},
addon_extern_path: {"bind": "/addon", "mode": "ro"},
},
"working_dir": "/addon",
}Possible solutions
- Use BuildKit secrets: Pass credentials via
--secretflag todocker buildx build - Mount docker config: Generate a temporary
config.jsonwith credentials and mount it - Use
docker loginbefore build: Rundocker logininside the build container before building
Related
This is related to #6345 which fixed the install/update path for private registries. The build path has the same underlying issue but requires a different solution.
Environment
- Supervisor version: all versions with build support
- This is a pre-existing issue, not a regression
Metadata
Metadata
Assignees
Labels
No labels