podman实验中安装nginx镜像无法通过浏览器打开

podman实验中安装nginx镜像无法通过浏览器打开

[ly@localhost Desktop]$ podman images -a
REPOSITORY                     TAG     IMAGE ID      CREATED        SIZE
docker.io/library/nginx        latest  605c77e624dd  11 months ago  146 MB
docker.io/library/hello-world  latest  feb5d9fea6a5  14 months ago  19.9 kB
[ly@localhost Desktop]$ podman run -p 8012:8080 -itd 605c77e624dd
2ff66d117f6a6f4f9e2ab19b4fcaa4dd46e99b3f381ba1239459d73f26cea5b5
[ly@localhost Desktop]$ podman ps -a
CONTAINER ID  IMAGE                                 COMMAND               CREATED        STATUS                    PORTS                   NAMES
a1a762c55494  docker.io/library/hello-world:latest  /hello                5 minutes ago  Exited (0) 5 minutes ago                          heuristic_kapitsa
2ff66d117f6a  docker.io/library/nginx:latest        nginx -g daemon o...  5 seconds ago  Up 5 seconds ago          0.0.0.0:8012->8080/tcp  infallible_easley
[ly@localhost Desktop]$ firefox 127.0.0.1:8012

###!!! [Parent][MessageChannel] Error: (msgtype=0xB000E,name=PBackgroundIDBDatabase::Msg_CloseAfterInvalidationComplete) Channel error: cannot send/recv

[ly@localhost Desktop]$ firefox 127.0.0.1:8012

^CExiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.



你是在图形界面上的终端上操作的吧???
是啦,运行完容器后,你首先查下端口是否侦听(netstat -lntup | grep 8012),确定端口起来后,再测试访问
如果是在命令行,直接用 curl http://127.0.0.1:8012 访问看看