docker-compose - docker 官方的镜像大多基于debian,但是官方源更新失败,如何更换成中国源?
PHP中文网
PHP中文网 2017-04-26 09:01:49
0
6
1708
docker-compose --project-name "dev_" build php
Building php
Step 1 : FROM php:5.6-fpm
 ---> a0e78ea4a88b
Step 2 : RUN apt-get update && apt-get install -y         git         libgearman-dev         libmemcached-dev         libmcrypt-dev         libfreetype6-dev         libjpeg62-turbo-dev         libpng12-dev         libmagickwand-dev         libmagickcore-dev
 ---> Running in 8181163c0190
Ign http://security.debian.org jessie/updates InRelease
Err http://security.debian.org jessie/updates Release.gpg
  Connection failed
Ign http://security.debian.org jessie/updates Release
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  
Err http://security.debian.org jessie/updates/main amd64 Packages
  Connection failed
Err http://httpredir.debian.org jessie InRelease
  
Err http://httpredir.debian.org jessie-updates InRelease
  
Err http://httpredir.debian.org jessie Release.gpg
  Could not resolve 'httpredir.debian.org'
Err http://httpredir.debian.org jessie-updates Release.gpg
  Could not resolve 'httpredir.debian.org'
Reading package lists...
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/InRelease  

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease  

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Connection failed

W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages  Connection failed

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg  Could not resolve 'httpredir.debian.org'

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg  Could not resolve 'httpredir.debian.org'

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 git
E: Unable to locate package libgearman-dev
E: Unable to locate package libmemcached-dev
E: Unable to locate package libmcrypt-dev
E: Unable to locate package libfreetype6-dev
E: Unable to locate package libjpeg62-turbo-dev
E: Unable to locate package libpng12-dev
E: Unable to locate package libmagickwand-dev
E: Unable to locate package libmagickcore-dev
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y         git         libgearman-dev         libmemcached-dev         libmcrypt-dev         libfreetype6-dev         libjpeg62-turbo-dev         libpng12-dev         libmagickwand-dev         libmagickcore-dev' returned a non-zero code: 100
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(6)
黄舟
#更新apt-get源 使用163的源
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
    echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list && \
    echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list && \
    echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list && \
    echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
仅有的幸福

To play docker, you can completely use the image of a certain domestic station. The image of a certain domestic station

黄舟

How about we use a proxy chain to proxy a scientific Internet connection to port 1080, and then request the official source, the speed is not slow. This is what I did.

習慣沉默

For a company, set up a private image storage server internally or on a test machine, so as not to be painfully slow every time you submit an updated image

PHPzhong

Most of the official images are based on debian:jessie. If this base image often fails to be pulled, there is a little tip:

Pull the image directly from the domestic mirror site, such as daocloud. The name of the pulled image is roughly like this: daocloud.io/library/debian:jessie,然后执行 docker tag daocloud.io/library/debian:jessie debian:jessie You can complete operations similar to renaming the image (actually, you give the same image two labels) . Because when executing the build, it will first search whether there is an image with the corresponding name locally, so the debian base image will not be downloaded from the Internet

迷茫

(Configuring Docker accelerator) If you don’t configure it, you won’t be able to download it. It’s a huge wall

Enter https://dashboard.daocloud.io/ and register an account first. There is no charge. Then after logging in, enter the personal center. There are accelerators in it. Just click to enter, and then you can see for yourself. It contains the usage of Linux mac windows,

Reference article: /a/11...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template