我无法使用以下Dockerfile构建我的镜像:
FROM ubuntu
RUN apt-get -y update && apt-get -y install \
nodejs npm ssh
# cache npm install when package.json hasn't changed
WORKDIR /tmp
ADD package.json package.json
RUN npm install
RUN npm install -g pm2
RUN mkdir /sparrow
RUN cp -a /tmp/node_modules /sparrow
WORKDIR /sparrow
ADD . /sparrow/
RUN npm run build
# ssh keys
WORKDIR /root
RUN mv /sparrow/.ssh /root/
# upload js and css
WORKDIR /sparrow/build
# UPLOAD TO S3!
# go back to /sparrow
WORKDIR /sparrow
ENV NODE_ENV production
ENV NODE_PATH "./src"
EXPOSE 8000
CMD ["pm2", "start", "./bin/server.js", "--no-daemon", "-i", "0"]似乎它在连接到互联网上安装ubuntu包时遇到了问题,并且失败了:
Err http://archive.ubuntu.com trusty InRelease
Err http://archive.ubuntu.com trusty-updates InRelease
Err http://archive.ubuntu.com trusty-security InRelease
Err http://archive.ubuntu.com trusty Release.gpg
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-updates Release.gpg
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-security Release.gpg
Could not resolve 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nodejs
E: Unable to locate package npm对如何解决或测试这个问题有什么建议吗?在El Capitan OSX上运行
谢谢!
发布于 2016-11-16 00:53:50
即使您可以解决archive.ubuntu.com解决方案,Docker构建也会因为警告---> [Warning] IPv4 forwarding is disabled. Networking will not work而失败-
https://stackoverflow.com/questions/34141438
复制相似问题