0
任何人都可以幫助我解決這個問題?我目前正試圖通過docker-compose來捆綁我的流星應用程序,並且不斷來回地收到npm錯誤。我終於到達Docker-compose.yml文件所調用的Dockerfile中的最後一個構建步驟,但是我收到了很多錯誤..所有文件,包括package.json,都清晰可見,因此在那裏是沒有理由的,除其他外,從安裝隱藏。Docker:docker-compose爲捆綁流星應用程序不工作..(npm錯誤)
這裏是我的dockerfile和以下是錯誤:
FROM ubuntu:trusty
# Install NodeJS from Node-Source repo (node 0.10.48).
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs
# Add your app on /Home and install NPM modules. And clean the cache.
RUN mkdir /home/app
COPY app.tar.gz /tmp/app.tar.gz
RUN tar -zxf /tmp/app.tar.gz -C /home/app
RUN apt-get install -y python
RUN cd /home/app/bundle/programs/server
RUN apt-get update
RUN npm install
#RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Expose port 80, but remember to use PORT=80
EXPOSE 80
# Run the app
WORKDIR /home/app
CMD ["node", "main.js"]
npm ERR! install Couldn't read dependencies
npm ERR! Linux 4.10.0-32-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.10.48
npm ERR! npm v2.15.1
npm ERR! path /package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR! package.json ENOENT, open '/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
ERROR: Service 'app' failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 34
謝謝你這麼快的迴應!我現在已經過去了第一個錯誤,但構建到了最後一步,並返回這個:錯誤:對於應用程序無法啓動服務應用程序:oci運行時錯誤:container_linux.go:262:啓動容器過程導致「exec:\」流星\「:在$ PATH中找不到可執行文件」 錯誤:啓動項目時遇到錯誤。 –
基於'「exec:\」meteor \「:可執行文件在$ PATH中找不到。我猜測你沒有從正確的位置運行CMD,也許在'expose 80'後面加上一行來給出你自己提供一些信息:'RUN ls -lha'或'RUN echo $ PWD'。我認爲你的應用程序需要從'/ home/app'執行。 – eodgooch