docker无法正常运行mysql容器


Docker 版本:
[root@bogon ~]# docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64

Server:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64

拉取镜像:
[root@bogon ~]# docker pull mysql
Using default tag: latest
Trying to pull repository docker.io/library/mysql ...
latest: Pulling from docker.io/library/mysql
6d827a3ef358: Pull complete
ed0929eb7dfe: Pull complete
03f348dc3b9d: Pull complete
fd337761ca76: Pull complete
7e6cc16d464a: Pull complete
ca3d380bc018: Pull complete
3fe11378d5c0: Pull complete
2b5dfd325645: Pull complete
b54281d17fbe: Pull complete
7eae4db8eea5: Pull complete
76cf68e17b09: Pull complete
Digest: sha256:49b7d6d8d45f8c3300cba056e8cdf36c714d99e0b40f7005b9e6e75e64ecdf7c
[root@bogon ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:15:5d:02:6d:14 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.111/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::dc53:485:5a9f:88a1/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:42:02:85:dd:b9 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:2ff:fe85:ddb9/64 scope link
valid_lft forever preferred_lft forever

运行容器
[root@bogon ~]# docker run --name mysqlserver --net=host -e MYSQL_ROOT_PASSWORD=root -v /storage/mysql:/var/lab/mysql -d mysql
46a271b73a54bd35cfd6a3c15553cf20ebc5b26e2779fc033963592c1e0d8856
[root@bogon ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
46a271b73a54 mysql "docker-entrypoint.sh" About a minute ago Up About a minute mysqlserver

运行状态直接停止了,请问各位大神这是什么原因?
已邀请:

dfzone

赞同来自:


莫名奇妙,不知道什么原因。镜像和容器都删除,又重新run了一遍,好了。。。

要回复问题请先登录注册