Getting error installing nodejs when building from docker

I am trying to install nodejs using the docker console for ubuntu but I get an error installing node js. This is the error I am getting

The command [/bin/sh -c ./configure && make && make install] returned a non-zero code: 127

This is part of my dockerfile

  • Docker daemon no start
  • How to use bash with an Alpine based docker image?
  • Docker build failing when using gcsfuse to mount google storage
  • NodeJS fs.watch is not reacting to changes inside a Docker Container
  • Docker Webapp doesn't show up
  • How to add the Env variable to running docker container
  • FROM ubuntu:12.04
    RUN mkdir -p /dir/subdir
    RUN apt-get update
    
    # Install nodejs
    ADD http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz /dir
    WORKDIR /dir/node-v0.10.26-linux-x64
    RUN ./configure && make && make install
    WORKDIR /dir
    

  • Docker Maven Spotify plugin - Possible to switch to non-secure registry
  • Access Kitematic (docker) apache website over port 80
  • Why docker has ability to run different linux distribution? [closed]
  • How to connect to a docker container from outside the host (same network) [OSX 10.11]
  • docker-compose up for only certain containers
  • Understanding docker - how do containers contain all required dependencies?
  • One Solution collect form web for “Getting error installing nodejs when building from docker”

    Exit code 127 typically means “command not found”. Chances are build-essentials are not installed.

    Try adding the following after the apt-get update:

    RUN apt-get -y install build-essential
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.