i created two docker containers based on two different images. one of db and another for webserver. both containers are running on my mac osx.
i can access db conta
You will have to access db through the ip of host machine, or if you want to access it via localhost:1521, then run webserver like -
docker run --net=host --name oracle-wls wls-image:latest
See here