gpt4 book ai didi

docker - CentOS 镜像未运行?

转载 作者:行者123 更新时间:2023-12-02 11:36:01 25 4
gpt4 key购买 nike

我下载了在后台作为守护进程执行的 centos 基础镜像,然后厌倦了进入终端,但无法进入。

我的主机是 Ubuntu 16.04。

以下是我执行的步骤:

主机操作系统版本Ubuntu16.04

 root@jim-Ubuntu1504:/home/jim/web# lsb_release -a No LSB modules are
available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS
Release: 16.04 Codename: xenial
root@jim-Ubuntu1504:/home/jim/web#

通过以下命令启动docker

root@jim-Ubuntu1504:/home/jim/web# docker run -d --name=my_centos centos
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos
a3ed95caeb02: Pull complete
da71393503ec: Pull complete
Digest: sha256:1a62cd7c773dd5c6cf08e2e28596f6fcc99bd97e38c9b324163e0da90ed27562
Status: Downloaded newer image for centos:latest
63f4b8fce1bd44253bb420436da3ad5b8f532b253fc9e74ff52ad1b2f9844251
root@jim-Ubuntu1504:/home/jim/web# docker exec -i -t my_centos bash
Error response from daemon: Container 63f4b8fce1bd44253bb420436da3ad5b8f532b253fc9e74ff52ad1b2f9844251 is not running

不知道为什么退出

root@jim-Ubuntu1504:/home/jim/web# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
63f4b8fce1bd centos "/bin/bash" 18 minutes ago Exited (0) 18 minutes ago my_centos
f0ca8b9f4fa5 nginx "nginx -g 'daemon off" 23 minutes ago Up 23 minutes 80/tcp, 443/tcp my_nginxtemp
bb9ab4958c33 nginx "nginx -g 'daemon off" About an hour ago Up About an hour 80/tcp, 443/tcp boring_aryabhata
886d174f641d nginx "nginx -g 'daemon off" 2 hours ago Up 2 hours 80/tcp, 443/tcp mad_fermat
root@jim-Ubuntu1504:/home/jim/web#

启动了容器,但不知道为什么它退出

root@jim-Ubuntu1504:/home/jim/web# docker start 63f4b8fce1bd
63f4b8fce1bd
root@jim-Ubuntu1504:/home/jim/web# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
63f4b8fce1bd centos "/bin/bash" 26 minutes ago Exited (0) 2 seconds ago my_centos
f0ca8b9f4fa5 nginx "nginx -g 'daemon off" 30 minutes ago Up 30 minutes 80/tcp, 443/tcp my_nginxtemp
bb9ab4958c33 nginx "nginx -g 'daemon off" About an hour ago Up About an hour 80/tcp, 443/tcp boring_aryabhata
886d174f641d nginx "nginx -g 'daemon off" 2 hours ago Up 2 hours 80/tcp, 443/tcp mad_fermat
root@jim-Ubuntu1504:/home/jim/web# docker exec -i -t my_centos bash
Error response from daemon: Container 63f4b8fce1bd44253bb420436da3ad5b8f532b253fc9e74ff52ad1b2f9844251 is not running
root@jim-Ubuntu1504:/home/jim/web#

PS:有人可以取消每 90 分钟发帖一次的限制吗???学习必须是自发的和互动的。

最佳答案

您正在寻找以分离模式运行的centos容器。尝试以下操作...

sudo docker run -d -it centos

关于docker - CentOS 镜像未运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37696932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com