forked from Hellikandra/ATAK-Dev-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
142 lines (115 loc) · 5.16 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# import from Docker Hub ---------------------------------------------------- #
# ------ ---- ------ --- ---------------------------------------------------- #
FROM debian:latest
FROM openjdk:11
# Set environmental variables ----------------------------------------------- #
# refer to the table on https://github.com/Hellikandra/ATAK-Dev-Docker #
# --- ------------- --------- ----------------------------------------------- #
ENV username atakdev
ENV cmake_release_version cmake-3.26.0-linux-x86_64
ENV cmake_release_link https://cmake.org/files/v3.26/${cmake_release_version}.tar.gz
ENV ndk_release_version android-ndk-r25b-linux.zip
ENV ndk_release_dl_link https://dl.google.com/android/repository/${ndk_release_version}
ENV ndk_release_folder android-ndk-r25b
# keep an older version of commandlinetools due to Java version issues
# Current version is : commandlinetools-linux-10406996_latest.zip
# Old version is : commandlinetools-linux-9477386_latest.zip
ENV sdk_release_version commandlinetools-linux-9477386_latest.zip
ENV sdk_manager_build_tools "build-tools;30.0.2"
ENV sdk_manager_platforms "platforms;android-30"
ENV atak_release_version ATAK-CIV-5.0.0.18-SDK.zip
ENV atak_extract_foldername ATAK-CIV-5.0.0.18-SDK
# Set root for installation and configuration ------------------------------- #
# --- ---- --- ------------ --- ------------- ------------------------------- #
USER root
RUN echo "root:pswd" | chpasswd
# install essential --------------------------------------------------------- #
# ------- --------- --------------------------------------------------------- #
RUN dpkg --add-architecture i386
RUN apt-get update -y && apt-get install -yq \
ant \
apg \
autoconf \
automake \
bash \
build-essential \
cmake \
curl \
dos2unix \
file \
g++ \
git \
git-lfs \
gnupg \
libogdi-dev \
libssl-dev \
libtool \
libxml2-dev \
make \
nano \
ninja-build \
patch \
python3-pip \
sqlite3 \
swig \
tcl \
unzip \
wget \
zip \
zlib1g-dev
# add user ------------------------------------------------------------------ #
# --- ---- ------------------------------------------------------------------ #
RUN useradd -rm -d /home/${username} -s /bin/bash -g root -G sudo -u 1001 ${username}
RUN echo "${username}:atakatak" | chpasswd
USER ${username}
# cmake installation -- from : https://cmake.org/files/ --------------------- #
# ----- ------------ -- ---- - ------------------------ --------------------- #
WORKDIR /home/${username}
RUN wget ${cmake_release_link}
RUN tar -xvzf ${cmake_release_version}.tar.gz
RUN mv ${cmake_release_version} cmake
RUN rm ${cmake_release_version}.tar.gz
# Android Studio suite ------------------------------------------------------ #
# ------- ------ ----- ------------------------------------------------------ #
# NDK installation ---------------------------------------------------------- #
WORKDIR /home/${username}/Android
RUN wget ${ndk_release_dl_link}
RUN unzip -q ${ndk_release_version}
RUN mv ${ndk_release_folder} ndk
RUN rm ${ndk_release_version}
# SDK installation ---------------------------------------------------------- #
WORKDIR /home/${username}/Android/sdk
RUN wget https://dl.google.com/android/repository/${sdk_release_version}
RUN unzip -q ${sdk_release_version}
RUN rm ${sdk_release_version}
WORKDIR /home/${username}/Android/sdk/cmdline-tools/bin
RUN yes | ./sdkmanager --sdk_root="/home/${username}/Android/sdk" --licenses
RUN ./sdkmanager --sdk_root="/home/${username}/Android/sdk" ${sdk_manager_build_tools} ${sdk_manager_platforms} "platform-tools"
# ATAK installation --------------------------------------------------------- #
# ---- ------------ --------------------------------------------------------- #
# https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV/releases --- #
WORKDIR /home/${username}
COPY --chown=${username}:root ${atak_release_version} ./
RUN unzip ${atak_release_version}
RUN mv ${atak_extract_foldername} atak-civ
RUN rm ${atak_release_version}
# https://tak.gov/products/atak-civ ----------------------------------------- #
# ATAK folder configuration ------------------------------------------------- #
# ---- ------ ------------- ------------------------------------------------- #
WORKDIR /home/${username}/atak-civ
COPY --chown=${username}:root atak-config.sh ./
# define the plugins folder ------------------------------------------------- #
# ------ --- ------- ------ ------------------------------------------------- #
ADD ./plugins ./plugins
USER root
RUN chown -R ${username}:root ./plugins
USER ${username}
# intentionally left blank to ensure that no error appears during the build.
RUN /bin/bash ./atak-config.sh
# start --------------------------------------------------------------------- #
# ----- --------------------------------------------------------------------- #
CMD ["bash"]
# command line -------------------------------------------------------------- #
# ------- ---- -------------------------------------------------------------- #
# docker build -t <name> .
# docker run -ti -v <path_of_plugins_folder>:/home/username/atak-civ/plugins <name> --name <container_name> --bind 127.0.0.1 --port 5555