Dave F
Dave F
Sep 3, 2018 · 1 min read

Oh, in addition to the stuff I mentioned previously, it might be good to point out that the steps above won’t help you load any files into your IDE, because there isn’t a mapping from your host filesystem to the docker container, you can add one via the -v flag of the run command, e.g.

#replace android-studio with whatever you tagged your docker image as in your build step
sudo docker run - net=host - env="DISPLAY" -v "/:/host" - volume="$HOME/.Xauthority:/root/.Xauthority:rw" android-studio

Also, if you want to save the state of your container so you don’t have to re-open your project, or do a bunch of initial setup steps every time your dockerized IDE loads, you can get to a good point with your container (the state you want it to load up in every time) and then can commit that state to an image, so that every time you run the image it will start up in a good spot with fewer setup steps. You can do that in two steps:

  1. Figure out what the docker container id is , by running this command then looking for the container with the right tag/name:
sudo docker ps

2. Commit the container in its current state to the actual image, overwriting the image with the container’s current state:

sudo docker commit 7123456fa android-studio

Now when you run the docker run command, your IDE will be loaded up in the correct state automatically!

    Dave F

    Written by

    Dave F

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade