我已经安装"Development Tools"
并运行了以下命令:
podman pull mysql:latest # this is pulled from docker.io
podman images # lists the correct image
mkdir ~/mysql_data ; cd mysql_data
podman run -d \
--name mysql \
-p 3306:3306 \
-v ~/mysql_data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD='My password' \
-e MYSQL_USER=dbuser \
-e MYSQL_PASSWORD='My DB password' \
-e MYSQL_DATABASE=testdb \
mysql:latest
podman ps # lists no running containers
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
341ff9ebe686 docker.io/library/mysql:latest mysqld 7 minutes ago Created 0.0.0.0:3306->3306/tcp mysql
但是,当我尝试执行下一个命令 ( podman exec -it mysql /bin/bash
) 时,出现以下错误:
Error: can only create exec sessions on running containers: container state improper
我究竟做错了什么?
谢谢。
显然,SELinux 不喜欢你的主文件夹中的容器,所以诀窍是
:Z
向卷中添加一个,如下所示: