0

I have this dockerfile:

FROM ubuntu
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common

#install freecad
RUN add-apt-repository ppa:freecad-maintainers/freecad-daily
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y freecad-daily

#install utils
RUN DEBIAN_FRONTEND=noninteractive apt install -y vim
RUN DEBIAN_FRONTEND=noninteractive apt install -y nano
RUN DEBIAN_FRONTEND=noninteractive apt install -y git

#install protobuf
RUN DEBIAN_FRONTEND=noninteractive git clone https://github.com/protocolbuffers/protobuf
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf autogen
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing autoconf automake pkg-config #missing: libgtk-3-dev
RUN DEBIAN_FRONTEND=noninteractive apt install -y build-essential #needed for g++?
RUN cd protobuf && ./autogen.sh
RUN cd protobuf && ./configure
RUN cd protobuf && make
RUN cd protobuf && make install

#install libarcus
#https://community.ultimaker.com/topic/20409-stuck-up-in-creating-a-docker-image-for-curaengine/
RUN DEBIAN_FRONTEND=noninteractive apt install -y cmake  #missing:  protobuf-compiler python3-dev python3-sip-dev libprotoc-dev libprotobuf-dev
RUN DEBIAN_FRONTEND=noninteractive git clone https://github.com/Ultimaker/libArcus.git \
    && cd libArcus \
    && sed -i '/option(BUILD_PYTHON "Build " ON)/c\option(BUILD_PYTHON "Build " OFF)' ./CMakeLists.txt \
    && mkdir build && cd build \
    && ls -la .. \
    && cmake .. \
    && make -j4 \
    && make install

#install cura-engine and cura
RUN git clone https://github.com/Ultimaker/CuraEngine.git
RUN git clone https://github.com/Ultimaker/Cura.git
RUN cd CuraEngine && mkdir build && cd build && cmake .. && make

#install node
RUN apt-get install git-core curl build-essential openssl libssl-dev \
 && git clone https://github.com/nodejs/node.git \
 && cd node \
 && ./configure \
 && make \
 && sudo make install

CMD ["node","server.js"]

I open the terminal and navigate to the directory this is in and i type:

docker build .

I get this error:

ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied 
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=y3on0l6lkezz43j468liw0907&shmsize=0&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied

I have no clue what is the problem.... I do everything by the book...

user1584421
  • 3,499
  • 11
  • 46
  • 86
  • It is not because of what you wrote in the `Dockerfile`. As the error message says, the Docker daemon is either not started or not configured properly. – axiac Dec 02 '20 at 21:36
  • I found no reference on having to start the daemon first, nor do i know how to do so... – user1584421 Dec 02 '20 at 21:38
  • Are you running this on windows, windows with wsl2, or linux? – Ben W Dec 02 '20 at 21:51
  • I am running this on ubuntu linux. I git pulled the dockerfile and i am trying to run it on that same foilder i pulled it from – user1584421 Dec 02 '20 at 22:07
  • 1
    Run `docker ps` if you get the same error of permission denied and you know you have docker installed and running - you need to use sudo - or use https://docs.docker.com/engine/install/linux-postinstall/ – Ben W Dec 02 '20 at 22:13
  • 1
    @BenW I had to type sudo!!! That was it! Jesus! Thank you! If you want, you can make a proepr answer, so i can upvote and mark it as the selected! Thanks again! – user1584421 Dec 02 '20 at 22:20
  • On some systems, running `docker` with `sudo` is not needed if your user belongs to the `docker` group. Under Linux run `sudo usermod -aG docker $user` to add it. Read more in the Docker documentation: https://docs.docker.com/engine/install/linux-postinstall/ – axiac Dec 03 '20 at 13:23

0 Answers0