skip to Main Content

I am creating a docker image for my python code.
To install dependencies and requirements, I have

pip3 install git+https://[email protected]/<PATH_TO_REPO>@dev --no-cache-dir --force-reinstall

in the Dockerfile. when I run docker build command, I get below error

Running command git clone --filter=blob:none --quiet 'https://****@github.com/<PATH_TO_REPO>.git' /tmp/pip-req-build-cxx5g22f
  fatal: could not read Password for 'https://***@github.com': No such device or address
  error: subprocess-exited-with-error

I am running docker build using GitHub action and passing the GITHUB_PERSONAL_ACCESS_TOKEN in build argument.

Please help

2

Answers


  1. Chosen as BEST ANSWER

    This worked -> pip3 install git+https://oauth2:[email protected]/<PATH_TO_REPO>@dev --no-cache-dir --force-reinstall


  2. If it is a "Personal Access Token" (PAT) and not an OAuth-Token, you have to specify your user name e.g.

    pip3 install git+https://username:[email protected]/<PATH_TO_REPO>@dev --no-cache-dir --force-reinstall
    

    Replace username with your GitHub username the PAT belongs to.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search