Last active
March 26, 2018 01:57
-
-
Save eduardobcastro/63ef0d70597d635cb9d37fb364c4ac94 to your computer and use it in GitHub Desktop.
Dockerized Android Studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this way: | |
# docker run -it --rm --privileged -v /dev/bus/usb:/dev/bus/usb -v "$HOME":/home/developer -e DISPLAY --net=host android-studio | |
# Then: | |
# bin/studio.sh | |
FROM debian:stretch-slim | |
RUN groupadd --gid 1000 developer \ | |
&& useradd --uid 1000 --gid developer -G plugdev --shell /bin/bash --create-home developer | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
ca-certificates \ | |
curl \ | |
sudo \ | |
unzip \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN mkdir /android-studio \ | |
&& chown developer /android-studio \ | |
&& adduser developer sudo \ | |
&& echo 'developer ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
USER developer | |
RUN curl -o /tmp/android-studio.zip https://dl.google.com/dl/android/studio/ide-zips/3.0.1.0/android-studio-ide-171.4443003-linux.zip \ | |
&& unzip /tmp/android-studio.zip \ | |
&& rm /tmp/android-studio.zip | |
USER root | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
libfontconfig1 \ | |
libxrender1 \ | |
libxtst6 \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY entrypoint.sh /bin | |
USER developer | |
WORKDIR /android-studio | |
ENTRYPOINT ["entrypoint.sh"] | |
CMD ["bash"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Starting Adb... | |
sudo ~/Android/Sdk/platform-tools/adb -a -P 5037 server | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment