-
Notifications
You must be signed in to change notification settings - Fork 2k
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
npm install in docker scoket timeout #1668
Comments
same problem |
same here; FROM node:12-alpine as build ENV NODE_VERSION 12.18.1 Create app directoryWORKDIR /app RUN npm run build FROM nginx:stable ENV ESC='$' RUN rm /etc/nginx/conf.d/default.conf ENV SSH_PASSWD "root:Docker!" COPY docker/sshd_config /etc/ssh/ RUN chmod u+x /usr/local/bin/init.sh error: |
I can consistently reproduce this - I've found that if you only have a few deps then it seems fine, but larger lists of dependencies produce the 💡 Here's a repo to allow reproducing this: https://github.com/itsravenous/docker-node-repro 💡 I'm sure it could be specific to the network conditions on my machine, or something to do with my Docker setup, but it seems weird that switching to 14 would consistently avoid the issue in that case. Be interesting to see if others can reproduce using my test case repo - @bbkysf and @x900603 could you confirm? In the meantime, I'll try removing deps from that repo's package.json to see if there's any particular packages that are causing trouble, or any rough "size" of the dependency list that makes a difference. Not very scientific, I know, but not sure how else to proceed - all a bit over my head I'm afraid :) |
Node 14 and Node 16 ship with different versions of NPM, so the difference is likely there. |
Good point. I should clarify that this problem doesn’t occur with node 16 outside of docker. |
Thinking about it - and this is a guess - but it would make sense to me that it is one, larger dependency that would be the cause, if anything. I don't think |
I have got same error on |
I also met this issue, and ... if I switch to a stable network and disconnect all VPN, I will success to build |
Same thing. Works well with EDIT: I am not 100% confident that this is related to :16-alpine specifically, maybe it is more sensitive to bad network, but the network I am currently on is not as reliable as the one I am usually using.
|
I have changed the node image version to |
For me, using It always worked on my local computer, however it always failed on remote server (I used a VPN to connect to it). I wanted to build an image from Dockerfile based on For now, I use |
I encountered the same problem today! Failed
|
With
N.B. I have not tested this. It might be a fluke! |
Maybe! I just solved the network problem in my local environment setting
when using axios.
I will try to solve my docker container related problem with the same way.
Neville ***@***.***> 于2022年8月29日周一 03:28写道:
… Let's find out the ghost by reducing this part:
RUN set -eux;
apk add --no-cache --virtual build-dependencies wget unzip gnupg;
apk add --no-cache git python3 py-pip bash shellcheck openjdk11-jre curl
musl-locales musl-locales-lang;
With node:16.15.0-alpine simply installing curl seems to work for me.
RUN set -eux; apk add --no-cache curl;
N.B. I have not tested this. It might be a fluke!
—
Reply to this email directly, view it on GitHub
<#1668 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW6Q2LLVLXVDCQIGRFYUMB3V3O4VRANCNFSM5QYXHD6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Before solving this problem, I have another problem to solve to get better understand of the docker network. The default network mode of docker compose is |
The bridge connection docker0 – with IP address 172.17.0.1 – is created by Docker at installation time. Because the host and all containers are connected to that network, our application only needs to listen to it. All right! The answer is |
Using this solved it for me
|
I fixed this issue by removing ipv6 from So if you don't have ipv6 you should remove it or if you have ipv6 check if you see the correct ipv6 address If you make changes to this file you need to restart the service: |
To me, it was solved by npm upgrade and sockets limit:
|
This solution helped me as well. Below is my error output when using
So maybe this bugfix PR fixed the behaviour
|
I had the same issue with the node v16.
I updated the node up to v20 and everything is ok without |
Context
First stepAdd into the npm install stage the flag --verbose at your Dockerfile
This will allow you to see the entire log of the Then i checked out that was a error between the packages fetchs. The Node logs from my docker build was: So i checked my DNS confs in the WSL2 At my WSL2 terminal:
I saw a nameserver of my windowsOS and a search field. I delete all of them and added after the bellow command:
PASTE:
This fixed my problem. The resume is, DNS was failing to ping the registry.npmjs.org because was returning the IP:PORT and suppost to return just the DNS. |
laradock/laradock#2843 (comment)
should i report this problem at here?
it happend when I use node:lts-alpine
here is my dockerfile
and it will cause
here is my dependencies
The text was updated successfully, but these errors were encountered: