Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新版本构建php和nginx容器报错 #584

Open
WangQuanTang opened this issue Jan 4, 2024 · 1 comment
Open

新版本构建php和nginx容器报错 #584

WangQuanTang opened this issue Jan 4, 2024 · 1 comment

Comments

@WangQuanTang
Copy link

在php80和自己安装的php82的Dockerfile中第33行:

RUN curl -o /usr/bin/composer https://${COMPOSER_URL}/composer/composer.phar \
    && chmod +x /usr/bin/composer

运行启动命令后会提示:

 => ERROR [php82 10/12] RUN curl -o /usr/bin/composer https://${COMPOSER_URL}/composer/composer.phar     && chmod  5.5s
------

查看配置文件.env,配置是没问题的:

COMPOSER_URL=mirrors.aliyun.com

查看原来电脑上的Dockerfile里的配置是:

RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
    && chmod +x /usr/bin/composer

也就是说,本来${COMPOSER_URL}等价于mirrors.aliyun.com,但是一个作为变量,一个是写死的,但是执行的效果就不一样。

还有nginx的构建也有问题:

=> ERROR [nginx 1/4] FROM docker.io/library/nginx:1.19.1-alpine@sha256:ee8c35a6944eb3cc415cd4cbeddef13927895d4f

.env中把版本修改一下就解决了:

# before
NGINX_VERSION=1.19.1-alpine
# after
NGINX_VERSION=1.20.2-alpine
@jingmian
Copy link
Collaborator

jingmian commented Jan 9, 2024

ERROR [php82 10/12] RUN curl -o /usr/bin/composer https://${COMPOSER_URL}/composer/composer.phar && chmod 5.5s ------
有时网路不好,确实会出现这个错误的,只要重新build几次就可以了,如果把COMPOSER_URL写死,效率是会高一些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants