skip to Main Content

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


  1. Chosen as BEST ANSWER

    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
    

  2. It’s seems a network issue, you can use ‘ping deb.nodesource.com’ command to test it.

    Login or Signup to reply.
  3. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search