Docker / Node错误:错误:连接ENOENT /var/run/docker.sock

我试图得到一个简单的Dockerfile来运行一个节点应用程序,到目前为止这一直很困难。 我终于得到它运行和编译,但我遇到了以下错误。 这是我的第一个dockerfile,我真的没有看到这个错误之前或在线:

patientplatypus:~/Documents/pypy-sandbox-server:18:42:13$sudo docker run -it compile > pypy-sandbox-server@1.0.0 start / > npm install && node api/app.js npm WARN pypy-sandbox-server@1.0.0 No repository field. up to date in 1.352s in app.js - SANITY CHECK info: Initializing Sandbox error: Error: connect ENOENT /var/run/docker.sock at Object._errnoException (util.js:1024:11) at _exceptionWithHostPort (util.js:1046:20) at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1185:14) 

我的dockerfile本身应该非常简单。 我正在做的唯一“棘手的事情”是构成多个docker镜像(这对于我的特殊用例是必需的)。 节点部分(下面)非常简单:

 FROM node:8 as node_env WORKDIR . #COPY package.json . COPY . . RUN apt-get -qq update RUN apt-get -qq -y install npm RUN apt-get install -qq -y --no-install-recommends apt-utils RUN npm set progress=false && \ npm config set depth 0 && \ npm install EXPOSE 3000 COPY --from=pypy_build usr/local/bin/pypy ./pypy #CMD ["forever", "-c","node --harmony","./api/app.js"] ENTRYPOINT npm start 

出了什么问题?

Interesting Posts