Opt: Add optional MAA installation for Docker (#2173)

Tip. Since the MAA latest release is built by g++12 and requires GLIBC 2.32 or higher, we changed the base docker image to ubuntu jammy(22.04 LTS), which already have prebuilt GLIBC 2.35
This commit is contained in:
orangesoup 2023-01-28 18:41:38 +08:00 committed by GitHub
parent bcdfb040cf
commit 80d5a125ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 4 deletions

View File

@ -51,4 +51,8 @@ prun_or_continue "adb kill-server"
pprint "Running the container"
trap "rm ${XDG_RUNTIME_DIR}/${CONTAINER}.lock && docker kill ${CONTAINER}" EXIT
prun "docker run --net=host --volume=${SOURCE}/..:/app/AzurLaneAutoScript:rw --interactive --tty --name ${CONTAINER} ${CONTAINER}"
# If you need MAA support, uncomment the following two lines and comment the line above(Modify the path of MAA according to the actual situation)
# MAA_SOURCE="${SOURCE}/../../MAA"
# prun "docker run --net=host --volume=${SOURCE}/..:/app/AzurLaneAutoScript:rw --vloume=${MAA_SOURCE}:/app/MAA:rw --interactive --tty --name ${CONTAINER} ${CONTAINER}"

View File

@ -1,8 +1,23 @@
FROM condaforge/mambaforge:4.12.0-0
FROM ubuntu:jammy
ENV CONDA_DIR=/opt/conda
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH=${CONDA_DIR}/bin:${PATH}
# Install dependencies
RUN apt update && \
apt install -y netcat unzip
apt install -y netcat unzip wget
# 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
# Install latest adb (41)
RUN wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip && \
@ -11,6 +26,7 @@ RUN wget https://dl.google.com/android/repository/platform-tools-latest-linux.zi
ln -s /platform-tools/adb /usr/bin/adb
# Set remote and local dirs
RUN mkdir /app
WORKDIR /app
ENV SOURCE=./

View File

@ -1,8 +1,23 @@
FROM condaforge/mambaforge:4.12.0-0
FROM ubuntu:jammy
ENV CONDA_DIR=/opt/conda
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH=${CONDA_DIR}/bin:${PATH}
# Install dependencies
RUN apt update && \
apt install -y netcat unzip
apt install -y netcat unzip wget
# Install mambaforge
RUN wget https://ghproxy.com/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
# Install latest adb (41)
RUN wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip && \
@ -11,6 +26,7 @@ RUN wget https://dl.google.com/android/repository/platform-tools-latest-linux.zi
ln -s /platform-tools/adb /usr/bin/adb
# Set remote and local dirs
RUN mkdir /app
WORKDIR /app
ENV SOURCE=./

View File

@ -4,6 +4,7 @@ services:
network_mode: host
volumes:
- '.:/app/AzurLaneAutoScript:rw'
# - '../MAA:/app/MAA:rw'
- '/etc/localtime:/etc/localtime:ro'
container_name: 'alas'
image: 'alas'