Download resources/android/Dockerfile from OpenGVLab/ScaleCUA_Env: direct link, hf CLI and curl.
- Browser
- Download file 2.77 kB
-
https://huggingface.co/OpenGVLab/ScaleCUA_Env/resolve/main/resources/android/Dockerfile
- Command line
-
hf download hf://OpenGVLab/ScaleCUA_Env/resources/android/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/OpenGVLab/ScaleCUA_Env/resolve/main/resources/android/Dockerfile
2.77 kB
| # 使用基于 Debian 的 Python 镜像作为基础镜像 | |
| FROM python:3.11-slim-bullseye | |
| # 替换为USTC的镜像源 | |
| RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list | |
| # 安装 Flask | |
| RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | |
| RUN pip install flask | |
| # 更新软件包索引并安装必要的软件包及缺失的依赖 | |
| RUN apt-get update && apt-get install -y \ | |
| vim \ | |
| wget \ | |
| unzip \ | |
| libpulse-dev \ | |
| libnss3 \ | |
| cpu-checker \ | |
| # === 添加的 Android Emulator 和 Qt 相关依赖 === | |
| libdrm2 \ | |
| libxkbfile1 \ | |
| libxcb-cursor0 \ | |
| libxkbcommon-x11-0 \ | |
| libglu1-mesa \ | |
| libqt5gui5 \ | |
| libqt5core5a \ | |
| libqt5widgets5 \ | |
| libqt5network5 \ | |
| libqt5qml5 \ | |
| libqt5quick5 \ | |
| libx11-xcb-dev \ | |
| libxcb-xinerama0 \ | |
| libxcb-icccm4 \ | |
| libxcb-image0 \ | |
| libxcb-keysyms1 \ | |
| libxcb-randr0 \ | |
| libxcb-render0 \ | |
| libxcb-shape0 \ | |
| libxcb-sync1 \ | |
| libxcb-xfixes0 \ | |
| libxcb-glx0 \ | |
| libsdl2-2.0-0 \ | |
| libxext6 \ | |
| libpciaccess0 | |
| # 创建安装目录并切换到该目录 | |
| RUN mkdir -p /root/install-android && cd /root/install-android | |
| # 下载和安装 OpenJDK | |
| COPY openlogic-openjdk-8u412-b08-linux-x64-deb.deb . | |
| RUN apt install -y ./openlogic-openjdk-8u412-b08-linux-x64-deb.deb | |
| # 设置 Android 环境变量 | |
| ENV ANDROID_HOME=/root/.android | |
| RUN mkdir -p $ANDROID_HOME | |
| # 下载 Android SDK | |
| COPY sdk-tools-linux-4333796.zip . | |
| RUN unzip ./sdk-tools-linux-4333796.zip -d $ANDROID_HOME | |
| # 更新 .bashrc 文件 | |
| RUN echo "export ANDROID_HOME=$ANDROID_HOME" >> /root/.bashrc \ | |
| && echo 'export SDK=$ANDROID_HOME' >> /root/.bashrc \ | |
| && echo 'export ANDROID_SDK_ROOT=$ANDROID_HOME' >> /root/.bashrc \ | |
| && echo 'export PATH=$SDK/emulator:$SDK/tools:$SDK/tools/bin:$SDK/platform-tools:$PATH' >> /root/.bashrc | |
| # 安装 Android SDK 工具 | |
| RUN /bin/bash -c "source /root/.bashrc && yes | sdkmanager 'platform-tools' 'emulator'" | |
| RUN /bin/bash -c "source /root/.bashrc && yes | sdkmanager 'build-tools;33.0.0'" | |
| RUN /bin/bash -c "source /root/.bashrc && yes | sdkmanager 'platforms;android-33'" | |
| # 复制文件到容器内的指定位置 | |
| COPY skins.zip . | |
| RUN unzip ./skins.zip -d /root/.android/ | |
| COPY Pixel_7_Pro_API_33.ini /root/.android/avd/ | |
| COPY Pixel_7_Pro_API_33.avd.zip . | |
| RUN unzip ./Pixel_7_Pro_API_33.avd.zip -d /root/.android/avd/ | |
| COPY adb_client.py / | |
| COPY x86_64.zip . | |
| RUN mkdir -p /root/.android/system-images/android-33/google_apis/ | |
| RUN unzip ./x86_64.zip -d /root/.android/system-images/android-33/google_apis/ | |
| # 清理不需要的文件 | |
| RUN rm /Pixel_7_Pro_API_33.avd.zip \ | |
| && rm /openlogic-openjdk-8u412-b08-linux-x64-deb.deb \ | |
| && rm /sdk-tools-linux-4333796.zip \ | |
| && rm /skins.zip \ | |
| && rm /x86_64.zip | |