I try to install packages from a private registry using yarn in a docker image, so we reuse this image in other pipelines. When I use npm everything works fine, but as soon I use yarn i get 404's.
Using NPM it is working fine:
RUN npm config set @my-scope:registry https://registry.npmjs.org && \
npm config set //registry.npmjs.org:_authToken ${AUTH_TOKEN_PRIVATE_REGISTRY}
RUN npm i @my-scope/my-package # success!
And when using Yarn:
RUN yarn config set @my-scope:registry https://registry.npmjs.org && \
yarn config set //registry.npmjs.org:_authToken ${AUTH_TOKEN_PRIVATE_REGISTRY}
RUN yarn add @my-scope/my-package # 404!
I'm really wondering what I'm doing wrong when using Yarn. I see quite some options to login via the CLI, which will work but I need to have the process automated.