├── 1.5 ├── Dockerfile └── docker-entrypoint.sh ├── 2.0 ├── Dockerfile └── docker-entrypoint.sh ├── 2.1 ├── Dockerfile └── docker-entrypoint.sh ├── 2.3 ├── Dockerfile └── docker-entrypoint.sh ├── 3.1 ├── Dockerfile └── docker-entrypoint.sh ├── Dockerfile ├── LICENSE ├── README.md ├── TERM.txt ├── art └── docker-android-studio.png ├── docker-android-studio ├── docker-compose.yml └── docker-entrypoint.sh /1.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 && \ 4 | apt-get clean && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | ENV ANDROID_STUDIO /opt/android-studio 8 | 9 | ENV ANDROID_STUDIO_VERSION 1.5.1.0 10 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-141.2456560-linux.zip 11 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 12 | 13 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 14 | 15 | ENV USER ubuntu 16 | ENV UID 1000 17 | 18 | RUN useradd -m -u $UID $USER && \ 19 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 20 | chmod -R a+w ${ANDROID_HOME} 21 | 22 | #USER $USER 23 | 24 | ADD docker-entrypoint.sh / 25 | ENTRYPOINT ["/docker-entrypoint.sh"] 26 | 27 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 28 | CMD ["/opt/android-studio/bin/studio.sh"] 29 | -------------------------------------------------------------------------------- /1.5/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | -------------------------------------------------------------------------------- /2.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 && \ 4 | apt-get clean && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | ENV ANDROID_STUDIO /opt/android-studio 8 | 9 | ENV ANDROID_STUDIO_VERSION 2.0.0.11 10 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-143.2586769-linux.zip 11 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 12 | 13 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 14 | 15 | ENV USER ubuntu 16 | ENV UID 1000 17 | 18 | RUN useradd -m -u $UID $USER && \ 19 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 20 | chmod -R a+w ${ANDROID_HOME} 21 | 22 | #USER $USER 23 | 24 | ADD docker-entrypoint.sh / 25 | ENTRYPOINT ["/docker-entrypoint.sh"] 26 | 27 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 28 | CMD ["/opt/android-studio/bin/studio.sh"] 29 | -------------------------------------------------------------------------------- /2.0/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | -------------------------------------------------------------------------------- /2.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 && \ 4 | apt-get clean && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | ENV ANDROID_STUDIO /opt/android-studio 8 | 9 | ENV ANDROID_STUDIO_VERSION 2.1.0.9 10 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-143.2790544-linux.zip 11 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 12 | 13 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 14 | 15 | ENV USER ubuntu 16 | ENV UID 1000 17 | 18 | RUN useradd -m -u $UID $USER && \ 19 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 20 | chmod -R a+w ${ANDROID_HOME} 21 | 22 | #USER $USER 23 | 24 | ADD docker-entrypoint.sh / 25 | ENTRYPOINT ["/docker-entrypoint.sh"] 26 | 27 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 28 | CMD ["/opt/android-studio/bin/studio.sh"] 29 | -------------------------------------------------------------------------------- /2.1/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | -------------------------------------------------------------------------------- /2.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN dpkg --add-architecture i386 && \ 4 | apt-get update && apt-get install -y --no-install-recommends sudo lib32z1 lib32ncurses5 lib32stdc++6 lib32z1 lib32ncurses5 lib32stdc++6 && \ 5 | apt-get clean && \ 6 | rm -rf /var/lib/apt/lists/* 7 | 8 | ENV ANDROID_STUDIO /opt/android-studio 9 | 10 | ENV ANDROID_STUDIO_VERSION 2.3.3.0 11 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-162.4069837-linux.zip 12 | # ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/2.3.3.0/android-studio-ide-162.4069837-linux.zip 13 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 14 | 15 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 16 | 17 | ENV USER ubuntu 18 | ENV UID 1000 19 | 20 | RUN useradd -m -u $UID $USER && \ 21 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 22 | chmod -R a+w ${ANDROID_HOME} 23 | 24 | #USER $USER 25 | 26 | ADD docker-entrypoint.sh / 27 | ENTRYPOINT ["/docker-entrypoint.sh"] 28 | 29 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 30 | CMD ["/opt/android-studio/bin/studio.sh"] 31 | -------------------------------------------------------------------------------- /2.3/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | -------------------------------------------------------------------------------- /3.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN dpkg --add-architecture i386 && \ 4 | apt-get update && apt-get install -y --no-install-recommends sudo lib32z1 lib32ncurses5 lib32stdc++6 lib32z1 lib32ncurses5 lib32stdc++6 && \ 5 | apt-get clean && \ 6 | rm -rf /var/lib/apt/lists/* 7 | 8 | ENV ANDROID_STUDIO /opt/android-studio 9 | 10 | ENV ANDROID_STUDIO_VERSION 3.1.2.0 11 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-173.4720617-linux.zip 12 | # ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/2.3.3.0/android-studio-ide-162.4069837-linux.zip 13 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 14 | 15 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 16 | 17 | ENV USER ubuntu 18 | ENV UID 1000 19 | 20 | RUN useradd -m -u $UID $USER && \ 21 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 22 | chmod -R a+w ${ANDROID_HOME} 23 | 24 | #USER $USER 25 | 26 | ADD docker-entrypoint.sh / 27 | ENTRYPOINT ["/docker-entrypoint.sh"] 28 | 29 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 30 | CMD ["/opt/android-studio/bin/studio.sh"] 31 | -------------------------------------------------------------------------------- /3.1/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yongjhih/android:jdk8-all 2 | 3 | RUN dpkg --add-architecture i386 && \ 4 | apt-get update && apt-get install -y --no-install-recommends sudo lib32z1 lib32ncurses5 lib32stdc++6 lib32z1 lib32ncurses5 lib32stdc++6 && \ 5 | 6 | apt-get clean && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | ENV ANDROID_STUDIO /opt/android-studio 10 | 11 | ENV ANDROID_STUDIO_VERSION 2.1.0.9 12 | ENV ANDROID_STUDIO_URL https://dl.google.com/dl/android/studio/ide-zips/${ANDROID_STUDIO_VERSION}/android-studio-ide-143.2790544-linux.zip 13 | ADD $ANDROID_STUDIO_URL /tmp/tmp.zip 14 | 15 | RUN unzip /tmp/tmp.zip -d /opt && rm /tmp/tmp.zip 16 | 17 | ENV USER ubuntu 18 | ENV UID 1000 19 | 20 | RUN useradd -m -u $UID $USER && \ 21 | echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 22 | chmod -R a+w ${ANDROID_HOME} 23 | 24 | #USER $USER 25 | 26 | ADD docker-entrypoint.sh / 27 | ENTRYPOINT ["/docker-entrypoint.sh"] 28 | 29 | #CMD ["${ANDROID_STUDIO}/bin/studio.sh"] # will not do variable substitution 30 | CMD ["/opt/android-studio/bin/studio.sh"] 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2015 8tory, Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android studio docker 2 | 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/yongjhih/android-studio.svg)](https://hub.docker.com/r/yongjhih/android-studio/) 4 | [![Docker Stars](https://img.shields.io/docker/stars/yongjhih/android-studio.svg)](https://hub.docker.com/r/yongjhih/android-studio/) 5 | [![](https://badge.imagelayers.io/yongjhih/android-studio:latest.svg)](https://imagelayers.io/?images=yongjhih/android-studio:latest) 6 | [![Join the chat at https://gitter.im/yongjhih/docker-android-studio](https://badges.gitter.im/yongjhih/docker-android-studio.svg)](https://gitter.im/yongjhih/docker-android-studio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 7 | 8 | ![](art/docker-android-studio.png) 9 | 10 | ## Usage 11 | 12 | ``` 13 | $ curl -L https://github.com/yongjhih/docker-android-studio/raw/master/docker-android-studio > ~/bin/android-studio 14 | $ chmod a+x ~/bin/android-studio 15 | 16 | $ android-studio 17 | ``` 18 | 19 | ## Usage with docker-compose 20 | 21 | Beta: 22 | 23 | ``` 24 | wget https://github.com/yongjhih/docker-android-studio/raw/master/docker-compose.yml 25 | docker-compose up android-studio-beta 26 | ``` 27 | 28 | Stable: 29 | 30 | ``` 31 | wget https://github.com/yongjhih/docker-android-studio/raw/master/docker-compose.yml 32 | docker-compose up android-studio-stable 33 | ``` 34 | 35 | ## Usage without docker-compose 36 | 37 | Beta (2.0-beta-2): 38 | 39 | ```sh 40 | docker run -it \ 41 | --privileged \ 42 | -v $HOME/AndroidStudioProjects:/home/ubuntu/AndroidStudioProjects \ 43 | -v $HOME/.android:/home/ubuntu/.android \ 44 | -v $HOME/.AndroidStudioPreview2.0:/home/ubuntu/.AndroidStudioPreview2.0 \ 45 | -v /dev/bus/usb:/dev/bus/usb \ 46 | -v /dev/kvm:/dev/kvm \ 47 | -v $ANDROID_HOME:/opt/android-sdk \ 48 | -e DISPLAY=$DISPLAY \ 49 | -v /tmp/.X11-unix:/tmp/.X11-unix \ 50 | -v $XAUTHORITY:/home/ubuntu/.Xauthority \ 51 | --net host \ 52 | yongjhih/android-studio 53 | ``` 54 | 55 | Stable (1.5.1): 56 | 57 | Build (3.1): 58 | 59 | ```sh 60 | docker build -t android-studio . 61 | ``` 62 | 63 | ```sh 64 | docker run -it \ 65 | --privileged \ 66 | -v `pwd`/AndroidStudioProjects:/home/ubuntu/AndroidStudioProjects \ 67 | -v `pwd`/.android:/home/ubuntu/.android \ 68 | -v `pwd`/.AndroidStudio3.1:/home/ubuntu/.AndroidStudio3.1 \ 69 | -v `pwd`/.gradle:/home/ubuntu/.gradle \ 70 | -v `pwd`/opt:/opt/android-sdk \ 71 | -v /dev/bus/usb:/dev/bus/usb \ 72 | -v /dev/kvm:/dev/kvm \ 73 | -e DISPLAY=$DISPLAY \ 74 | -v /tmp/.X11-unix:/tmp/.X11-unix \ 75 | -v $XAUTHORITY:/home/ubuntu/.Xauthority \ 76 | --net host \ 77 | android-studio 78 | ``` 79 | 80 | ## Ref. 81 | 82 | * Download: [2.0 beta 2] (https://dl.google.com/dl/android/studio/ide-zips/2.0.0.11/android-studio-ide-143.2586769-linux.zip) 83 | * http://tools.android.com/download/studio 84 | * http://tools.android.com/download/studio/stable 85 | * http://tools.android.com/download/studio/beta 86 | * http://tools.android.com/download/studio/canary 87 | 88 | ## LICENSE 89 | 90 | Apache 2.0, 2015 8tory Inc. 91 | -------------------------------------------------------------------------------- /TERM.txt: -------------------------------------------------------------------------------- 1 | Terms and Conditions 2 | 3 | This is the Android Software Development Kit License Agreement 4 | 5 | 1. Introduction 6 | 7 | 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. 8 | 9 | 1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. 10 | 11 | 1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS). 12 | 13 | 1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. 14 | 15 | 16 | 2. Accepting this License Agreement 17 | 18 | 2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement. 19 | 20 | 2.2 By clicking to accept, you hereby agree to the terms of this License Agreement. 21 | 22 | 2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK. 23 | 24 | 2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity. 25 | 26 | 27 | 3. SDK License from Google 28 | 29 | 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android. 30 | 31 | 3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose. 32 | 33 | 3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. 34 | 35 | 3.4 You may not use the SDK for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. 36 | 37 | 3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. 38 | 39 | 3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. 40 | 41 | 3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. 42 | 43 | 3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK. 44 | 45 | 46 | 4. Use of the SDK by You 47 | 48 | 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. 49 | 50 | 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). 51 | 52 | 4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. 53 | 54 | 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. 55 | 56 | 4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. 57 | 58 | 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. 59 | 60 | 61 | 5. Your Developer Credentials 62 | 63 | 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. 64 | 65 | 66 | 6. Privacy and Information 67 | 68 | 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. 69 | 70 | 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy. 71 | 72 | 73 | 7. Third Party Applications 74 | 75 | 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. 76 | 77 | 7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. 78 | 79 | 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. 80 | 81 | 82 | 8. Using Android APIs 83 | 84 | 8.1 Google Data APIs 85 | 86 | 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. 87 | 88 | 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. 89 | 90 | 91 | 9. Terminating this License Agreement 92 | 93 | 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. 94 | 95 | 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. 96 | 97 | 9.3 Google may at any time, terminate this License Agreement with you if: 98 | (A) you have breached any provision of this License Agreement; or 99 | (B) Google is required to do so by law; or 100 | (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or 101 | (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. 102 | 103 | 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. 104 | 105 | 106 | 10. DISCLAIMER OF WARRANTIES 107 | 108 | 10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. 109 | 110 | 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. 111 | 112 | 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 113 | 114 | 115 | 11. LIMITATION OF LIABILITY 116 | 117 | 11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. 118 | 119 | 120 | 12. Indemnification 121 | 122 | 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. 123 | 124 | 125 | 13. Changes to the License Agreement 126 | 127 | 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available. 128 | 129 | 130 | 14. General Legal Terms 131 | 132 | 14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. 133 | 134 | 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. 135 | 136 | 14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. 137 | 138 | 14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. 139 | 140 | 14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. 141 | 142 | 14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. 143 | 144 | 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. 145 | 146 | 147 | November 20, 2015 148 | -------------------------------------------------------------------------------- /art/docker-android-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongjhih/docker-android-studio/904e91f58b4d49cbfd1e95b06db0fb72944fb374/art/docker-android-studio.png -------------------------------------------------------------------------------- /docker-android-studio: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker run -it \ 4 | -v $HOME:$HOME \ 5 | -v $HOME:/home/ubuntu \ 6 | -v /dev/bus/usb \ 7 | -v /dev/kvm \ 8 | -v /tmp/.X11-unix \ 9 | -e DISPLAY=$DISPLAY \ 10 | -v $XAUTHORITY:/home/ubuntu/.Xauthority \ 11 | -w $PWD \ 12 | --net host \ 13 | --privileged \ 14 | -e UID=$(id -u) \ 15 | -e GID=$(id -g) \ 16 | yongjhih/android-studio 17 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | android-studio-beta: 2 | #build: . 3 | image: yongjhih/android-studio 4 | environment: 5 | DISPLAY: $DISPLAY 6 | volumes: 7 | - $ANDROID_HOME:/opt/android-sdk 8 | - /tmp/.X11-unix:/tmp/.X11-unix 9 | - $XAUTHORITY:/home/ubuntu/.Xauthority 10 | - /dev/kvm:/dev/kvm 11 | - /dev/bus/usb:/dev/bus/usb 12 | - $HOME/.AndroidStudioPreview2.0:/home/ubuntu/.AndroidStudioPreview2.0 13 | - $HOME/.AndroidStudio1.5:/home/ubuntu/.AndroidStudio1.5 14 | - $HOME/.AndroidStudio1.4:/home/ubuntu/.AndroidStudio1.4 15 | - $HOME/.AndroidStudio1.3:/home/ubuntu/.AndroidStudio1.3 16 | #- $HOME/.AndroidStudio:/home/ubuntu/.AndroidStudio 17 | net: host 18 | privileged: true 19 | 20 | android-studio-stable: 21 | #build: . 22 | image: yongjhih/android-studio:1.5.1 23 | environment: 24 | DISPLAY: $DISPLAY 25 | volumes: 26 | - $ANDROID_HOME:/opt/android-sdk 27 | - /tmp/.X11-unix:/tmp/.X11-unix 28 | - $XAUTHORITY:/home/ubuntu/.Xauthority 29 | - /dev/kvm:/dev/kvm 30 | - /dev/bus/usb:/dev/bus/usb 31 | - $HOME/.AndroidStudioPreview2.0:/home/ubuntu/.AndroidStudioPreview2.0 32 | - $HOME/.AndroidStudio1.5:/home/ubuntu/.AndroidStudio1.5 33 | - $HOME/.AndroidStudio1.4:/home/ubuntu/.AndroidStudio1.4 34 | - $HOME/.AndroidStudio1.3:/home/ubuntu/.AndroidStudio1.3 35 | #- $HOME/.AndroidStudio:/home/ubuntu/.AndroidStudio 36 | net: host 37 | privileged: true 38 | -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | UID=${UID:-1000} 6 | GID=${GID:-1000} 7 | 8 | usermod -u $UID -g $GID $USER > /dev/null 2>&1 9 | groupmod -g $GID $USER > /dev/null 2>&1 10 | 11 | export ANDROID_HOME 12 | export ANDROID_STUDIO 13 | 14 | exec sudo ANDROID_HOME=$ANDROID_HOME -E -i -u $USER "$@" 15 | --------------------------------------------------------------------------------