YMC-GitHub / issues

record some issues
0 stars 0 forks source link

build php image with alpine ,plan to install some ext. #1

Open YMC-GitHub opened 4 years ago

YMC-GitHub commented 4 years ago

desc:

WARNING: Ignoring http://mirrors.aliyun.com/alpine/v3.10/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)

my env:

pm:win10 vm:centos note:the vm is in virtualbox (win+centos)

expect behavior:

happens:

fetch http://mirrors.aliyun.com/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://mirrors.aliyun.com/alpine/v3.10/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
fetch http://mirrors.aliyun.com/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://mirrors.aliyun.com/alpine/v3.10/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
ERROR: unsatisfiable constraints:
  autoconf (missing):
    required by: world[autoconf]
  curl-dev (missing):
    required by: world[curl-dev]
  g++ (missing):
    required by: world[g++]
  libtool (missing):
    required by: world[libtool]
  libxml2-dev (missing):
    required by: world[libxml2-dev]
  linux-headers (missing):
    required by: world[linux-headers]
  make (missing):
    required by: world[make]

my opeation steps :

i run the script as below in my vm which is in a dockerfile. with the docker-compose build

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache autoconf g++ libtool make curl-dev libxml2-dev linux-headers && docker-php-ext-install -j$(nproc) pdo_mysql  && docker-php-ext-install -j$(nproc) mysqli && docker-php-ext-install -j$(nproc) mysql
YMC-GitHub commented 4 years ago

after changing the source for apk tool ,you need to run apk update

YMC-GitHub commented 4 years ago

check my network.i find that it can not connect to internet! run in my vm:

ping -c 2 www.baidu.com

expect behavior:

PING www.a.shifen.com (182.61.200.6) 56(84) bytes of data.
64 bytes from 182.61.200.6 (182.61.200.6): icmp_seq=1 ttl=42 time=75.5 ms
64 bytes from 182.61.200.6 (182.61.200.6): icmp_seq=2 ttl=42 time=83.9 ms

--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 75.575/79.739/83.903/4.164 ms

actual behavior:

ping: www.baidu.com: Name or service not known

i need to solve the question at first. so:

DNS_CONFIG_FILE=/etc/resolv.conf
DNS1=223.5.5.5
DNS2=223.6.6.6
cat >$DNS_CONFIG_FILE <<eof
nameserver ${DNS1}
nameserver ${DNS2}
eof
service network restart

continue :

docker-compose build