8000 新版本构建php和nginx容器报错 · Issue #584 · garylab/dnmp · GitHub
[go: up one dir, main page]

Skip to content

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

Open

Description

@WangQuanTang

在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

Activity

  1. jingmian commented on Jan 9, 2024

    @jingmian
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0