Gcloud meanjs通过docker install构建失败

时间:2018-05-04 08:51:46

标签: docker gcloud meanjs

我正在尝试使用gcloud app deploy在google云应用引擎上部署以下容器,它是meanjs.org vanilla图像。它使用了一个dockerfile,我是docker的新手,我正试图在飞行中学习它,所以如果有人能帮助那就好了,谢谢。 看起来如果通过dockerfile安装节点失败了,我已经在github上检查了node的文档,并且没有任何语法在语法上改变为现有dockerfile中的内容。我将在今天早上尝试在我的本地工作站上重新创建,并将很快更新此查询。 错误如下.. first docker error second error build fail error 泊坞文件..

# Build:
# docker build -t meanjs/mean .
#
# Run:
# docker run -it meanjs/mean
#
# Compose:
# docker-compose up -d

FROM ubuntu:latest
MAINTAINER MEAN.JS

# 80 = HTTP, 443 = HTTPS, 3000 = MEAN.JS server, 35729 = livereload, 8080 = node-inspector
EXPOSE 80 443 3000 35729 8080

# Set development environment as default
ENV NODE_ENV development

# Install Utilities
RUN apt-get update -q  \
 && apt-get install -yqq \
 curl \
 git \
 ssh \
 gcc \
 make \
 build-essential \
 libkrb5-dev \
 sudo \
 apt-utils \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install MEAN.JS Prerequisites
RUN npm install --quiet -g gulp bower yo mocha karma-cli pm2 && npm cache clean

RUN mkdir -p /opt/mean.js/public/lib
WORKDIR /opt/mean.js

# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Install npm packages
COPY package.json /opt/mean.js/package.json
RUN npm install --quiet && npm cache clean

# Install bower packages
COPY bower.json /opt/mean.js/bower.json
COPY .bowerrc /opt/mean.js/.bowerrc
RUN bower install --quiet --allow-root --config.interactive=false

COPY . /opt/mean.js

# Run MEAN.JS server
CMD npm install && npm start

1 个答案:

答案 0 :(得分:1)

好的,所以经过多次摔跤尝试在Windows上安装docker失败后,我回到dockerfile尝试识别核心问题。幸运的是,我找到了一个解决方案如下..

NodeJS正在尝试在Ubuntu上安装。 在应用程序根目录的dockerfile中 Ubuntu版本配置为:

FROM ubuntu:latest

只需将其更改为:

FROM ubuntu:14.04

我不确定这是否是用于构建的最佳版本,但它似乎正在成功运行。请随时修改/推荐替代解决方案。我是Docker的新手,所以请善待。