Eric429221
2018-04-12 14:12
docker ubuntu apt-get does not file
W: The repository 'http://mirrors.163.com/debian jessie Release' does not have a Release file.
W: The repository 'http://mirrors.163.com/debian jessie-updates Release' does not have a Release file.
W: The repository 'http://mirrors.163.com/debian-security jessie/updates Release' does not have a Release file.
E: Failed to fetch http://mirrors.163.com/debian/dists/jessie/main/binary-amd64/Packages 404
E: Failed to fetch http://mirrors.163.com/debian/dists/jessie-updates/main/binary-amd64/Packages 404
E: Failed to fetch http://mirrors.163.com/debian-security/dists/jessie/updates/main/binary-amd64/Packages 404
E: Some index files failed to download. They have been ignored, or old ones used instead.
FROM ubuntu
MAINTAINER xbf
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i'' 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list
RUN apt-get -m update
RUN apt-get install -y nginx
COPY index.html /var/www/html
ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off:"]
EXPOSE 80
我目前使用的主機是騰訊雲 ubuntu 16.04
你的网络问题吧 你要不别用这个apt的镜像了 用个阿里或者163的试试 你这个dockerfile 没错 我可以构建成功
FROM ubuntu
MAINTAINER xbf
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get -m update
RUN apt-get install -y nginx
COPY index.html /var/www/html
ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off:"]
EXPOSE 80
我再跑這個的時候發生這個問題,不知道為啥
安装之前要先进行更新,apt-get update ,如果你更新过了,可能是网络不好吧,所以没有更新成功
Docker入门
97054 学习 · 242 问题
相似问题