docker: invalid containerPort: 80800 means the last part of a -p value, the port inside the container, is not a valid port. No container was created: even without --rm, docker ps -a listed none afterwards. Check the -p value against the shape [host address:]host port:container port and fix the part after the last colon.

In the tests below the fault was a typo (an extra zero), a dash where a colon belonged, or a name instead of a number. Each one failed with exit code 125 and the same kind of line.

The error

> docker run --rm --name fix10-dc-p8a -p 127.0.0.1:15935:80800 alpine true
docker: invalid containerPort: 80800

Run 'docker run --help' for more information
exit=125

Why it happens

80800 is too large. In a second run, a container port of 65535 was accepted (exit code 0) and 65536 was refused with docker: invalid containerPort: 65536. The -p value is split at its colons: host address, host port, container port. A mistake elsewhere in the value can end up in the last slot and be reported as the container port. With a dash instead of the second colon, the host port and the container port ran together:

> docker run --rm --name fix10-dc-p8c -p 127.0.0.1:15935-8080 alpine true
docker: invalid containerPort: 15935-8080

Run 'docker run --help' for more information
exit=125

A service name in place of the number gave the same message:

> docker run --rm --name fix10-dc-p8d -p 127.0.0.1:15935:http alpine true
docker: invalid containerPort: http

Run 'docker run --help' for more information
exit=125

A typo in the middle number gives the sister message, naming the host port instead:

> docker run --rm --name fix10-dc-p8b -p 127.0.0.1:159350:8080 alpine true
docker: invalid hostPort: 159350

Run 'docker run --help' for more information
exit=125

The fix

> docker run --rm --name fix10-dc-p8e -p 127.0.0.1:15935:8080 alpine true
exit=0

Two port numbers separated by a colon, with the optional host address in front, as in 127.0.0.1:15935:8080, which Docker accepted. The container port is the one your app listens on inside the container. The host address, 127.0.0.1, was the same in every run, including the one that worked, so it played no part here. Each refused run printed the hint Run 'docker run --help' for more information and exited with 125.

How it was reproduced

Docker client and engine 29.9.3 on Windows, the alpine image with the command true, so a run that got past the -p check exited at once. The commands ran from a cmd batch file with stderr merged into stdout, each one echoed with > and followed by its exit code. The container names are the test's own.

Frequently asked

What does invalid containerPort mean in docker run?
The part of the -p value after the last colon is not a valid port. In the tests that was 80800, 15935-8080 after a dash replaced a colon, and the word http. Each failed with exit code 125.
What is the order of ports in docker run -p?
Host address (optional), host port, container port, separated by colons, for example -p 127.0.0.1:15935:8080. The container port is the one the app listens on inside the container.
What does invalid hostPort mean?
The middle number of the -p value is not a valid port. In the test -p 127.0.0.1:159350:8080 failed with docker: invalid hostPort: 159350.

More decoded errors in the Fixes category. When the value is valid but the app inside still does not answer, see curl: (52) Empty reply from server with ASPNETCORE_URLS=http://localhost.