-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68f55b9
commit 59c100d
Showing
3 changed files
with
142 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 在主分支推送时触发 | ||
paths: | ||
- docker/debian-trixie/armhf/** # 指定路径 | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
name: Build and Push debian-trixie-armhf Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Build and Push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./docker/debian-trixie/armhf | ||
file: ./docker/debian-trixie/armhf/Dockerfile | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/builder-debian-trixie-armhf:${{ github.sha }} | ||
ghcr.io/${{ github.repository_owner }}/builder-debian-trixie-armhf:latest | ||
push: true | ||
|
||
- name: Remove cache after build | ||
run: | | ||
rm -rf /tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FROM debian:trixie | ||
|
||
# RUN rm -f /etc/apt/sources.list.d/debian.sources && \ | ||
# rm -f /etc/apt/sources.list && \ | ||
# echo "deb http://mirrors.nju.edu.cn/debian/ trixie main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
# echo "deb http://mirrors.nju.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
# echo "deb http://mirrors.nju.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
# echo "deb http://mirrors.nju.edu.cn/debian-security/ trixie-security main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list | ||
|
||
RUN rm -f /etc/apt/sources.list.d/debian.sources && \ | ||
rm -f /etc/apt/sources.list && \ | ||
echo "deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
echo "deb http://deb.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
echo "deb http://deb.debian.org/debian/ trixie-backports main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list && \ | ||
echo "deb http://deb.debian.org/debian-security/ trixie-security main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes --no-install-recommends \ | ||
gnupg2 \ | ||
ca-certificates \ | ||
g++-arm-linux-gnueabihf \ | ||
libc6-dev-armhf-cross \ | ||
libclang-dev \ | ||
build-essential \ | ||
pkg-config \ | ||
curl \ | ||
wget \ | ||
file && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN dpkg --add-architecture armhf && \ | ||
apt-get update && apt-get install --assume-yes --no-install-recommends -f \ | ||
libwebkit2gtk-4.1-dev:armhf \ | ||
libxdo-dev:armhf \ | ||
libssl-dev:armhf \ | ||
libgtk-3-dev:armhf \ | ||
libayatana-appindicator3-dev:armhf \ | ||
librsvg2-dev:armhf \ | ||
libatk1.0-dev:armhf \ | ||
libgdk-pixbuf-2.0-dev:armhf \ | ||
libcairo2-dev:armhf \ | ||
libpango1.0-dev:armhf \ | ||
libgtk-3-dev:armhf \ | ||
libsoup2.4-dev:armhf && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Install NodeJs and pnpm | ||
# RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash - && \ | ||
# pnpm env use --global lts | ||
|
||
# ENV RUSTUP_DIST_SERVER="https://rsproxy.cn" \ | ||
# RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" | ||
|
||
# Install Rust | ||
# RUN curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y --default-toolchain nightly --profile minimal | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly --profile minimal | ||
ENV PATH="/root/.cargo/bin:$PATH" | ||
RUN rustup target add armv7-unknown-linux-gnueabihf | ||
|
||
# Set envs | ||
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \ | ||
CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \ | ||
CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \ | ||
BINDGEN_EXTRA_CLANG_ARGS_armv7_unknown_linux_gnueabihf="--sysroot=/usr/arm-linux-gnueabihf" \ | ||
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/:${PKG_CONFIG_PATH}" \ | ||
PKG_CONFIG_ALLOW_CROSS=1 | ||
|
||
WORKDIR /app |