没有不值得去解决的问题,也没有不值得去学习的技术!

执行命令:docker-compose -f docker-compose.yml up –build –force-recreate 时,报错:ERROR [startup_object-fpm internal] load metadata for docker.io/library/php:7.4-fpm-alpine

拉取最新代码后,再次执行命令,报错:Error response from daemon: error while creating mount source path。
1、执行命令:docker-compose -f docker-compose.yml up –build –force-recreate 时,报错:ERROR [startup_object-fpm internal] load metadata for docker.io/library/php:7.4-fpm-alpine 。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xxx/object/startup$ docker-compose -f docker-compose.yml up --build --force-recreate
[+] Building 1.7s (4/6)
 => [startup_object-fpm internal] load build definition from Dockerfile                                                                                                                                      0.1s
[+] Building 1.8s (6/6) FINISHED
 => [startup_object-fpm internal] load build definition from Dockerfile                                                                                                                                      0.1s
 => => transferring dockerfile: 32B                                                                                                                                                                         0.0s
 => [startup_object-nginx internal] load build definition from Dockerfile                                                                                                                                    0.1s
 => => transferring dockerfile: 32B                                                                                                                                                                         0.0s
 => [startup_object-fpm internal] load .dockerignore                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                                             0.0s
 => [startup_object-nginx internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                             0.0s
 => ERROR [startup_object-fpm internal] load metadata for docker.io/library/php:7.4-fpm-alpine                                                                                                               1.6s
 => ERROR [startup_object-nginx internal] load metadata for docker.io/library/nginx:1.20.0-alpine                                                                                                            1.5s
------
 > [startup_object-fpm internal] load metadata for docker.io/library/php:7.4-fpm-alpine:
------
------
 > [startup_object-nginx internal] load metadata for docker.io/library/nginx:1.20.0-alpine:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xxx/object/startup$


2、拉取最新代码后,再次执行命令,报错:Error response from daemon: error while creating mount source path。如图1
拉取最新代码后,再次执行命令,报错:Error response from daemon: error while creating mount source path。
图1


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xxx/object/startup$ make start
docker-compose -f docker-compose.yml up --remove-orphans
[+] Building 8.8s (16/16) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 32B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/nginx:1.20.0-alpine                                             3.8s
 => [internal] load metadata for harbor-core.lfsz.xxx.top/object/admin:feat-s3-test                          2.6s
 => [auth] object/admin:pull token for harbor-core.lfsz.xxx.top                                              0.0s
 => [auth] library/nginx:pull token for registry-1.docker.io                                                       0.0s
 => [stage-0 1/1] FROM harbor-core.lfsz.xxx.top/object/admin:feat-s3-test@sha256:6624e9a4cd3dd1758ef6e59493  3.8s
 => => resolve harbor-core.lfsz.xxx.top/object/admin:feat-s3-test@sha256:6624e9a4cd3dd1758ef6e594930ae6a54b  0.0s
 => => sha256:6624e9a4cd3dd1758ef6e594930ae6a54b7ce4c886f12dee5e473d586e09a852 740B / 740B                         0.0s
 => => sha256:f534cb483d935a219c947c60e295030ecb8b3b6d4b5aa14658582bf0d5b73806 2.50kB / 2.50kB                     0.0s
 => => sha256:fe77c74bfa30e9cbdc3db2ae59630a1168b2ca92fc3773abd8497c008516de54 18.78MB / 18.78MB                   2.9s
 => => extracting sha256:fe77c74bfa30e9cbdc3db2ae59630a1168b2ca92fc3773abd8497c008516de54                          0.7s
 => [stage-1 1/7] FROM docker.io/library/nginx:1.20.0-alpine@sha256:e015192ec74937149dce3aa1feb8af016b7cce3a28962  0.0s
 => [internal] load build context                                                                                  0.1s
 => => transferring context: 1.68kB                                                                                0.0s
 => CACHED [stage-1 2/7] RUN rm -rf /etc/nginx/sites-enabled/* /etc/nginx/conf.d/*                                 0.0s
 => [stage-1 3/7] COPY ./config/default.conf.template /etc/nginx/conf.d/                                           0.0s
 => [stage-1 4/7] ADD ./run.sh /run.sh                                                                             0.0s
 => [stage-1 5/7] RUN chmod +x /run.sh                                                                             0.5s
 => [stage-1 6/7] WORKDIR /object                                                                                   0.1s
 => [stage-1 7/7] COPY --from=0 /var/www/admin /admin                                                              0.3s
 => exporting to image                                                                                             0.3s
 => => exporting layers                                                                                            0.3s
 => => writing image sha256:c22dc85ff549be566fd32274349f0b4fb2bf90ce7e73fb161631330010190fe7                       0.0s
 => => naming to docker.io/library/startup_object-ingress                                                           0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[+] Running 8/8
 ⠿ Container object-admin      Removed                                                                              0.1s
 ⠿ Container object-nginx      Removed                                                                              0.1s
 ⠿ Container object-wordpress  Recreated                                                                            0.5s
 ⠿ Container object-mailhog    Created                                                                              0.0s
 ⠿ Container object-redis      Created                                                                              0.0s
 ⠿ Container object-mysql      Created                                                                              0.0s
 ⠿ Container object-fpm        Recreated                                                                            0.3s
 ⠿ Container object-ingress    Created                                                                              0.1s
Attaching to object-fpm, object-ingress, object-mailhog, object-mysql, object-redis, object-wordpress
object-mysql      | 2021-12-28 01:42:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.36-1debian10 started.
object-mysql      | 2021-12-28 01:42:21+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
object-mysql      | 2021-12-28 01:42:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.36-1debian10 started.
object-mysql      | 2021-12-28T01:42:22.153336Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
object-mysql      | 2021-12-28T01:42:22.153389Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
object-mysql      | 2021-12-28T01:42:22.156080Z 0 [Note] mysqld (mysqld 5.7.36) starting as process 1 ...
object-mysql      | 2021-12-28T01:42:22.159754Z 0 [Note] InnoDB: PUNCH HOLE support available
object-mysql      | 2021-12-28T01:42:22.159808Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
object-mysql      | 2021-12-28T01:42:22.159814Z 0 [Note] InnoDB: Uses event mutexes
object-mysql      | 2021-12-28T01:42:22.159819Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
object-mysql      | 2021-12-28T01:42:22.159823Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
object-mysql      | 2021-12-28T01:42:22.159827Z 0 [Note] InnoDB: Using Linux native AIO
object-mysql      | 2021-12-28T01:42:22.163104Z 0 [Note] InnoDB: Number of pools: 1
object-mysql      | 2021-12-28T01:42:22.163285Z 0 [Note] InnoDB: Using CPU crc32 instructions
object-mysql      | 2021-12-28T01:42:22.165635Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
object-mysql      | 2021-12-28T01:42:22.179449Z 0 [Note] InnoDB: Completed initialization of buffer pool
object-mysql      | 2021-12-28T01:42:22.182000Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
object-mysql      | 2021-12-28T01:42:22.194605Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
object-mysql      | 2021-12-28T01:42:22.204077Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
object-mysql      | 2021-12-28T01:42:22.204168Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
object-mysql      | 2021-12-28T01:42:22.327333Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
object-mysql      | 2021-12-28T01:42:22.331317Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
object-mysql      | 2021-12-28T01:42:22.331418Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
object-mysql      | 2021-12-28T01:42:22.336559Z 0 [Note] InnoDB: 5.7.36 started; log sequence number 12659763
object-mysql      | 2021-12-28T01:42:22.336848Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
object-mysql      | 2021-12-28T01:42:22.337114Z 0 [Note] Plugin 'FEDERATED' is disabled.
object-mysql      | 2021-12-28T01:42:22.338690Z 0 [Note] InnoDB: Buffer pool(s) load completed at 211228  1:42:22
object-mysql      | 2021-12-28T01:42:22.346819Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
object-mysql      | 2021-12-28T01:42:22.346868Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
object-mysql      | 2021-12-28T01:42:22.346874Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
object-mysql      | 2021-12-28T01:42:22.346876Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
object-mysql      | 2021-12-28T01:42:22.347765Z 0 [Warning] CA certificate ca.pem is self signed.
object-mysql      | 2021-12-28T01:42:22.347836Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
object-mysql      | 2021-12-28T01:42:22.350288Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
object-mysql      | 2021-12-28T01:42:22.350773Z 0 [Note] IPv6 is available.
object-mysql      | 2021-12-28T01:42:22.350825Z 0 [Note]   - '::' resolves to '::';
object-mysql      | 2021-12-28T01:42:22.351070Z 0 [Note] Server socket created on IP: '::'.
object-mysql      | 2021-12-28T01:42:22.367800Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
object-mysql      | 2021-12-28T01:42:22.378217Z 0 [Note] Event Scheduler: Loaded 0 events
object-mysql      | 2021-12-28T01:42:22.378599Z 0 [Note] mysqld: ready for connections.
object-mysql      | Version: '5.7.36'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
object-mailhog    | 2021/12/28 01:42:22 Using in-memory storage
object-mailhog    | 2021/12/28 01:42:22 [SMTP] Binding to address: 0.0.0.0:1025
object-mailhog    | 2021/12/28 01:42:22 Serving under http://0.0.0.0:8025/
object-mailhog    | [HTTP] Binding to address: 0.0.0.0:8025
object-mailhog    | Creating API v1 with WebPath:
object-mailhog    | Creating API v2 with WebPath:
object-redis      | 1:C 28 Dec 2021 01:42:22.439 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
object-redis      | 1:C 28 Dec 2021 01:42:22.439 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
object-redis      | 1:C 28 Dec 2021 01:42:22.439 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
object-redis      | 1:M 28 Dec 2021 01:42:22.440 * monotonic clock: POSIX clock_gettime
object-redis      | 1:M 28 Dec 2021 01:42:22.444 * Running mode=standalone, port=6379.
object-redis      | 1:M 28 Dec 2021 01:42:22.444 # Server initialized
object-redis      | 1:M 28 Dec 2021 01:42:22.444 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
object-redis      | 1:M 28 Dec 2021 01:42:22.452 * Loading RDB produced by version 6.2.6
object-redis      | 1:M 28 Dec 2021 01:42:22.452 * RDB age 1234 seconds
object-redis      | 1:M 28 Dec 2021 01:42:22.452 * RDB memory usage when created 0.77 Mb
object-redis      | 1:M 28 Dec 2021 01:42:22.452 # Done loading RDB, keys loaded: 0, keys expired: 0.
object-redis      | 1:M 28 Dec 2021 01:42:22.452 * DB loaded from disk: 0.000 seconds
object-redis      | 1:M 28 Dec 2021 01:42:22.452 * Ready to accept connections
Error response from daemon: error while creating mount source path '/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/cb1d4e166be8da67c985eaa6640200414da5e260a1037331857b1232a2d526dc': mkdir /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/cb1d4e166be8da67c985eaa6640200414da5e260a1037331857b1232a2d526dc: file exists
make: *** [Makefile:5: start] Error 1
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xxx/object/startup$


3、决定在 Docker 中,删除最近 2 天的 Volumes。删除时,报错:Cannot remove volume larabbs_sailmeilisearch. Reason: Error invoking remote method ‘docker-remove-volume’: Error: (HTTP code 409) conflict – remove larabbs_sailmeilisearch: volume is in use – [bf9fa52704306685e964ffc6e0ffc96661aef831419034518c7ad38c4501625c] 。前提是需要提前删除相应的容器。如图2
决定在 Docker 中,删除最近 2 天的 Volumes。删除时,报错:Cannot remove volume larabbs_sailmeilisearch. Reason: Error invoking remote method 'docker-remove-volume': Error: (HTTP code 409) conflict - remove larabbs_sailmeilisearch: volume is in use - [bf9fa52704306685e964ffc6e0ffc96661aef831419034518c7ad38c4501625c] 。前提是需要提前删除相应的容器。
图2
4、仍然报错,即使关闭 Docker Desktop,再打开 Docker Desktop。仍然报同样的错误,最后重启电脑,得以解决。不过又继续报错: /docker-entrypoint.sh: exec: line 38: /run.sh: not found object-ingress exited with code 127。


object-ingress    | /docker-entrypoint.sh: exec: line 38: /run.sh: not found
object-ingress exited with code 127
object-mailhog    | [APIv1] KEEPALIVE /api/v1/events
object-mailhog    | [APIv1] KEEPALIVE /api/v1/events


5、执行命令,运行容器:643070b10285,报错:Unable to find image ‘643070b10285:latest’ locally 。如图3
执行命令,运行容器:643070b10285,报错:Unable to find image '643070b10285:latest' locally 。
图3


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xxx/object/startup$ docker run 643070b10285 ls -l /
Unable to find image '643070b10285:latest' locally
docker: Error response from daemon: pull access denied for 643070b10285, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.


6、查看容器的日志


wangqiang@DESKTOP-QLPK8QM:/mnt/c/Users/Lenovo$ docker logs 516ee3068762
/docker-entrypoint.sh: exec: line 38: /run.sh: not found
/docker-entrypoint.sh: exec: line 38: /run.sh: not found


7、编辑 run.sh 文件,行分隔符从 CR – Classic Mac OS (\r) 调整为 CRLF – Windows (\r\n)。如图4
编辑 run.sh 文件,行分隔符从 CR - Classic Mac OS (\r) 调整为 CRLF - Windows (\r\n)。
图4
8、再次执行命令,不再报错。  

Linux 服务器运维、部署与线上故障排查

如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。

适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查

服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持

如需咨询,请联系我,并注明:Linux 运维咨询

联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理