2023-01-28 18:41:38 +08:00
|
|
|
FROM ubuntu:jammy
|
|
|
|
|
|
|
|
|
|
ENV CONDA_DIR=/opt/conda
|
|
|
|
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
|
|
|
ENV PATH=${CONDA_DIR}/bin:${PATH}
|
2021-11-26 11:59:00 +01:00
|
|
|
|
2022-06-21 20:25:34 -04:00
|
|
|
# Install dependencies
|
|
|
|
|
RUN apt update && \
|
2023-01-29 02:12:30 +08:00
|
|
|
apt install --no-install-recommends -y netcat unzip wget bzip2 ca-certificates git tini
|
2023-01-28 18:41:38 +08:00
|
|
|
|
|
|
|
|
# Install mambaforge
|
|
|
|
|
RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh && \
|
|
|
|
|
bash Mambaforge-Linux-x86_64.sh -b -p ${CONDA_DIR} && \
|
|
|
|
|
rm Mambaforge-Linux-x86_64.sh && \
|
|
|
|
|
conda clean --tarballs --index-cache --packages --yes && \
|
|
|
|
|
find ${CONDA_DIR} -follow -type f -name '*.a' -delete && \
|
|
|
|
|
find ${CONDA_DIR} -follow -type f -name '*.pyc' -delete && \
|
|
|
|
|
conda clean --force-pkgs-dirs --all --yes && \
|
|
|
|
|
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc && \
|
|
|
|
|
. ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base
|
2022-08-07 13:05:55 -04:00
|
|
|
|
|
|
|
|
# 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-21 20:25:34 -04:00
|
|
|
|
2021-11-26 13:38:32 +01:00
|
|
|
# Set remote and local dirs
|
2023-01-28 18:41:38 +08:00
|
|
|
RUN mkdir /app
|
2021-11-29 18:12:03 +01:00
|
|
|
WORKDIR /app
|
2021-11-26 13:38:32 +01:00
|
|
|
ENV SOURCE=./
|
2021-11-26 11:59:00 +01:00
|
|
|
|
|
|
|
|
# Install the base conda environment
|
2021-11-29 18:12:03 +01:00
|
|
|
ENV PYROOT=/app/pyroot
|
2022-06-20 12:11:12 -04:00
|
|
|
RUN mamba create --prefix $PYROOT python==3.7.6 -y
|
2021-11-26 11:59:00 +01:00
|
|
|
|
2022-08-07 13:05:55 -04:00
|
|
|
# Install the requirements to the conda environment
|
2022-08-28 20:47:29 -04:00
|
|
|
COPY $SOURCE/requirements.txt /app/requirements.txt
|
2022-06-21 20:25:34 -04:00
|
|
|
RUN $PYROOT/bin/pip install -r /app/requirements.txt
|
2021-11-26 11:59:00 +01:00
|
|
|
|
2022-08-07 13:05:55 -04:00
|
|
|
# Initial download of UIAutomator2 is really slow with appetizer mirror (outside of China), switch to github
|
2022-06-20 12:11:12 -04: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 14:15:57 +01:00
|
|
|
# When running the image, mount the ALAS folder into the container
|
2022-06-22 10:03:34 -04:00
|
|
|
CMD $PYROOT/bin/python -m uiautomator2 init && \
|
|
|
|
|
$PYROOT/bin/python /app/AzurLaneAutoScript/gui.py
|