Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itaru2622/docker-android-studio
android-studio in Docker
https://github.com/itaru2622/docker-android-studio
android-studio docker
Last synced: 15 days ago
JSON representation
android-studio in Docker
- Host: GitHub
- URL: https://github.com/itaru2622/docker-android-studio
- Owner: itaru2622
- Created: 2022-10-07T04:14:05.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-25T00:48:25.000Z (about 1 year ago)
- Last Synced: 2024-11-28T20:13:11.512Z (2 months ago)
- Topics: android-studio, docker
- Language: Makefile
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Docker Build & Publish](https://github.com/itaru2622/android-studio/actions/workflows/build_publish.yml/badge.svg)](https://github.com/itaru2622/android-studio/actions/workflows/build_publish.yml)
## basic use example on linux
```bash
# top_dir in below is the folder to share files between docker host and container, such as projects, android-sdk, envrironment files( .android, .config in container Home)
yourhost$ top_dir=${HOME}/Work/android# prepare folders
yourhost$ mkdir -p ${top_dir}/dot-android ${top_dir}/dot-config ${top_dir}/sdk ${top_dir}/projects
# allow to display android studio on yourhost
yourhost$ xhost +# run container
yourhost$ docker run --name android-studio -it --rm --network host --privileged \
-v ${top_dir}/sdk:/home/android/Android/Sdk \
-v ${top_dir}/dot-android:/home/android/.android \
-v ${top_dir}/dot-config:/home/android/.config \
-v ${top_dir}/projects:/home/android/AndroidStudioProjects \
-e ANDROID_HOME=/home/android/Android/Sdk \
-e DISPLAY=${DISPLAY} \
itaru2622/android-studio:bookworm /bin/bash# start android studio
inContainer$ studio.sh
```## how to build docker image by yourself and run it
- requires: make
```bash
# install requirements
yourhost$ sudo apt install make# check Dockerfile and Makefile, then execute below:
yourhost$ make build
yourhost$ make runinContainer$ studio.sh
```## how to build your custom docker image
- modify Makefile to meet your preference.
```Makefile
# original => your preference
# -------------------------------------------------
img_base=debian:bookworm => img_base=ubuntu:22.04
uname=android => uname=anyname
uid=1000 => uid=anynumber
extra_app= => extra_app=mousepad# and more...
```or, you can specify your preference at make command without modifying Makefile, as below:
```bash
yourhost$ make build img_base=ubuntu:22.04 uname=anyname uid=number extra_app=mousepad ver_studio=2022.3.1.20 ver_jdk=17
# where img_base is the docker base image in the above case, ubuntu:22.04 ( the distrubution has to support apt )
# uname is the user name in docker container
# uid is the user ID in docker container
# extra_app is the packages to install in docker image, in the above case mousepad
# ver_studio is the version number of android studio
# ver_jdk is the version number of openJDKyourhost$ make run uname=anyname
# where uname should be equal to the uname which you specified in build ops.inContainer$ studio.sh
```