1Panel安装PHP 5.4.45,安装错误
通过应用商店安装提示:镜像 build 失败:failed to solve: process “/bin/sh -c chmod +x install.sh && sh install.sh && rm -rf /tmp/extensions” did not complete successfully: exit code: 1
后来尝试手动拉取library/php:5.4.45-fpm 镜像,docker提示错误:
[DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. Suggest the author of docker.io/library/php:5.4.45-fpm to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at Registry | Docker Docs
好像是说docker镜像有问题,各位大佬是怎么解决的呢
现在PHP5.4基本上没人用了吧,,,最少都5.6了把
没办法,有个应用是5.4上面开发的
再重新创建编译一下吧,我这里创建PHP5.4.45是成功的。
另外你手动拉取的镜像架构太老了,所以报错
因为看到官方商店安装的时候是拉取的这个镜像。以下是构建镜像的日志:
#0 building with “default” instance using docker driver
#1 [1panel-php internal] load build definition from Dockerfile
#1 transferring dockerfile: 613B 0.0s done
#1 DONE 0.0s
#2 [1panel-php internal] load metadata for docker.io/library/php:5.4.45-fpm
#2 DONE 2.7s
#3 [1panel-php internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [1panel-php internal] load build context
#4 DONE 0.0s
#5 [1panel-php 1/7] FROM docker.io/library/php:5.4.45-fpm@sha256:b8e42519a65cf21787c1662c7106d0f470b498284b3cd9abb2eb135635419434
#5 resolve docker.io/library/php:5.4.45-fpm@sha256:b8e42519a65cf21787c1662c7106d0f470b498284b3cd9abb2eb135635419434
#5 resolve docker.io/library/php:5.4.45-fpm@sha256:b8e42519a65cf21787c1662c7106d0f470b498284b3cd9abb2eb135635419434 0.5s done
#5 DONE 0.5s
#4 [1panel-php internal] load build context
#4 transferring context: 275B 0.0s done
#4 DONE 0.0s
#6 [1panel-php 2/7] COPY ./extensions /tmp/extensions
#6 CACHED
#7 [1panel-php 3/7] WORKDIR /tmp/extensions
#7 CACHED
#8 [1panel-php 4/7] RUN chmod +x install.sh && sh install.sh && rm -rf /tmp/extensions
#8 0.920 exec /bin/sh: exec format error
#8 ERROR: process “/bin/sh -c chmod +x install.sh && sh install.sh && rm -rf /tmp/extensions” did not complete successfully: exit code: 1
failed to solve: process “/bin/sh -c chmod +x install.sh && sh install.sh && rm -rf /tmp/extensions” did not complete successfully: exit code: 1
[1panel-php 4/7] RUN chmod +x install.sh && sh install.sh && rm -rf /tmp/extensions:
0.920 exec /bin/sh: exec format error
请问您是直接再应用商店安装的吗 还是手动拉取的镜像
直接构建的,测试了默认拓展,正常
构建日志
#9 [1panel-php 5/7] RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar && chmod +x /usr/bin/composer
#9 0.208 % Total % Received % Xferd Average Speed Time Time Time Current
#9 0.208 Dload Upload Total Spent Left Speed
#9 0.208
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
4 2918k 4 140k 0 0 518k 0 0:00:05 --:--:-- 0:00:05 517k
76 2918k 76 2228k 0 0 1745k 0 0:00:01 0:00:01 --:--:-- 1743k
100 2918k 100 2918k 0 0 1823k 0 0:00:01 0:00:01 --:--:-- 1823k
#9 DONE 1.8s
#10 [1panel-php 6/7] RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
#10 DONE 0.2s
#11 [1panel-php 7/7] WORKDIR /www
#11 DONE 0.0s
#12 [1panel-php] exporting to image
#12 exporting layers 0.1s done
#12 writing image sha256:7f0ced04fad3cd9cbe96edc4d159929d66fcb7731dbc939cfae22473c03f918f
#12 writing image sha256:7f0ced04fad3cd9cbe96edc4d159929d66fcb7731dbc939cfae22473c03f918f done
#12 naming to docker.io/library/1panel-php:5.4.45 done
#12 DONE 0.1s
哦等等,你是arm cpu?
By ChatGPT
出现 `exec /bin/sh: exec format error` 错误,通常是由于尝试在不兼容的体系结构上运行命令,比如在 ARM 架构上运行为 x86 构建的二进制文件。要解决这个问题,可以尝试以下步骤:
是arm的cpu。目前可以安装5.6 5.4和5.5都不行