yankewei / blog

Life-long learning
2 stars 0 forks source link

【Docker】错误记录 #7

Open yankewei opened 6 years ago

yankewei commented 6 years ago

ERROR: 'phpize' failed

使用php:7.1-fpm-alpine3.7作为基础镜像的时候,在dockerfile中进行RUN pecl install redis,build镜像时会产生一个ERROR: 'phpize' failed错误,可以在pecl install redis之前执行apk add --no-cache $PHPIZE_DEPS openssl-dev

/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

在Centos下使用kubectl创建pods时,一直处于containerCreating状态,然后使用kubectl describe pods mysql,查看详情之后,发现/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory,网上找了一圈都是yum install *rhsm*就可以解决,但是我这边并没有解决,然后直接搜redhat-uep.pem在github发现了一个文件,直接复制粘贴过来了.附上链接https://github.com/candlepin/subscription-manager/blob/master/etc-conf/redhat-uep.pem

install gd on php alpine

URL:https://github.com/docker-library/php/issues/225

在Docker中使用pecl安装扩展

刚开始直接使用RUN pecl install swoole是不行的,需要先执行RUN apk add --no-cache $PHPIZE_DEPS openssl-dev libstdc++,并且还要执行docker-php-ext-enable swoole

在Docker中使用pip安装报错Failed to establish a new connection: [Errno 113] Host is unreachable',)'

在Docker中用一个alpine镜像做的容器中,使用pip安装python的扩展包,会报错Failed to establish a new connection: [Errno 113] Host is unreachable',)',后来在网上查找原因之后,编辑/etc/resolv.conf文件,添加nameserver 8.8.8.8 nameserver 8.8.4.4之后可正常使用。

open() "/run/nginx/nginx.pid" failed (2: No such file or directory)

在以Alpine做基础镜像,安装nginx之后,执行nginx -g daemon off后会报这个错。需要在镜像中手动创建目录mkdir -p /run/nginx

connect() failed (111: Connection refused) while connecting to upstream

在以Alpine做基础镜像,使nginx可以将请求转发给php-fpm,会出现这个错误。是因为php-fpm的配置文件监听的是127.0.0.1:9000,我们应该替换成9000就可以了,具体命令sed -i "s|;*listen\s*=\s*127.0.0.1:9000|listen = 9000|g" /etc/php7/php-fpm.d/www.conf。 参考:https://github.com/matriphe/docker-alpine-nginx/issues/1

minikube start 失败

minikube start 失败, 报错如下:dial tcp 74.125.204.82:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond,是因为在国内无法访问https://grc.io,我们使用国内镜像即可: k8s minikube start --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'

romash1408 commented 5 years ago

Прекрасный контент! Так здорово, что его можно найти в открытом доступе!

yankewei commented 5 years ago

Прекрасный контент! Так здорово, что его можно найти в открытом доступе!

Я очень рад помочь вам.