docker-pull: support pulling private images via ~/.docker/config.json#2127
Open
aleshorvat wants to merge 2 commits intogetumbrel:masterfrom
Open
docker-pull: support pulling private images via ~/.docker/config.json#2127aleshorvat wants to merge 2 commits intogetumbrel:masterfrom
aleshorvat wants to merge 2 commits intogetumbrel:masterfrom
Conversation
…g.json Dockerode sends unauthenticated API calls to the Docker Engine, so community app store apps that use private registry images (e.g. ghcr.io) fail with 401 Unauthorized even when the host has valid credentials. Add getAuthConfig() which reads /root/.docker/config.json (umbreld runs as root) and extracts the authconfig for the target registry. The config is passed to docker.pull() so private images are pulled with the same credentials that `docker login` stored on the host. Falls back to unauthenticated pull (existing behaviour) if: - /root/.docker/config.json does not exist - No entry found for the target registry - Any error occurs during config read Tested with private ghcr.io images on UmbrelOS 1.x. fs-extra is already a dependency of umbreld — no new packages required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Community app store apps that use private container registry images (e.g.
ghcr.io) currently fail to install with a 401 Unauthorized error. Thepull()function indocker-pull.tsuses Dockerode without authentication, so private images cannot be pulled even when the host has valid credentials stored in~/.docker/config.json.Root cause
docker.pull(image, callback)calls the Docker Engine API directly via Dockerode without passing auth credentials. The Docker CLI reads~/.docker/config.jsonautomatically, but Dockerode does not — it must be given an explicitauthconfigobject.umbreld runs as
root, so credentials stored viadocker loginland in/root/.docker/config.json. Dockerode never reads this file, so all pulls of private images fail regardless of whether the user has logged in on the host.Fix
Before calling
docker.pull(), read/root/.docker/config.jsonand extract the credentials for the target registry. Pass them asauthconfigtodocker.pull(). If the file is missing, the registry entry is absent, or any error occurs, the pull proceeds unauthenticated — no regression for public images.Registry detection logic:
.or:(e.g.ghcr.io,registry.example.com:5000) → use it as the registry keyhttps://index.docker.io/v1/)Current limitation
Private registry images cannot be pulled through the Umbrel UI even when the host has valid credentials. To observe this:
ghcr.io/owner/app:latest)Error: (HTTP code 401) unexpected - unauthorizedDespite the host having valid credentials, umbreld's Dockerode-based pull sends no auth headers to the registry.
How to configure credentials on the Umbrel host
SSH into the Umbrel device and log in to the private registry once:
This writes credentials to
/root/.docker/config.json(umbreld runs as root). After that, any community app using a private image from that registry will install without further configuration.Notes
fs-extrais already a dependency of umbreld — no new packages requiredghcr.ioimagespull()function is changed —pullAll()is unaffected as it delegates topull()Changed file
packages/umbreld/source/modules/utilities/docker-pull.ts