containers / podman-desktop

Podman Desktop is the best free and open source tool to work with Containers and Kubernetes for developers. Get an intuitive and user-friendly interface to effortlessly build, manage, and deploy containers and Kubernetes — all from your desktop.
https://podman-desktop.io
Apache License 2.0
4.78k stars 300 forks source link

podman-desktop containers seem to not expose web services on the host #9513

Closed D3vil0p3r closed 4 hours ago

D3vil0p3r commented 5 hours ago

Bug description

I built Empire Dockerfile by Podman Desktop and when I run the container by Podman Desktop, by logs the container seems to work correctly as done when I run it by podman CLI. The output of logs is:

[INFO]: Plugin csharpserver ran successfully! 
[INFO]: Empire starting up... 
[INFO]: Certificate not found. Generating... 
[*] Certificate written to /empire/empire/server/data/empire-chain.pem
[*] Private key written to /empire/empire/server/data/empire-priv.key
[INFO]: Starkiller enabled. Loading. 
[INFO]: Starkiller served at the same ip and port as Empire Server 
[INFO]: Starkiller served at http://localhost:1337/index.html 
[INFO]: Started server process [8] 
[INFO]: Waiting for application startup. 
[INFO]: Application startup complete. 
[INFO]: Uvicorn running on http://0.0.0.0:1337 (Press CTRL+C to quit) 

When the container is run by Podman Desktop, if I visit http://localhost:1337/index.html by the browser, I cannot reach the page. It works if I use podman CLI.

Operating system

Arch Linux

Installation Method

Other

Version

1.13.0

Steps to reproduce

Just clone https://github.com/BC-SECURITY/Empire and build its Dockerfile by Podman Desktop and run the container. Watch the logs and connect to http://localhost:1337/index.html

Relevant log output

No response

Additional context

No response

D3vil0p3r commented 4 hours ago

Needed to specify port mapping after building the image on "Images" section, selecting the built image, then click on Play icon to run the image. At click, you need to go to Port mapping and select 1337 for host and 1337 for container. Finally, click on Start the container.