File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # 参考
2+ # Build and push Docker images
3+ # https://github.com/marketplace/actions/build-and-push-docker-images
4+ # Docker Metadata action
5+ # https://github.com/marketplace/actions/docker-metadata-action
6+ # Multi-platform image with GitHub Actions
7+ # https://docs.docker.com/build/ci/github-actions/multi-platform/
8+
9+ name : Docker Publish
10+
11+ on :
12+ push :
13+ branches :
14+ - main
15+
16+ env :
17+ IMAGE_NAME : " muen/python"
18+ IMAGE_TAG : " 3-chrome-134"
19+
20+ jobs :
21+ docker :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : Checkout
25+ uses : actions/checkout@v3
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v2
29+
30+ - name : Docker meta
31+ id : meta
32+ uses : docker/metadata-action@v4
33+ with :
34+ images : ${{ env.IMAGE_NAME }}
35+
36+ - name : Login to Docker Hub
37+ uses : docker/login-action@v2
38+ with :
39+ username : ${{ secrets.DOCKERHUB_USERNAME }}
40+ password : ${{ secrets.DOCKERHUB_TOKEN }}
41+
42+ - name : Build Docker Image
43+ uses : docker/build-push-action@v2
44+ with :
45+ context : .
46+ platforms : linux/arm64,linux/amd64
47+ push : true
48+ tags : ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
Original file line number Diff line number Diff line change 1+ FROM selenium/standalone-chromium:134.0
2+
3+ # 切换到 root 用户
4+ USER root
5+
6+ # 修复 base-files 安装问题并安装 python3
7+ RUN rm -f /etc/apt/sources.list.d/ubuntu.sources && \
8+ sed -i '/^deb http/!d' /etc/apt/sources.list && \
9+ dpkg-divert --remove /lib32 || true && \
10+ apt-get update && \
11+ apt-get install -y --no-install-recommends python3 python3-pip && \
12+ apt-get clean && \
13+ rm -rf /var/lib/apt/lists/*
14+
15+ # 设置 JAVA_HOME 环境变量
16+ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
17+ ENV PATH="$JAVA_HOME/bin:$PATH"
Original file line number Diff line number Diff line change 1+ ` selenium/standalone-chromium:134.0 ` 安装` python3 `
You can’t perform that action at this time.
0 commit comments