nodejs installation work with ubuntu base image but not with consol/ubuntu-xfce-vnc

Viewed 159

I am trying to use consol/centos-xfce-vnc to run my automation script. Therefore I wanted to install nodejs. With my surprise it does work when tried with ubuntu however doesn't work with ubuntu-xfce-vnc.

Working Dockerfile

# Pull base image.
FROM ubuntu:14.04

# Install Node.js
RUN apt-get update && apt-get install -y \
curl
CMD /bin/bash

RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential

RUN which node; node -v; which npm; npm -v;

Not Working Dockerfile

# Pull base image.
FROM consol/ubuntu-xfce-vnc:1.1.0

# Install Node.js
RUN apt-get update && apt-get install -y \
curl
CMD /bin/bash

RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential

RUN which node; node -v; which npm; npm -v;

I get following error

Step 2/7 : RUN apt-get update && apt-get install -y curl
 ---> Running in 63ced11fe09e
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I am new to docker, not sure what I am missing here.

0 Answers
Related