Communicate with docker container (specifically Spark container)

I’m a newbie to Docker (and to Spark) and running into what I think should be a common problem. I’m trying to put up a Spark container on OSX. Spark provides a http-based UI on port 8080. After I put up the Spark container, I can connect to it via docker exec -it and test that Spark is up and running by executing various Spark commands. I then get the IP address for that container. However, when I try to connect to the container from a browser on my host (Mac) machine, it cannot reach the docker container’s web-based UI. What steps am I missing?