@@ -4,19 +4,42 @@ FROM ${BUILD_FROM}
44
55# Install necessary packages and wget for downloading tini
66RUN apt-get update && \
7- apt-get install -y android-sdk-platform-tools wget bash build-essential cmake git libjson-c-dev libwebsockets-dev dos2unix && \
8- rm -rf /var/lib/apt/lists/* && \
9- git clone https://github.com/tsl0922/ttyd.git
7+ apt-get install -y --no-install-recommends wget unzip bash build-essential cmake git libjson-c-dev libwebsockets-dev dos2unix && \
8+ rm -rf /var/lib/apt/lists/*
109
10+ RUN git clone https://github.com/tsl0922/ttyd.git
1111
1212WORKDIR /ttyd
1313RUN mkdir build
1414WORKDIR /ttyd/build
1515RUN cmake .. && \
1616 make && make install
1717
18- # Download and install tini based on the target architecture
18+
1919ARG TARGETARCH
20+ RUN case "$TARGETARCH" in \
21+ "amd64" ) \
22+ echo "Fetching latest amd64 platform-tools from Google" && \
23+ wget -q https://dl.google.com/android/repository/platform-tools-latest-linux.zip -O /tmp/platform-tools.zip && \
24+ unzip -q /tmp/platform-tools.zip -d /opt && \
25+ rm /tmp/platform-tools.zip \
26+ ;; \
27+ "arm64" | "arm" | "386" ) \
28+ echo "Fetching platform-tools for $TARGETARCH from apt" && \
29+ apt-get update && \
30+ apt-get install -y --no-install-recommends android-sdk-platform-tools && \
31+ rm -rf /var/lib/apt/lists/* \
32+ ;; \
33+ *) \
34+ echo "Unsupported architecture for adb installation: $TARGETARCH" && \
35+ exit 1 \
36+ ;; \
37+ esac
38+
39+
40+ ENV PATH="/opt/platform-tools:${PATH}"
41+
42+ # Download and install tini based on the target architecture
2043RUN case "$TARGETARCH" in \
2144 "amd64" ) TINI_URL="https://github.com/krallin/tini/releases/download/v0.19.0/tini" ;; \
2245 "arm64" ) TINI_URL="https://github.com/krallin/tini/releases/download/v0.19.0/tini-arm64" ;; \
0 commit comments