Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: imgutil.GetRemoteImage does not take ENVBUILDER_DOCKER_CONFIG_BASE64 into account #77

Open
johnstcn opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@johnstcn
Copy link
Member

johnstcn commented Jan 20, 2025

Problem

When using envbuilder_cached_image with a cache repo requiring authentication and passing ENVBUILDER_DOCKER_CONFIG_BASE64 into the provider:

Failed to find cached image in repository "docker.local". It will be rebuilt in the next apply. Error: failed to fetch the envbuilder binary from the builder image: check remote image: check remote image: GET http://docker.local/v2/envbuilder/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:envbuilder Type:repository]]

This is assuming that the underlying Coder / Coder Provisioner deployment does not have the same image pull secret mounted and does not have DOCKER_CONFIG=path/to/config.json set in its env.

Workaround

Mount the same registry credential on the Coder deployment and set DOCKER_CONFIG=path/to/config.json

Proposed Solution

The Terraform provider should also take the base64-encoded docker config JSON into account when attempting to fetch the Envbuilder binary from the source image.

cc @bjornrobertsson

@johnstcn johnstcn added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant