How to implement circleci/android image for a development environment by connecting some virtual or real device

I’m trying to setting up a Dockerfile and docker-compose for the circleci/android image and be able to connect to a real emulator or device. How can I do this?

Source: StackOverflow