Unable to run appium test on docker image appium/appium-emulator

  android-emulator, appium, appium-android, docker

I installed docker desktop on mac machine and followed the below steps,

  1. Pulled the appium/appium-emulator image for docker hub
  2. ran a instance of docker container using the command docker run --name appiumEmulator -d appium/appium-emulator
  3. Then configured the program with the Appium URL – IP was found by inspecting the image and port number was obtained by listing the docker images using command docker ps.

Error from console – org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: Failed to connect to /

Other work around that I tried, Opened command prompt for the image using " docker exec -it <imageID> bash " and opened another appium port and got the same error again for the new port.

Source: Docker Questions