This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (80 loc) · 2.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FROM openjdk:8
# #########################
# ## System Dependencies ##
# #########################
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
sudo \
tmux \
expect \
git \
wget
# #########################
# ###### USER UIDS #######
# #########################
COPY bin/.docker.uids_gids /tmp
RUN . /tmp/.docker.uids_gids && addgroup --gid ${kvmgid} kvm
RUN . /tmp/.docker.uids_gids && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${gid}:" >> /etc/group && \
adduser developer kvm && \
adduser developer video && \
chmod 0660 /etc/sudoers && \
echo "developer ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chmod 0440 /etc/sudoers
# #########################
# ### Android Studio ######
# #########################
RUN curl 'https://dl.google.com/dl/android/studio/ide-zips/2.2.3.0/android-studio-ide-145.3537739-linux.zip?hl=es-419' > /tmp/studio.zip && \
unzip /tmp/studio.zip -d /home/developer/
RUN chown -R developer:developer /home/developer/android-studio
# #########################
# ## Android dependencies ##
# #########################
COPY files/51-android.rules /etc/udev/rules.d
RUN chmod a+r /etc/udev/rules.d/51-android.rules && \
apt-get update && \
apt-get install -y --no-install-recommends \
qemu-system \
qemu-kvm \
pciutils \
qtbase5-dev \
qt5-default \
libvirt0 \
file \
pulseaudio \
libncurses5-dev \
libstdc++6 \
va-driver-all \
lib32z1 \
lib32ncurses5 \
lib32stdc++6 \
zip \
unzip \
mesa-utils \
libgl1-mesa-swx11 && \
apt-get clean && \
rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
#####################
#### ENVIRONMENT ####
#####################
RUN mkdir -p /home/developer/.bin
COPY files/entrypoint.sh /home/developer/.bin/entrypoint.sh
RUN chmod +x /home/developer/.bin/*.sh
RUN chown -R developer:developer /home/developer
USER developer
WORKDIR /home/developer
ENV DISPLAY=:0
ENV SHELL=/bin/bash
ENV ANDROID_HOME=/home/developer/android-sdk-linux
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
##########################
######### SDKMAN #########
##########################
RUN curl -s get.sdkman.io | bash
RUN bash -c "source /home/developer/.sdkman/bin/sdkman-init.sh"
##########################
####### ENTRYPOINT #######
##########################
ENTRYPOINT ["/home/developer/.bin/entrypoint.sh"]