nginx 为什么容器在不同的主机上使用相同版本的Docker镜像创建,一个使用ls命令,另一个没有它?

e5nszbig  于 2024-01-06  发布在  Nginx
关注(0)|答案(1)|浏览(208)

为什么在不同的主机上使用相同版本的Docker镜像创建容器,一个使用ls命令,另一个不使用它。the question image

我搜索了几乎所有的文档,都没有找到答案,我想知道这是什么原因,造成的情况?

机器A的产量

  1. docker run -it --name nginx --entrypoint ls nginx:1.25.1 /etc
  2. adduser.conf fonts ld.so.cache passwd shadow
  3. alternatives fstab ld.so.conf passwd- shadow-
  4. apt gai.conf ld.so.conf.d profile shells
  5. bash.bashrc group libaudit.conf profile.d skel
  6. bindresvport.blacklist group- localtime rc0.d ssl
  7. ca-certificates gshadow login.defs rc1.d subgid
  8. ca-certificates.conf gshadow- logrotate.d rc2.d subuid
  9. cron.d gss mke2fs.conf rc3.d systemd
  10. cron.daily host.conf motd rc4.d terminfo
  11. debconf.conf hostname mtab rc5.d timezone
  12. debian_version hosts nginx rc6.d update-motd.d
  13. default init.d nsswitch.conf rcS.d xattr.conf
  14. deluser.conf inputrc opt resolv.conf
  15. dpkg issue os-release rmt
  16. e2scrub.conf issue.net pam.conf security
  17. environment kernel pam.d selinux

字符串
机器B的输出

  1. docker run -it --name nginx --entrypoint ls nginx:1.25.1 /etc
  2. docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"ls\": executable file not found in $PATH": unknown.
  3. ERRO[0000] error waiting for container: context canceled


机器A的信息

  1. uname -a
  2. Linux ubuntu2204.localdomain 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  3. docker info
  4. Client:
  5. Context: default
  6. Debug Mode: false
  7. Plugins:
  8. buildx: Docker Buildx (Docker Inc., v0.10.4)
  9. compose: Docker Compose (Docker Inc., v2.17.2)
  10. Server:
  11. Containers: 2
  12. Running: 1
  13. Paused: 0
  14. Stopped: 1
  15. Images: 2
  16. Server Version: 20.10.24
  17. Storage Driver: overlay2
  18. Backing Filesystem: extfs
  19. Supports d_type: true
  20. Native Overlay Diff: true
  21. userxattr: false
  22. Logging Driver: json-file
  23. Cgroup Driver: systemd
  24. Cgroup Version: 2
  25. Plugins:
  26. Volume: local
  27. Network: bridge host ipvlan macvlan null overlay
  28. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  29. Swarm: inactive
  30. Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
  31. Default Runtime: runc
  32. Init Binary: docker-init
  33. containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
  34. runc version:
  35. init version: de40ad0
  36. Security Options:
  37. apparmor
  38. seccomp
  39. Profile: default
  40. cgroupns
  41. Kernel Version: 5.15.0-69-generic
  42. Operating System: Ubuntu Core 22
  43. OSType: linux
  44. Architecture: x86_64
  45. CPUs: 4
  46. Total Memory: 7.763GiB
  47. Name: ubuntu2204.localdomain
  48. ID: C75T:TAOG:RQZP:LIYO:3MRE:W5ER:5I2D:IMUC:PTQP:LWZL:62KP:U5XQ
  49. Docker Root Dir: /var/snap/docker/common/var-lib-docker
  50. Debug Mode: false
  51. Registry: https://index.docker.io/v1/
  52. Labels:
  53. Experimental: false
  54. Insecure Registries:
  55. 127.0.0.0/8
  56. Registry Mirrors:
  57. https://xxx
  58. Live Restore Enabled: false


机器B的信息

  1. uname -a
  2. Linux master 3.10.0-1160.an7.x86_64 #1 SMP Thu Oct 14 16:04:36 CST 2021 x86_64 x86_64 x86_64 GNU/Linux
  3. docker info
  4. Client:
  5. Debug Mode: false
  6. Server:
  7. Containers: 145
  8. Running: 76
  9. Paused: 0
  10. Stopped: 69
  11. Images: 252
  12. Server Version: 19.03.13
  13. Storage Driver: overlay2
  14. Backing Filesystem: xfs
  15. Supports d_type: true
  16. Native Overlay Diff: true
  17. Logging Driver: json-file
  18. Cgroup Driver: systemd
  19. Plugins:
  20. Volume: local
  21. Network: bridge host ipvlan macvlan null overlay
  22. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  23. Swarm: inactive
  24. Runtimes: runc
  25. Default Runtime: runc
  26. Init Binary: docker-init
  27. containerd version: ea765aba0d05254012b0b9e595e995c09186427f
  28. runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
  29. init version: fec3683
  30. Security Options:
  31. seccomp
  32. Profile: default
  33. Kernel Version: 3.10.0-1160.an7.x86_64
  34. Operating System: Anolis OS 7.9
  35. OSType: linux
  36. Architecture: x86_64
  37. CPUs: 6
  38. Total Memory: 11.58GiB
  39. Name: master
  40. ID: TMQB:QWTV:CQMU:FN32:TUU4:XQBZ:I4F3:DMX2:U4BV:MRU3:5JU6:YJHR
  41. Docker Root Dir: /var/lib/docker
  42. Debug Mode: false
  43. HTTP Proxy: http://172.31.1.1:8070
  44. HTTPS Proxy: http://172.31.1.1:8070
  45. No Proxy: 127.0.0.0/8,10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,169.254.0.0/16,100.0.0.0/8,168.0.0.0/8,localhost,svc,local
  46. Registry: https://index.docker.io/v1/
  47. Labels:
  48. Experimental: false
  49. Insecure Registries:
  50. 127.0.0.0/8
  51. Registry Mirrors:
  52. https://xxx
  53. Live Restore Enabled: false

rwqw0loc

rwqw0loc1#

机器A(v20.10.24)和机器B(v19.03.13)上的Docker版本不同,因此它们很可能以不同的方式阅读docker run命令。根据this answer中的信息,您需要重新排列机器B上的命令选项。

相关问题