2022-06-21 00:11:12 +08:00
|
|
|
FROM condaforge/mambaforge:4.12.0-0
|
2021-11-26 18:59:00 +08:00
|
|
|
|
2022-06-22 08:25:34 +08:00
|
|
|
# Install dependencies
|
|
|
|
|
RUN apt update && \
|
2022-08-08 01:05:55 +08:00
|
|
|
apt install -y netcat unzip
|
|
|
|
|
|
|
|
|
|
# Install latest adb (41)
|
|
|
|
|
RUN wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip && \
|
|
|
|
|
unzip platform-tools-latest-linux.zip && \
|
|
|
|
|
rm platform-tools-latest-linux.zip && \
|
|
|
|
|
ln -s /platform-tools/adb /usr/bin/adb
|
2022-06-22 08:25:34 +08:00
|
|
|
|
2021-11-26 20:38:32 +08:00
|
|
|
# Set remote and local dirs
|
2021-11-30 01:12:03 +08:00
|
|
|
WORKDIR /app
|
2021-11-26 20:38:32 +08:00
|
|
|
ENV SOURCE=./
|
2021-11-26 18:59:00 +08:00
|
|
|
|
|
|
|
|
# Install the base conda environment
|
2021-11-30 01:12:03 +08:00
|
|
|
ENV PYROOT=/app/pyroot
|
2022-06-21 00:11:12 +08:00
|
|
|
RUN mamba create --prefix $PYROOT python==3.7.6 -y
|
2021-11-26 18:59:00 +08:00
|
|
|
|
2022-08-08 01:05:55 +08:00
|
|
|
# Install the requirements to the conda environment
|
2022-08-29 08:47:29 +08:00
|
|
|
COPY $SOURCE/requirements.txt /app/requirements.txt
|
2022-06-22 08:25:34 +08:00
|
|
|
RUN $PYROOT/bin/pip install -r /app/requirements.txt
|
2021-11-26 18:59:00 +08:00
|
|
|
|
2022-08-08 01:05:55 +08:00
|
|
|
# Initial download of UIAutomator2 is really slow with appetizer mirror (outside of China), switch to github
|
2022-06-21 00:11:12 +08:00
|
|
|
RUN sed -i "s#path = mirror_download(url,#path = cache_download(url,#" $PYROOT/lib/python3.7/site-packages/uiautomator2/init.py
|
|
|
|
|
|
2021-11-28 21:15:57 +08:00
|
|
|
# When running the image, mount the ALAS folder into the container
|
2022-06-22 22:03:34 +08:00
|
|
|
CMD $PYROOT/bin/python -m uiautomator2 init && \
|
|
|
|
|
$PYROOT/bin/python /app/AzurLaneAutoScript/gui.py
|