PHP5,7,8无法构建环境

1Panel版本:v1.10.19, php创建运行环境,系统debian11

7.0报错,
:failed to solve: process “/bin/sh -c if [ "$CONTAINER_PACKAGE_URL" ]; then sed -i "s|http://dl-cdn.alpinelinux.org/alpine/v3.4|https://${CONTAINER_PACKAGE_URL}/alpine/v3.5|g\” /etc/apk/repositories; fi" did not complete successfully: exit code: 1

8.0报错
failed to solve: process “/bin/sh -c if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi” did not complete successfully: exit code: 1

chatgpt: 这个错误可能是由于 CONTAINER_PACKAGE_URL 变量未被正确设置或为空导致的。

/opt/1panel/runtime/php 进这个目录看一下 .env 文件有没有正确赋值

这是 php-7433 的env

CONTAINER_PACKAGE_URL=“mirrors.aliyun.com
DATA_DIR=“./data”
IMAGE_NAME=“1panel-php:7.4.33”
INSTALL_SUPERVISOR=0
PHP_EXTENSIONS=“mysqli,pdo_mysql,zip,gd,redis,memcache,memcached”
PHP_FPM_CONF_FILE=“./php/php-fpm.conf”
PHP_LOG_DIR=“./logs/php”
PHP_PHP_CONF_FILE=“./php/php.ini”
PHP_VERSION=“7.4.33”
SOURCE_DIR=“./www”
TZ=“Asia/Shanghai”

CONTAINER_PACKAGE_URL 是存在的 还有其他日志吗

build.log (9.0 KB)
这是报错的日志, php-7433

#6 [1panel-php 2/12] RUN if [ mirrors.aliyun.com ] ; then sed -i “s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g” /etc/apk/repositories ; fi
#6 0.067 Incorrect Usage: flag provided but not defined: -keep
#6 0.069
#6 0.070 NAME:
#6 0.070 runc run - create and run a container
#6 0.074
#6 0.074 USAGE:
#6 0.075 runc run [command options]
#6 0.078
#6 0.079 Where “” is your name for the instance of the container that you
#6 0.079 are starting. The name you provide for the container instance must be unique on
#6 0.080 your host.
#6 0.084
#6 0.084 DESCRIPTION:
#6 0.084 The run command creates an instance of a container for a bundle. The bundle
#6 0.084 is a directory with a specification file named “config.json” and a root
#6 0.084 filesystem.
#6 0.084
#6 0.084 The specification file includes an args parameter. The args parameter is used
#6 0.084 to specify command(s) that get run when the container is started. To change the
#6 0.084 command(s) that get executed on start, edit the args parameter of the spec. See
#6 0.085 “runc spec --help” for more explanation.
#6 0.085
#6 0.085 OPTIONS:
#6 0.085 --bundle value, -b value path to the root of the bundle directory, defaults to the current directory
#6 0.085 --console-socket value path to an AF_UNIX socket which will receive a file descriptor referencing the master end of the console’s pseudoterminal
#6 0.085 --detach, -d detach from the container’s process
#6 0.085 --pid-file value specify the file to write the process id to
#6 0.086 --no-subreaper disable the use of the subreaper used to reap reparented processes
#6 0.086 --no-pivot do not use pivot root to jail process inside rootfs. This should be used whenever the rootfs is on top of a ramdisk
#6 0.086 --no-new-keyring do not create a new session keyring for the container. This will cause the container to inherit the calling processes session key
#6 0.087 --preserve-fds value Pass N additional file descriptors to the container (stdio + $LISTEN_FDS + N in total) (default: 0)
#6 0.087
#6 0.089 flag provided but not defined: -keep
#6 ERROR: process “/bin/sh -c if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi” did not complete successfully: exit code: 1
failed to solve: process “/bin/sh -c if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi” did not complete successfully: exit code: 1

能远程吗?

可以可以,远程主机还是电脑

docker 版本问题,升级就可以了