Excellent post! I had to do a couple of things differently but I did get an IDE opening up (not android studio but another one) with these steps.
1) I had to allow anything to connect to my host XServer by running this in a host terminal:
sudo xhost +2) This may be because I used ubuntu 18 instead of 14 for my base docker image, but I had to use the architecture-specific version of lib32bz2. If anyone else wants to use a 64 bit image base, the dependency-installation portion of your Dockerfile should change somewhat to:
# 32-bit dependencies of android and utils
# lib32bz2-1.0 removed from this listRUN apt-get install -y \
bison \
git \
gperf \
lib32gcc1 \
lib32ncurses5 \
lib32stdc++6 \
lib32z1 \
libc6-i386 \
libxml2-utils \
make \
zip#Uncomment for 32 bit architecture
# RUN apt-get install -y libbz2–1.0:i386#Uncomment for 64 bit architecture
RUN apt-get install -y libbz2–1.0:amd64
3) I had to mess around a bit with the actual commands in my version. For any other docker noobs out there, just note that you can debug your dockerfiles by running a container image and logging into it directly, then by copy-pasting the commands that are being run by the dockerfile to see what is happening. You can do that with this command from a host terminal:
sudo docker run -it ubuntu:18.04 #replace 18.04 if neededHopefully that helps someone!