Well, seems the error was because I wasn't sending the secret in the docker build docker build --secret id=pip-secret,src=[PATH-TO-PIP-CONF]-t [TAG-IMG] .
docker build --secret id=pip-secret,src=[PATH-TO-PIP-CONF]-t [TAG-IMG] .