1

I am able to install my python package from GCP Artifactory.

Authenticate to GCP.

% gcloud auth application-default login
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=XXXYYY
Credentials saved to file: 

[/Users/home/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests Application Default Credentials (ADC).

Quota project "PROJECTID" was added to ADC which can be used by Google client libraries for billing and quota. Note that some services may still bill the project owning the resource.

Then create Virtual env and install packages.

% cd /tmp
% python -m venv venv
% /tmp/venv/bin/pip install keyrings.google-artifactregistry-auth
...
...
% /tmp/venv/bin/pip install --extra-index-url https://us-central1-python.pkg.dev/<PROJECTID>/<PYPIREGISTRY>/simple/ my_core==0.1.14
Looking in indexes: https://pypi.org/simple, https://us-central1-python.pkg.dev/<PROJECTID>/<PYPIREGISTRY>/simple/
Collecting my_core==0.1.14
  Downloading https://us-central1-python.pkg.dev/<PROJECTID>/<PYPIREGISTRY>/my-core/my_core-0.1.14-py3-none-any.whl (32 kB)
Collecting openai (from my_core==0.1.14)
  Using cached openai-1.101.0-py3-none-any.whl.metadata (29 kB)
Collecting faiss-cpu (from my_core==0.1.14)
  Using cached faiss_cpu-1.12.0-cp311-cp311-macosx_14_0_arm64.whl.metadata (5.1 kB)
Collecting networkx (from my_core==0.1.14)
  Using cached networkx-3.5-py3-none-any.whl.metadata (6.3 kB)
Collecting numpy (from my_core==0.1.14)
  Using cached numpy-2.3.2-cp311-cp311-macosx_14_0_arm64.whl.metadata (62 kB)
Collecting scipy (from my_core==0.1.14)
  Using cached scipy-1.16.1-cp311-cp311-macosx_14_0_arm64.whl.metadata (61 kB)
Collecting torch (from my_core==0.1.14)
  Using cached torch-2.8.0-cp311-none-macosx_11_0_arm64.whl.metadata (30 kB)
Collecting dotenv (from my_core==0.1.14)
  Using cached dotenv-0.9.9-py2.py3-none-any.whl.metadata (279 bytes)
Collecting transformers (from my_core==0.1.14)
  Using cached transformers-4.55.3-py3-none-any.whl.metadata (41 kB)
Collecting vadersentiment (from my_core==0.1.14)
  Using cached vaderSentiment-3.3.2-py2.py3-none-any.whl.metadata (572 bytes)
Collecting langdetect (from my_core==0.1.14)
  Using cached langdetect-1.0.9-py3-none-any.whl
Collecting python-dateutil (from my_core==0.1.14)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting fuzzywuzzy (from my_core==0.1.14)
  Using cached fuzzywuzzy-0.18.0-py2.py3-none-any.whl.metadata (4.9 kB)
Collecting scikit-learn (from my_core==0.1.14)
  Using cached scikit_learn-1.7.1-cp311-cp311-macosx_12_0_arm64.whl.metadata (11 kB)
Collecting spacy (from my_core==0.1.14)
  Using cached spacy-3.8.7-cp311-cp311-macosx_11_0_arm64.whl.metadata (27 kB)
Collecting python-dotenv (from dotenv->my_core==0.1.14)
  Using cached python_dotenv-1.1.1-py3-none-any.whl.metadata (24 kB)
Collecting packaging (from faiss-cpu->my_core==0.1.14)
  Using cached packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
Collecting six (from langdetect->my_core==0.1.14)
  Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting anyio<5,>=3.5.0 (from openai->my_core==0.1.14)
  Using cached anyio-4.10.0-py3-none-any.whl.metadata (4.0 kB)
Collecting distro<2,>=1.7.0 (from openai->my_core==0.1.14)
  Using cached distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
Collecting httpx<1,>=0.23.0 (from openai->my_core==0.1.14)
  Using cached httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB)
Collecting jiter<1,>=0.4.0 (from openai->my_core==0.1.14)
  Using cached jiter-0.10.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (5.2 kB)
Collecting pydantic<3,>=1.9.0 (from openai->my_core==0.1.14)
  Using cached pydantic-2.11.7-py3-none-any.whl.metadata (67 kB)
Collecting sniffio (from openai->my_core==0.1.14)
  Using cached sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Collecting tqdm>4 (from openai->my_core==0.1.14)
  Using cached tqdm-4.67.1-py3-none-any.whl.metadata (57 kB)
Collecting typing-extensions<5,>=4.11 (from openai->my_core==0.1.14)
  Using cached typing_extensions-4.14.1-py3-none-any.whl.metadata (3.0 kB)
Collecting joblib>=1.2.0 (from scikit-learn->my_core==0.1.14)
  Using cached joblib-1.5.1-py3-none-any.whl.metadata (5.6 kB)
Collecting threadpoolctl>=3.1.0 (from scikit-learn->my_core==0.1.14)
  Using cached threadpoolctl-3.6.0-py3-none-any.whl.metadata (13 kB)
Collecting spacy-legacy<3.1.0,>=3.0.11 (from spacy->my_core==0.1.14)
  Using cached spacy_legacy-3.0.12-py2.py3-none-any.whl.metadata (2.8 kB)
Collecting spacy-loggers<2.0.0,>=1.0.0 (from spacy->my_core==0.1.14)
  Using cached spacy_loggers-1.0.5-py3-none-any.whl.metadata (23 kB)
Collecting murmurhash<1.1.0,>=0.28.0 (from spacy->my_core==0.1.14)
  Using cached murmurhash-1.0.13-cp311-cp311-macosx_11_0_arm64.whl.metadata (2.2 kB)
Collecting cymem<2.1.0,>=2.0.2 (from spacy->my_core==0.1.14)
  Using cached cymem-2.0.11-cp311-cp311-macosx_11_0_arm64.whl.metadata (8.5 kB)
Collecting preshed<3.1.0,>=3.0.2 (from spacy->my_core==0.1.14)
  Using cached preshed-3.0.10-cp311-cp311-macosx_11_0_arm64.whl.metadata (2.4 kB)
Collecting thinc<8.4.0,>=8.3.4 (from spacy->my_core==0.1.14)
  Using cached thinc-8.3.6-cp311-cp311-macosx_11_0_arm64.whl.metadata (15 kB)
Collecting wasabi<1.2.0,>=0.9.1 (from spacy->my_core==0.1.14)
  Using cached wasabi-1.1.3-py3-none-any.whl.metadata (28 kB)
Collecting srsly<3.0.0,>=2.4.3 (from spacy->my_core==0.1.14)
  Using cached srsly-2.5.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting catalogue<2.1.0,>=2.0.6 (from spacy->my_core==0.1.14)
  Using cached catalogue-2.0.10-py3-none-any.whl.metadata (14 kB)
Collecting weasel<0.5.0,>=0.1.0 (from spacy->my_core==0.1.14)
  Using cached weasel-0.4.1-py3-none-any.whl.metadata (4.6 kB)
Collecting typer<1.0.0,>=0.3.0 (from spacy->my_core==0.1.14)
  Using cached typer-0.16.1-py3-none-any.whl.metadata (15 kB)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /private/tmp/venv/lib/python3.11/site-packages (from spacy->my_core==0.1.14) (2.32.5)
Collecting jinja2 (from spacy->my_core==0.1.14)
  Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Requirement already satisfied: setuptools in /private/tmp/venv/lib/python3.11/site-packages (from spacy->my_core==0.1.14) (74.1.2)
Collecting langcodes<4.0.0,>=3.2.0 (from spacy->my_core==0.1.14)
  Using cached langcodes-3.5.0-py3-none-any.whl.metadata (29 kB)
Collecting filelock (from torch->my_core==0.1.14)
  Using cached filelock-3.19.1-py3-none-any.whl.metadata (2.1 kB)
Collecting sympy>=1.13.3 (from torch->my_core==0.1.14)
  Using cached sympy-1.14.0-py3-none-any.whl.metadata (12 kB)
Collecting fsspec (from torch->my_core==0.1.14)
  Using cached fsspec-2025.7.0-py3-none-any.whl.metadata (12 kB)
Collecting huggingface-hub<1.0,>=0.34.0 (from transformers->my_core==0.1.14)
  Using cached huggingface_hub-0.34.4-py3-none-any.whl.metadata (14 kB)
Collecting pyyaml>=5.1 (from transformers->my_core==0.1.14)
  Using cached PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl.metadata (2.1 kB)
Collecting regex!=2019.12.17 (from transformers->my_core==0.1.14)
  Using cached regex-2025.7.34-cp311-cp311-macosx_11_0_arm64.whl.metadata (40 kB)
Collecting tokenizers<0.22,>=0.21 (from transformers->my_core==0.1.14)
  Using cached tokenizers-0.21.4-cp39-abi3-macosx_11_0_arm64.whl.metadata (6.7 kB)
Collecting safetensors>=0.4.3 (from transformers->my_core==0.1.14)
  Using cached safetensors-0.6.2-cp38-abi3-macosx_11_0_arm64.whl.metadata (4.1 kB)
Requirement already satisfied: idna>=2.8 in /private/tmp/venv/lib/python3.11/site-packages (from anyio<5,>=3.5.0->openai->my_core==0.1.14) (3.10)
Requirement already satisfied: certifi in /private/tmp/venv/lib/python3.11/site-packages (from httpx<1,>=0.23.0->openai->my_core==0.1.14) (2025.8.3)
Collecting httpcore==1.* (from httpx<1,>=0.23.0->openai->my_core==0.1.14)
  Using cached httpcore-1.0.9-py3-none-any.whl.metadata (21 kB)
Collecting h11>=0.16 (from httpcore==1.*->httpx<1,>=0.23.0->openai->my_core==0.1.14)
  Using cached h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
Collecting hf-xet<2.0.0,>=1.1.3 (from huggingface-hub<1.0,>=0.34.0->transformers->my_core==0.1.14)
  Using cached hf_xet-1.1.8-cp37-abi3-macosx_11_0_arm64.whl.metadata (703 bytes)
Collecting language-data>=1.2 (from langcodes<4.0.0,>=3.2.0->spacy->my_core==0.1.14)
  Using cached language_data-1.3.0-py3-none-any.whl.metadata (4.3 kB)
Collecting annotated-types>=0.6.0 (from pydantic<3,>=1.9.0->openai->my_core==0.1.14)
  Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.33.2 (from pydantic<3,>=1.9.0->openai->my_core==0.1.14)
  Using cached pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl.metadata (6.8 kB)
Collecting typing-inspection>=0.4.0 (from pydantic<3,>=1.9.0->openai->my_core==0.1.14)
  Using cached typing_inspection-0.4.1-py3-none-any.whl.metadata (2.6 kB)
Requirement already satisfied: charset_normalizer<4,>=2 in /private/tmp/venv/lib/python3.11/site-packages (from requests<3.0.0,>=2.13.0->spacy->my_core==0.1.14) (3.4.3)
Requirement already satisfied: urllib3<3,>=1.21.1 in /private/tmp/venv/lib/python3.11/site-packages (from requests<3.0.0,>=2.13.0->spacy->my_core==0.1.14) (2.5.0)
Collecting mpmath<1.4,>=1.1.0 (from sympy>=1.13.3->torch->my_core==0.1.14)
  Using cached mpmath-1.3.0-py3-none-any.whl.metadata (8.6 kB)
Collecting blis<1.4.0,>=1.3.0 (from thinc<8.4.0,>=8.3.4->spacy->my_core==0.1.14)
  Using cached blis-1.3.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (7.4 kB)
Collecting confection<1.0.0,>=0.0.1 (from thinc<8.4.0,>=8.3.4->spacy->my_core==0.1.14)
  Using cached confection-0.1.5-py3-none-any.whl.metadata (19 kB)
Collecting click>=8.0.0 (from typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached click-8.2.1-py3-none-any.whl.metadata (2.5 kB)
Collecting shellingham>=1.3.0 (from typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting rich>=10.11.0 (from typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached rich-14.1.0-py3-none-any.whl.metadata (18 kB)
Collecting cloudpathlib<1.0.0,>=0.7.0 (from weasel<0.5.0,>=0.1.0->spacy->my_core==0.1.14)
  Using cached cloudpathlib-0.21.1-py3-none-any.whl.metadata (14 kB)
Collecting smart-open<8.0.0,>=5.2.1 (from weasel<0.5.0,>=0.1.0->spacy->my_core==0.1.14)
  Using cached smart_open-7.3.0.post1-py3-none-any.whl.metadata (24 kB)
Collecting MarkupSafe>=2.0 (from jinja2->spacy->my_core==0.1.14)
  Using cached MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl.metadata (4.0 kB)
Collecting marisa-trie>=1.1.0 (from language-data>=1.2->langcodes<4.0.0,>=3.2.0->spacy->my_core==0.1.14)
  Using cached marisa_trie-1.3.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (10 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached markdown_it_py-4.0.0-py3-none-any.whl.metadata (7.3 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached pygments-2.19.2-py3-none-any.whl.metadata (2.5 kB)
Collecting wrapt (from smart-open<8.0.0,>=5.2.1->weasel<0.5.0,>=0.1.0->spacy->my_core==0.1.14)
  Using cached wrapt-1.17.3-cp311-cp311-macosx_11_0_arm64.whl.metadata (6.4 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0.0,>=0.3.0->spacy->my_core==0.1.14)
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Using cached dotenv-0.9.9-py2.py3-none-any.whl (1.9 kB)
Using cached faiss_cpu-1.12.0-cp311-cp311-macosx_14_0_arm64.whl (3.4 MB)
Using cached numpy-2.3.2-cp311-cp311-macosx_14_0_arm64.whl (5.4 MB)
Using cached fuzzywuzzy-0.18.0-py2.py3-none-any.whl (18 kB)
Using cached networkx-3.5-py3-none-any.whl (2.0 MB)
Using cached openai-1.101.0-py3-none-any.whl (810 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached scikit_learn-1.7.1-cp311-cp311-macosx_12_0_arm64.whl (8.7 MB)
Using cached scipy-1.16.1-cp311-cp311-macosx_14_0_arm64.whl (20.9 MB)
Using cached spacy-3.8.7-cp311-cp311-macosx_11_0_arm64.whl (6.4 MB)
Using cached torch-2.8.0-cp311-none-macosx_11_0_arm64.whl (73.6 MB)
Using cached transformers-4.55.3-py3-none-any.whl (11.3 MB)
Using cached vaderSentiment-3.3.2-py2.py3-none-any.whl (125 kB)
Using cached anyio-4.10.0-py3-none-any.whl (107 kB)
Using cached catalogue-2.0.10-py3-none-any.whl (17 kB)
Using cached cymem-2.0.11-cp311-cp311-macosx_11_0_arm64.whl (41 kB)
Using cached distro-1.9.0-py3-none-any.whl (20 kB)
Using cached httpx-0.28.1-py3-none-any.whl (73 kB)
Using cached httpcore-1.0.9-py3-none-any.whl (78 kB)
Using cached huggingface_hub-0.34.4-py3-none-any.whl (561 kB)
Using cached fsspec-2025.7.0-py3-none-any.whl (199 kB)
Using cached jiter-0.10.0-cp311-cp311-macosx_11_0_arm64.whl (321 kB)
Using cached joblib-1.5.1-py3-none-any.whl (307 kB)
Using cached langcodes-3.5.0-py3-none-any.whl (182 kB)
Using cached murmurhash-1.0.13-cp311-cp311-macosx_11_0_arm64.whl (26 kB)
Using cached packaging-25.0-py3-none-any.whl (66 kB)
Using cached preshed-3.0.10-cp311-cp311-macosx_11_0_arm64.whl (127 kB)
Using cached pydantic-2.11.7-py3-none-any.whl (444 kB)
Using cached pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB)
Using cached PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl (172 kB)
Using cached regex-2025.7.34-cp311-cp311-macosx_11_0_arm64.whl (285 kB)
Using cached safetensors-0.6.2-cp38-abi3-macosx_11_0_arm64.whl (432 kB)
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
Using cached spacy_legacy-3.0.12-py2.py3-none-any.whl (29 kB)
Using cached spacy_loggers-1.0.5-py3-none-any.whl (22 kB)
Using cached srsly-2.5.1-cp311-cp311-macosx_11_0_arm64.whl (634 kB)
Using cached sympy-1.14.0-py3-none-any.whl (6.3 MB)
Using cached thinc-8.3.6-cp311-cp311-macosx_11_0_arm64.whl (845 kB)
Using cached threadpoolctl-3.6.0-py3-none-any.whl (18 kB)
Using cached tokenizers-0.21.4-cp39-abi3-macosx_11_0_arm64.whl (2.7 MB)
Using cached tqdm-4.67.1-py3-none-any.whl (78 kB)
Using cached typer-0.16.1-py3-none-any.whl (46 kB)
Using cached typing_extensions-4.14.1-py3-none-any.whl (43 kB)
Using cached wasabi-1.1.3-py3-none-any.whl (27 kB)
Using cached weasel-0.4.1-py3-none-any.whl (50 kB)
Using cached filelock-3.19.1-py3-none-any.whl (15 kB)
Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Using cached python_dotenv-1.1.1-py3-none-any.whl (20 kB)
Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Using cached blis-1.3.0-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB)
Using cached click-8.2.1-py3-none-any.whl (102 kB)
Using cached cloudpathlib-0.21.1-py3-none-any.whl (52 kB)
Using cached confection-0.1.5-py3-none-any.whl (35 kB)
Using cached hf_xet-1.1.8-cp37-abi3-macosx_11_0_arm64.whl (2.6 MB)
Using cached language_data-1.3.0-py3-none-any.whl (5.4 MB)
Using cached MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl (12 kB)
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Using cached rich-14.1.0-py3-none-any.whl (243 kB)
Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Using cached smart_open-7.3.0.post1-py3-none-any.whl (61 kB)
Using cached typing_inspection-0.4.1-py3-none-any.whl (14 kB)
Using cached h11-0.16.0-py3-none-any.whl (37 kB)
Using cached marisa_trie-1.3.0-cp311-cp311-macosx_11_0_arm64.whl (158 kB)
Using cached markdown_it_py-4.0.0-py3-none-any.whl (87 kB)
Using cached pygments-2.19.2-py3-none-any.whl (1.2 MB)
Using cached wrapt-1.17.3-cp311-cp311-macosx_11_0_arm64.whl (38 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: mpmath, fuzzywuzzy, cymem, wrapt, wasabi, typing-extensions, tqdm, threadpoolctl, sympy, spacy-loggers, spacy-legacy, sniffio, six, shellingham, safetensors, regex, pyyaml, python-dotenv, pygments, packaging, numpy, networkx, murmurhash, mdurl, MarkupSafe, marisa-trie, joblib, jiter, hf-xet, h11, fsspec, filelock, distro, cloudpathlib, click, catalogue, annotated-types, vadersentiment, typing-inspection, srsly, smart-open, scipy, python-dateutil, pydantic-core, preshed, markdown-it-py, language-data, langdetect, jinja2, huggingface-hub, httpcore, faiss-cpu, dotenv, blis, anyio, torch, tokenizers, scikit-learn, rich, pydantic, langcodes, httpx, typer, transformers, openai, confection, weasel, thinc, spacy, my_core
Successfully installed MarkupSafe-3.0.2 annotated-types-0.7.0 anyio-4.10.0 blis-1.3.0 catalogue-2.0.10 click-8.2.1 cloudpathlib-0.21.1 confection-0.1.5 cymem-2.0.11 distro-1.9.0 dotenv-0.9.9 faiss-cpu-1.12.0 filelock-3.19.1 fsspec-2025.7.0 fuzzywuzzy-0.18.0 h11-0.16.0 hf-xet-1.1.8 httpcore-1.0.9 httpx-0.28.1 huggingface-hub-0.34.4 jinja2-3.1.6 jiter-0.10.0 joblib-1.5.1 langcodes-3.5.0 langdetect-1.0.9 language-data-1.3.0 marisa-trie-1.3.0 markdown-it-py-4.0.0 mdurl-0.1.2 mpmath-1.3.0 murmurhash-1.0.13 networkx-3.5 numpy-2.3.2 openai-1.101.0 my_core-0.1.14 packaging-25.0 preshed-3.0.10 pydantic-2.11.7 pydantic-core-2.33.2 pygments-2.19.2 python-dateutil-2.9.0.post0 python-dotenv-1.1.1 pyyaml-6.0.2 regex-2025.7.34 rich-14.1.0 safetensors-0.6.2 scikit-learn-1.7.1 scipy-1.16.1 shellingham-1.5.4 six-1.17.0 smart-open-7.3.0.post1 sniffio-1.3.1 spacy-3.8.7 spacy-legacy-3.0.12 spacy-loggers-1.0.5 srsly-2.5.1 sympy-1.14.0 thinc-8.3.6 threadpoolctl-3.6.0 tokenizers-0.21.4 torch-2.8.0 tqdm-4.67.1 transformers-4.55.3 typer-0.16.1 typing-extensions-4.14.1 typing-inspection-0.4.1 vadersentiment-3.3.2 wasabi-1.1.3 weasel-0.4.1 wrapt-1.17.3

[notice] A new release of pip is available: 24.2 -> 25.2
[notice] To update, run: python3.11 -m pip install --upgrade pip

When I use same commad in Dockerfile it gives error.

Dockerfile

FROM python:3.12-slim

RUN pip install --upgrade pip keyrings.google-artifactregistry-auth

RUN pip install --extra-index-url https://us-central1-python.pkg.dev/<PROJECTID>/<PYPIREGISTRY>/simple/ my_core==0.1.14

Error

% docker build -t my-backend .
[+] Building 9.0s (6/6) FINISHED                                                                                                                             docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                         0.0s
 => => transferring dockerfile: 257B                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/python:3.12-slim                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                            0.0s
 => => transferring context: 1.03kB                                                                                                                                          0.0s
 => [1/3] FROM docker.io/library/python:3.12-slim                                                                                                                            0.0s
 => CACHED [2/3] RUN pip install --upgrade pip keyrings.google-artifactregistry-auth                                                                                         0.0s
 => ERROR [3/3] RUN pip install --extra-index-url https://us-central1-python.pkg.dev/PROJECTID/PYPIREGISTRY/simple/ my_core==0.1.14                                9.0s
------
 > [3/3] RUN pip install --extra-index-url https://us-central1-python.pkg.dev/PROJECTID/PYPIREGISTRY/simple/ my_core==0.1.14:
0.443 Looking in indexes: https://pypi.org/simple, https://us-central1-python.pkg.dev/PROJECTID/PYPIREGISTRY/simple/
8.894 WARNING: Failed to retrieve Application Default Credentials: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
8.894 WARNING: Trying to retrieve credentials from gcloud...
8.896 WARNING: Failed to retrieve credentials from gcloud: gcloud command exited with status: [Errno 2] No such file or directory: 'gcloud'
8.896 WARNING: Artifact Registry PyPI Keyring: No credentials could be found.
8.897 WARNING: Keyring is skipped due to an exception: Failed to find credentials, Please run: `gcloud auth application-default login or export GOOGLE_APPLICATION_CREDENTIALS=<path/to/service/account/key>`
8.897 User for us-central1-python.pkg.dev: ERROR: Exception:
8.915 Traceback (most recent call last):
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper
8.915     status = _inner_run()
8.915              ^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
8.915     return self.run(options, args)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 71, in wrapper
8.915     return func(self, options, args)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 393, in run
8.915     requirement_set = resolver.resolve(
8.915                       ^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 98, in resolve
8.915     result = self._result = resolver.resolve(
8.915                             ^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 596, in resolve
8.915     state = resolution.resolve(requirements, max_rounds=max_rounds)
8.915             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 429, in resolve
8.915     self._add_to_criteria(self.state.criteria, r, parent=None)
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 150, in _add_to_criteria
8.915     if not criterion.candidates:
8.915            ^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 194, in __bool__
8.915     return bool(self._sequence)
8.915            ^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 165, in __bool__
8.915     self._bool = any(self)
8.915                  ^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 149, in <genexpr>
8.915     return (c for c in iterator if id(c) not in self._incompatible_ids)
8.915                        ^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 35, in _iter_built
8.915     for version, func in infos:
8.915                          ^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 300, in iter_index_candidate_infos
8.915     result = self._finder.find_best_candidate(
8.915              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 915, in find_best_candidate
8.915     candidates = self.find_all_candidates(project_name)
8.915                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 852, in find_all_candidates
8.915     page_candidates = list(page_candidates_it)
8.915                       ^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/sources.py", line 196, in page_candidates
8.915     yield from self._candidates_from_page(self._link)
8.915                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py", line 810, in process_project_url
8.915     index_response = self._link_collector.fetch_response(project_url)
8.915                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 443, in fetch_response
8.915     return _get_index_content(location, session=self.session)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 347, in _get_index_content
8.915     resp = _get_simple_response(url, session=session)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/index/collector.py", line 126, in _get_simple_response
8.915     resp = session.get(
8.915            ^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 602, in get
8.915     return self.request("GET", url, **kwargs)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/network/session.py", line 528, in request
8.915     return super().request(method, url, *args, **kwargs)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 589, in request
8.915     resp = self.send(prep, **send_kwargs)
8.915            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py", line 710, in send
8.915     r = dispatch_hook("response", hooks, r, **kwargs)
8.915         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_vendor/requests/hooks.py", line 30, in dispatch_hook
8.915     _hook_data = hook(hook_data, **kwargs)
8.915                  ^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/network/auth.py", line 503, in handle_401
8.915     username, password, save = self._prompt_for_password(parsed.netloc)
8.915                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/network/auth.py", line 458, in _prompt_for_password
8.915     username = ask_input(f"User for {netloc}: ") if self.prompting else None
8.915                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8.915   File "/usr/local/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 235, in ask_input
8.915     return input(message)
8.915            ^^^^^^^^^^^^^^
8.915 EOFError: EOF when reading a line
------
Dockerfile:5
--------------------
   3 |     RUN pip install --upgrade pip keyrings.google-artifactregistry-auth
   4 |
   5 | >>> RUN pip install --extra-index-url https://us-central1-python.pkg.dev/PROJECTID/PYPIREGISTRY/simple/ my_core==0.1.14
   6 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c pip install --extra-index-url https://us-central1-python.pkg.dev/PROJECTID/PYPIREGISTRY/simple/ my_core==0.1.14" did not complete successfully: exit code: 2

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/o7ukq9xssq4vj2fvfodfhvakk

How to inform docker build to get token from keyring ?

1 Answer 1

1
You might find this answer of @LondonAppDev which worked for him by doing the following in Dockerfile:
FROM python:3.10

ARG AUTHED_ARTIFACT_REG_URL
COPY ./requirements.txt /requirements.txt

RUN pip install --extra-index-url ${AUTHED_ARTIFACT_REG_URL} -r /requirements.txt

Then, run this code to build your Dockerfile:

docker build --build-arg AUTHED_ARTIFACT_REG_URL=https://oauth2accesstoken:$(gcloud auth print-access-token)@url-for-artifact-registry

Check out this link for the full details of his answer.

Sign up to request clarification or add additional context in comments.

1 Comment

Did this answer help resolve your issue? If not, let us know and I’ll be glad to guide you further.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.