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?
3
Answers
As per the comment of @yong, I downgraded, now it works like this:
It’s seems a network issue, you can use ‘ping deb.nodesource.com’ command to test it.
Me helped option
--security-opt seccomp=unconfined
for docker runFor docker-compose.yml