下载mysql镜像
[root@localhost ~]# docker pull mysql:5.5.
创建mysql容器
[root@localhost ~]# docker run -itd --name mysql -p : --restart=always -e MYSQL_ROOT_PASSWORD= mysql:5.5.
-i,-interactive Keep STDIN open even if not attached
-t,--tty Allocate a pseudo-TTY
-d, --detach Run container in background and print container ID
--name string Assign a name to the container
-p,--publish list Publish a container's port(s) to the host
--restart string Restart policy to apply when a container exits (default "no")
-e ,--env list Set environment variables