Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 609
ABE Avatar asked Apr 12 '26 18:04

ABE


1 Answers

Me helped option --security-opt seccomp=unconfined for docker run

sudo docker run -it --security-opt seccomp=unconfined ubuntu

For docker-compose.yml

services:
  example:
    build: .
    security_opt:
      - seccomp:unconfined
like image 143
Николай Дегтярев Avatar answered Apr 15 '26 10:04

Николай Дегтярев



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!