-
Notifications
You must be signed in to change notification settings - Fork 2
Pass UV_EXTRA_INDEX_URL to docker build #244
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
base: main
Are you sure you want to change the base?
Conversation
|
@gesta81, welcome to this project! Please have a look at the feedback of our brutal ci/cd (which may also need an update) |
… into docker-build-use-uv-extra-index
Thank you. Sorry original commit was missing a line - hopefully fixed now. |
|
@HarryCampion @gesta81 I don't understand why we need to inject an environment variable as a secret into a docker image. Why would the extra_index_url be a secret in the first place? I understand it could be done like this but is this good practice? @gesta81 I am really sorry. I am not an expert and rarely use the extra_index_url at all. Please tell me I am wrong! |
UV_EXTRA_INDEX_URL might contain a PAT to the artifact feed. My preference here is we go with I am not overly keen on passing round UV_EXTRA_INDEX_URL as it can cause some unwanted side effects but not sure if we are able to make use of uv auth login in GitHub workflows. The preference is to always be very explicit in the pyproject.toml about where the package is coming from if not pypi. See below https://docs.astral.sh/uv/concepts/indexes/#defining-an-index Oh and yes welcome @gesta81 😄! |
So an example might be that your docker build fails because your uv.lock is referencing a package from a private feed. The build will use uv sync --frozen to guarantee runtime conditions but if the artifact feed is not reachable due to a token not being present in the context then the build will fail. |
|
Sounds to me you should first experiment with uv auth login. Do you have a problem at hand for this? I see the Dockerfile as some example. More advanced users can use their very own version and do not update using rhiza. So let's not go too wild |
No description provided.