Giter VIP home page Giter VIP logo

android-studio-docker's Introduction

Android Studio 3.6 preinstalled in Docker image with GUI support

N|Solid

My personal image that I use for my CI server for android projects. Typical usage:

  • Build image by docker build ... command or get ready image docker pull purik/android-studio:latest from my public repo (https://hub.docker.com/r/purik/android-studio/)
  • Customize container with studio for any specific project by installing necessary build tools, accepting licenses agreements, etc throug GUI by X11 that preinstalled in base image
  • Use customized container as image for your personal configurations by docker commit

Probability work process (I use this one)

I have CI server with installed docker engine for running containers for separate builders with diffirent configurations. It is comfortable for me localize dependencies inside container, resolving much problems as libraries dependencies, current software configurations for specific build runners, moreover, docker based approach allow me follow modern concept "Infrastructure as application", so different infrastructure configurations have becamed separate projects inside my code.

You have to run Android Studio as GUI application when it is necessity to install new build tools, new SDK version, etc. I have spent much time for proxying X11 protocol stream from docker container through host machine to my local XWindow server, running on my home laptop.

My environment: Windows OS + XMing as X11 server application.

  • Establish ssh connection to my CI server with x11 forwarding. I typically use Putty with option Connection/SSH/X11/"Enable X11 forwarding" checkbox checked on.
  • Run container by calling run.sh <your-image-name> (you can find this script beside Dockerfile in repo)
  • Enjoy

Persist data and volumes

If you wish prepare Docker image once and reuse it multiple times later, follow next steps:

  • Run container by calling run.sh <your-image-name> (you can find this script beside Dockerfile in repo)
  • From Android Studio GUI click on Configuration menu item and install the necessary SDK tools and plugins
  • Close Studio GUI
  • You will see script is done and docker have build your-image-name that contains all configured Tools, Pluging, etc

android-studio-docker's People

Contributors

purik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

android-studio-docker's Issues

persist config & downloaded tools to volume

Thanks for the work on this docker image, for some reason I can't get Android Studio to run on my Linux box - I've spent a day stuck on the "Downloading Components" screen, and this lets me by-pass that.

Which directories do I need to persist to volumes in order to avoid having to reconfigure, download & install the Android SDK and build tools?

If I mount the volumes ~/Android/Sdk and ~/src:

#!/usr/bin/env bash
docker run -it --net=host --env="DISPLAY" \
  -v /tmp/.X11-unix:/tmp/.X11-unix -v "$HOME/.Xauthority:/root/.Xauthority:rw" \
  -v "$HOME/Android/Sdk:/root/Android/Sdk" -v "$HOME/workspace/src:/root/src" \
   purik/android-studio:latest /opt/android-studio/bin/studio.sh

❌ I still get asked to import settings
❌ asked to Send usage statistics to Google
✔️ I no longer need to download components
❌ ...but the Android Studio Setup Wizard stops to tell me everything is up to date.
✔️ my project code is still available
❌ ...but the Build/Sync tab still takes a while to download gradle-5.1.1-all.zip and run the build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.