2022-06-20 12:11:12 -04:00
|
|
|
FROM condaforge/mambaforge:4.12.0-0
|
2021-11-26 11:59:00 +01:00
|
|
|
|
2022-06-21 20:25:34 -04:00
|
|
|
# Install dependencies
|
|
|
|
|
RUN apt update && \
|
|
|
|
|
apt install -y adb netcat
|
|
|
|
|
|
|
|
|
|
# Create user
|
|
|
|
|
RUN useradd -m abc && \
|
|
|
|
|
usermod -G users abc
|
|
|
|
|
|
2021-11-26 13:38:32 +01:00
|
|
|
# Set remote and local dirs
|
2021-11-29 18:12:03 +01:00
|
|
|
WORKDIR /app
|
2021-11-26 13:38:32 +01:00
|
|
|
ENV SOURCE=./
|
2022-06-21 20:25:34 -04:00
|
|
|
RUN chown abc:abc /app
|
|
|
|
|
USER abc
|
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
|
|
|
|
|
|
|
|
# Install the requriements to the conda environment
|
2022-06-21 20:25:34 -04:00
|
|
|
COPY --chown=abc:abc $SOURCE/requirements.txt /app/requirements.txt
|
|
|
|
|
RUN $PYROOT/bin/pip install -r /app/requirements.txt
|
2021-11-26 11:59:00 +01:00
|
|
|
|
2022-06-20 12:11:12 -04:00
|
|
|
# Initial download of UIAutomator2 is really slow with appetizer mirror
|
|
|
|
|
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
|