Skip to content
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

Various issues while "yarn install" when Docker image creating #8686

Open
desolatorpk opened this issue Sep 7, 2021 · 3 comments
Open

Various issues while "yarn install" when Docker image creating #8686

desolatorpk opened this issue Sep 7, 2021 · 3 comments

Comments

@desolatorpk
Copy link

Hello!
I was trying to run several commands in docker, build dockerfile:

FROM node:14-buster
WORKDIR /app
COPY mysslcert.crt yarn.lock package.json skeleton.tar.gz ./
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
RUN yarn config set cafile mysslcert.crt
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"

My corporate network filter all ssl trafic, and adds "self signed certificate" in certificate chain.
I override this cert issue by using:
yarn config set cafile mysslcert.crt

But "RUN yarn install" shows several errors, when i just restart docker build:

several times i seen this info:
info There appears to be trouble with your network connection. Retrying...

sample of one try:

Sending build context to Docker daemon 8.976MB
Step 1/13 : FROM node:14-buster
---> 24be080286c0
Step 2/13 : WORKDIR /app
---> Using cache
---> 5bea0713139b
Step 3/13 : COPY mysslcert.crt yarn.lock package.json skeleton.tar.gz ./
---> Using cache
---> 068306587850
Step 4/13 : RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
---> Using cache
---> 18dac6a3725d
Step 5/13 : RUN yarn config set cafile mysslcert.crt
---> Using cache
---> 78d09840ab96
Step 6/13 : RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
---> Running in 682c6acbe81e
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz: unexpected end of file".
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Any suggestions?

@desolatorpk
Copy link
Author

New info for that case:
I was run yarn install --frozen-lockfile --production --network-timeout 300000 outside of docker,
On first time run, i seen info rows on [3/5] Fetching packages... stage:
info There appears to be trouble with your network connection. Retrying...
But it continue work, then i seen thats info message while [5/5] Building fresh packages... stage.
And finally "Done in 64.77s."
The second run, shows that info only at [5/5] stage.
The third run, works fine.
But in docker still drop various error messages.
Update docker to latest, also not helps.

@desolatorpk
Copy link
Author

That's bug looks like #5259

@desolatorpk desolatorpk changed the title Various issues while "yarn install" Various issues while "yarn install" when Docker image creating Dec 23, 2021
@ceoguy
Copy link

ceoguy commented Mar 19, 2022

Did you try migrating to Yarn V2?
$ npm install -g yarn
Go into your project directory
$ yarn set version berry
Add: "nodeLinker: node-modules" in your yarnrc.unless file
Run $ yarn install

Hope it helped,
Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants