ci: add arm/v7 support
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 1m34s
Some checks failed
build-docker-images-for-latest-release-github-ver / build-and-push (push) Failing after 1m34s
This commit is contained in:
parent
ee1e735c36
commit
69ab6c9f11
@ -83,7 +83,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: fly6516.synology.me:8080/multilang:latest
|
tags: fly6516.synology.me:8080/multilang:latest
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64 #,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
# Optional: Verify the pushed image
|
# Optional: Verify the pushed image
|
||||||
- name: Verify Docker Image
|
- name: Verify Docker Image
|
||||||
|
93
.github/workflows/github.yaml
vendored
93
.github/workflows/github.yaml
vendored
@ -1,93 +0,0 @@
|
|||||||
name: build-docker-images-for-latest-release-github-ver
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# # Cache Docker layers
|
|
||||||
# - name: Cache Docker image layers
|
|
||||||
# uses: http://fly6516.synology.me:4000/Gitea_Action/cache@v3
|
|
||||||
# with:
|
|
||||||
# path: /tmp/.buildkit-cache
|
|
||||||
# key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-docker-
|
|
||||||
|
|
||||||
# Checkout the repository
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: http://fly6516.synology.me:4000/Gitea_Action/checkout@v2
|
|
||||||
|
|
||||||
# pre pull image
|
|
||||||
- name: Pre Pull Image if Needed
|
|
||||||
run: |
|
|
||||||
IMAGE_NAME="dockerp.com/moby/buildkit:buildx-stable-1"
|
|
||||||
if ! docker image inspect "$IMAGE_NAME" > /dev/null 2>&1; then
|
|
||||||
echo "Image does not exist locally. Pulling..."
|
|
||||||
docker pull "$IMAGE_NAME"
|
|
||||||
else
|
|
||||||
echo "Image already exists locally."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create Docker configuration directory
|
|
||||||
- name: Create Docker configuration directory
|
|
||||||
run: sudo mkdir -p /etc/docker
|
|
||||||
|
|
||||||
# # Configure Docker to use dockerp.com as a mirror
|
|
||||||
# - name: Configure Docker Daemon for Mirror
|
|
||||||
# run: |
|
|
||||||
# echo '{
|
|
||||||
# "registry-mirrors": ["https://dockerp.com"]
|
|
||||||
# }' | sudo tee /etc/docker/daemon.json
|
|
||||||
#
|
|
||||||
# # Restart Docker Daemon Without systemd
|
|
||||||
# - name: Restart Docker Daemon
|
|
||||||
# run: |
|
|
||||||
# sudo chmod 644 /etc/docker/daemon.json
|
|
||||||
# sudo pkill -f dockerd || true
|
|
||||||
# sudo pkill -f docker || true
|
|
||||||
# sudo nohup dockerd > /dev/null 2>&1 &
|
|
||||||
# sudo nohup docker > /dev/null 2>&1 &
|
|
||||||
# sleep 5
|
|
||||||
#
|
|
||||||
# # Validate Docker Configuration
|
|
||||||
# - name: Validate Docker Configuration
|
|
||||||
# run: |
|
|
||||||
# cat /etc/docker/daemon.json
|
|
||||||
# docker info | grep -i "Registry Mirrors"
|
|
||||||
|
|
||||||
# Set up Docker Buildx
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: http://fly6516.synology.me:4000/docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
# Log in to Gitea Docker Registry
|
|
||||||
- name: Log in to Gitea Docker Registry
|
|
||||||
uses: http://fly6516.synology.me:4000/docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: https://fly6516.synology.me:8080
|
|
||||||
username: ${{ secrets.DOCKER_SYN_USER }}
|
|
||||||
password: ${{ secrets.DOCKER_SYN_PWD }}
|
|
||||||
|
|
||||||
- name: Set Docker Timeout
|
|
||||||
run: |
|
|
||||||
echo "DOCKER_CLIENT_TIMEOUT=300" >> $GITHUB_ENV
|
|
||||||
echo "DOCKER_BUILD_TIMEOUT=300" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Build and push the Docker image
|
|
||||||
- name: Build and Push Docker Image
|
|
||||||
uses: http://fly6516.synology.me:4000/docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: fly6516.synology.me:8080/multilang:latest
|
|
||||||
context: .
|
|
||||||
|
|
||||||
# Optional: Verify the pushed image
|
|
||||||
- name: Verify Docker Image
|
|
||||||
run: |
|
|
||||||
docker pull fly6516.synology.me:8080/multilang:latest
|
|
||||||
docker run --rm fly6516.synology.me:8080/multilang:latest bash -c "echo 'Image verified'"
|
|
@ -10,7 +10,9 @@ FROM fly6516.synology.me:8080/ubuntu:20.04
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# 使用南京大学的 apt 源
|
# 使用南京大学的 apt 源
|
||||||
RUN sed -i 's/archive.ubuntu.com/mirrors.nju.edu.cn/g' /etc/apt/sources.list
|
RUN if [ "$(uname -m)" = "x86_64" ]; then \
|
||||||
|
sed -i 's/archive.ubuntu.com/mirrors.nju.edu.cn/g' /etc/apt/sources.list; \
|
||||||
|
fi
|
||||||
|
|
||||||
# 更新系统并安装常用工具
|
# 更新系统并安装常用工具
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
|
Loading…
Reference in New Issue
Block a user