forked from wojiushixiaobai/qemu-user-static
-
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
d639f85
commit 1507b0d
Showing
3 changed files
with
73 additions
and
1 deletion.
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,40 @@ | ||
name: Build (linux/loong64) | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 0 2 * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Setup QEMU | ||
run: docker run --rm --privileged ghcr.io/loong64/qemu-user-static --reset -p yes | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
provenance: false | ||
file: Dockerfile.loong64 | ||
platforms: linux/loong64 | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:loong64 | ||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build | ||
name: Auto Build | ||
|
||
on: | ||
push: | ||
|
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,32 @@ | ||
FROM ghcr.io/loong64/debian:trixie-slim AS builder | ||
|
||
ARG DEPENDENCIES=" \ | ||
ca-certificates \ | ||
wget" | ||
|
||
WORKDIR /opt | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
set -ex \ | ||
&& rm -f /etc/apt/apt.conf.d/docker-clean \ | ||
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \ | ||
&& apt-get update \ | ||
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \ | ||
&& apt-get download qemu-user qemu-user-static | ||
|
||
COPY docker-entrypoint.sh /opt/ | ||
|
||
RUN set -ex \ | ||
&& wget https://github.com/multiarch/qemu-user-static/raw/master/containers/latest/register.sh \ | ||
&& wget https://github.com/qemu/qemu/raw/master/scripts/qemu-binfmt-conf.sh \ | ||
&& chmod +x *.sh | ||
|
||
FROM ghcr.io/loong64/debian:trixie-slim | ||
|
||
COPY --from=builder /opt/qemu*.deb /opt/ | ||
COPY --from=builder /opt/*.sh / | ||
|
||
ENV QEMU_BIN_DIR=/usr/bin | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] |