Other hosts on the local network cannot access the docker container

how did you install container? Based on the version number, I assume not the official way

Of course, Ubuntu 18.04 is not supported by recent Docker versions so it is possible that you actually installed i from the official repo.

Here are the possible causes:

  • You have a local firewall, but you shared ufw is inactive. You could still have other firewalls like firewalld
  • You could have other another software that writes iptables like LXD which is not conpmatible with Docker which also writes iptables
  • You could have an external firewall, router that rejects the requests.

Try this on the host

python -m http.server 8897

And try to access port 8897 to see if it is a Docker issue.

also please share how you actually installed Docker. Share the output of

docker info
docker version

Review the output before sharing and remove confidential data if any appears (public IP for example)

dpkg -l 'docker*' | grep '^ii'
snap list docker

When you share the outputs, always format your posts according to the following guide: How to format your forum posts