Docker run ports

docker run -ti -e VIRTUAL_HOST=localhost -p 80:80 -p 443:443 -p 22:22 -v tuleap-data:/data enalean/tuleap-aio

https://hub.docker.com/r/enalean/tuleap-aio/

I’m wondering what 80:80 in that format stands for? I’m familiar with VirtualBox port forwarding guest and host, where you have the guest running on port 80 and the host on 8080.

Second I managed to run in on my Windows Docker and open up localhost on my host. Secondly I tried this by spinning up a VirtualBox and running Docker within a Linux box, but localhost didn’t work, so that made me wonder if I had to specify the port numbers for guest and host as I do regularly to be able to open localhost in the browser.

Same: public:private. It’s explicit.

Ports are typically defined at image build-time (dockerfile; compose), so overriding them within the run command is optional: unless you’re changing the port-mapping, you can ommit those 3 arguments - provided they are defined within the image (as that’s optional, too).