Search code examples
node.jsdockercurl

getaddrinfo() thread failed to start while building docker image


This is my Dockerfile

FROM linuxserver/code-server:latest
 
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - &&\
    apt-get install -y nodejs

I run the build command

docker build -t node-ide .

On the local computer (Windows 11) and it works fine. But when I upload it to ubuntu server and run the same, I get an error

Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM linuxserver/code-server:latest
 ---> 997b7b90cb65
Step 2/2 : RUN curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - &&    apt-get install -y nodejs
 ---> Running in d0ec2365c9d1
curl: (6) getaddrinfo() thread failed to start
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nodejs
The command '/bin/sh -c curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - &&    apt-get install -y nodejs' returned a non-zero code: 100

Why is this happening?


Solution

  • As per the comment of @yong, I downgraded, now it works like this:

    FROM linuxserver/code-server:4.4.0-ls125
    RUN curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - &&\
        sudo apt-get install -y nodejs