Skip to content

Commit 8289290

Browse files
committed
test
1 parent 677bc98 commit 8289290

File tree

3 files changed

+377
-25
lines changed

3 files changed

+377
-25
lines changed
Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,324 @@
1+
name: 🐬 Build Debian Base Images DockerHub 🐬
2+
#REF: https://docs.docker.com/build/ci/github-actions/multi-platform/
3+
#SECRETS: DOCKERHUB_USERNAME || DOCKERHUB_TOKEN
4+
#URL: https://hub.docker.com/u/pkgforge
5+
6+
#------------------------------------------------------------------------------------#
7+
on:
8+
#push:
9+
workflow_dispatch:
10+
schedule:
11+
- cron: "30 08 * * 3" # 08:30 PM UTC Thu (02:15 AM NPT Thu Midnight)
12+
# - cron: "*/30 * * * *" # Every 30 Mins
13+
defaults:
14+
run:
15+
shell: bash
16+
working-directory: /tmp
17+
permissions:
18+
contents: read
19+
packages: write
20+
jobs:
21+
#------------------------------------------------------------------------------------#
22+
build-push-debian:
23+
name: Push (Debian ${{ matrix.arch }}) --> Docker Hub
24+
runs-on: ${{ matrix.runner }}
25+
strategy:
26+
matrix:
27+
include:
28+
- arch: aarch64
29+
platform: arm64
30+
runner: ubuntu-24.04-arm
31+
#- arch: loongarch64
32+
# platform: loong64
33+
# runner: ubuntu-latest
34+
- arch: riscv64
35+
platform: riscv64
36+
runner: ubuntu-latest
37+
- arch: x86_64
38+
platform: amd64
39+
runner: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
with:
45+
path: main
46+
filter: "blob:none"
47+
48+
#- name: Debloat Runner
49+
# run: |
50+
# #Presets
51+
# set +x ; set +e
52+
# #--------------#
53+
# bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/debloat_ubuntu.sh")
54+
# continue-on-error: true
55+
56+
- name: Install Addons
57+
run: |
58+
##Presets
59+
set +x ; set +e
60+
#-------------#
61+
##Debug?
62+
if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then
63+
set -x
64+
fi
65+
#-------------#
66+
#export PARALLEL=1
67+
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
68+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/bin/7z" &
69+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/local/bin/7z" &
70+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/ansi2txt" -o "/usr/local/bin/ansi2txt" &
71+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2" &
72+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2c" &
73+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/askalono" -o "/usr/local/bin/askalono" &
74+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/bsdtar" -o "/usr/local/bin/bsdtar" &
75+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/b3sum" -o "/usr/local/bin/b3sum" &
76+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/dasel" -o "/usr/local/bin/dasel" &
77+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/eget" -o "/usr/local/bin/eget" &
78+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/huggingface-cli" -o "/usr/local/bin/huggingface-cli" &
79+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/jq" -o "/usr/local/bin/jq" &
80+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/oras" -o "/usr/local/bin/oras" &
81+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/ouch" -o "/usr/local/bin/ouch" &
82+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/rsync" -o "/usr/local/bin/rsync" &
83+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/trufflehog" -o "/usr/local/bin/trufflehog" &
84+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/xq" -o "/usr/local/bin/xq" &
85+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/xz" -o "/usr/local/bin/xz" &
86+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/yq" -o "/usr/local/bin/yq" &
87+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/zstd" -o "/usr/bin/zstd" &
88+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/zstd" -o "/usr/local/bin/zstd" &
89+
wait ; echo
90+
sudo chmod -v 'a+x' \
91+
"/usr/bin/7z" \
92+
"/usr/local/bin/7z" \
93+
"/usr/local/bin/ansi2txt" \
94+
"/usr/local/bin/aria2" \
95+
"/usr/local/bin/aria2c" \
96+
"/usr/local/bin/askalono" \
97+
"/usr/local/bin/bsdtar" \
98+
"/usr/local/bin/b3sum" \
99+
"/usr/local/bin/dasel" \
100+
"/usr/local/bin/eget" \
101+
"/usr/local/bin/huggingface-cli" \
102+
"/usr/local/bin/jq" \
103+
"/usr/local/bin/oras" \
104+
"/usr/local/bin/ouch" \
105+
"/usr/local/bin/rsync" \
106+
"/usr/local/bin/trufflehog" \
107+
"/usr/local/bin/xq" \
108+
"/usr/local/bin/xz" \
109+
"/usr/local/bin/yq" \
110+
"/usr/bin/zstd" \
111+
"/usr/local/bin/zstd"
112+
continue-on-error: true
113+
114+
- name: Setup Env
115+
run: |
116+
#Presets
117+
set +x ; set +e
118+
#--------------#
119+
#Docker Tags
120+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
121+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
122+
#Copy dockerfiles
123+
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
124+
cp "${GITHUB_WORKSPACE}/main/Github/Runners/debian.dockerfile" "/tmp/DOCKERFILES/debian.dockerfile"
125+
continue-on-error: false
126+
127+
- name: Set up QEMU
128+
uses: docker/setup-qemu-action@v3
129+
continue-on-error: true
130+
131+
- name: Set up Docker Buildx
132+
uses: docker/setup-buildx-action@v3
133+
continue-on-error: true
134+
135+
- name: Login to Docker Hub
136+
uses: docker/login-action@v3
137+
with:
138+
username: "${{ secrets.DOCKERHUB_USERNAME }}"
139+
password: "${{ secrets.DOCKERHUB_TOKEN }}"
140+
continue-on-error: true
141+
142+
- name: Login to GHCR
143+
uses: docker/login-action@v3
144+
with:
145+
registry: ghcr.io
146+
username: "${{ github.actor }}"
147+
password: "${{ secrets.GITHUB_TOKEN }}"
148+
continue-on-error: true
149+
150+
#https://hub.docker.com/r/pkgforge/debian
151+
- name: Docker Build and Push (Debian)
152+
uses: docker/build-push-action@v6
153+
with:
154+
context: /tmp/DOCKERFILES/
155+
file: "/tmp/DOCKERFILES/debian.dockerfile"
156+
platforms: "linux/${{ matrix.platform }}"
157+
tags: |
158+
pkgforge/debian:${{ matrix.arch }}
159+
pkgforge/debian:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
160+
ghcr.io/pkgforge/devscripts/debian:${{ matrix.arch }}
161+
ghcr.io/pkgforge/devscripts/debian:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
162+
push: true
163+
continue-on-error: true
164+
165+
- name: Pirnt Manifest (docker.io/pkgforge/debian:${{ matrix.arch }})
166+
run: |
167+
#Presets
168+
set +x ; set +e
169+
#--------------#
170+
docker manifest inspect "docker.io/pkgforge/debian:${{ matrix.arch }}" 2>/dev/null | jq .
171+
continue-on-error: true
172+
173+
- name: Pirnt Manifest (ghcr.io/pkgforge/devscripts/debian:${{ matrix.arch }})
174+
run: |
175+
#Presets
176+
set +x ; set +e
177+
#--------------#
178+
docker manifest inspect "ghcr.io/pkgforge/devscripts/debian:${{ matrix.arch }}" 2>/dev/null | jq .
179+
continue-on-error: true
180+
#------------------------------------------------------------------------------------#
181+
build-push-debian-loongarch64:
182+
name: Push (Debian loongarch64) --> Docker Hub
183+
runs-on: "ubuntu-latest"
184+
185+
steps:
186+
- name: Checkout repository
187+
uses: actions/checkout@v4
188+
with:
189+
path: main
190+
filter: "blob:none"
191+
192+
#- name: Debloat Runner
193+
# run: |
194+
# #Presets
195+
# set +x ; set +e
196+
# #--------------#
197+
# bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/debloat_ubuntu.sh")
198+
# continue-on-error: true
199+
200+
- name: Install Addons
201+
run: |
202+
##Presets
203+
set +x ; set +e
204+
#-------------#
205+
##Debug?
206+
if [[ "${DEBUG}" = "1" ]] || [[ "${DEBUG}" = "ON" ]]; then
207+
set -x
208+
fi
209+
#-------------#
210+
#export PARALLEL=1
211+
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
212+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/bin/7z" &
213+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/7z" -o "/usr/local/bin/7z" &
214+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/ansi2txt" -o "/usr/local/bin/ansi2txt" &
215+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2" &
216+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/aria2" -o "/usr/local/bin/aria2c" &
217+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/askalono" -o "/usr/local/bin/askalono" &
218+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/bsdtar" -o "/usr/local/bin/bsdtar" &
219+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/b3sum" -o "/usr/local/bin/b3sum" &
220+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/dasel" -o "/usr/local/bin/dasel" &
221+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/eget" -o "/usr/local/bin/eget" &
222+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/huggingface-cli" -o "/usr/local/bin/huggingface-cli" &
223+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/jq" -o "/usr/local/bin/jq" &
224+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/oras" -o "/usr/local/bin/oras" &
225+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/ouch" -o "/usr/local/bin/ouch" &
226+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/rsync" -o "/usr/local/bin/rsync" &
227+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/trufflehog" -o "/usr/local/bin/trufflehog" &
228+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/xq" -o "/usr/local/bin/xq" &
229+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/xz" -o "/usr/local/bin/xz" &
230+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/yq" -o "/usr/local/bin/yq" &
231+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/zstd" -o "/usr/bin/zstd" &
232+
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)-$(uname -s)/zstd" -o "/usr/local/bin/zstd" &
233+
wait ; echo
234+
sudo chmod -v 'a+x' \
235+
"/usr/bin/7z" \
236+
"/usr/local/bin/7z" \
237+
"/usr/local/bin/ansi2txt" \
238+
"/usr/local/bin/aria2" \
239+
"/usr/local/bin/aria2c" \
240+
"/usr/local/bin/askalono" \
241+
"/usr/local/bin/bsdtar" \
242+
"/usr/local/bin/b3sum" \
243+
"/usr/local/bin/dasel" \
244+
"/usr/local/bin/eget" \
245+
"/usr/local/bin/huggingface-cli" \
246+
"/usr/local/bin/jq" \
247+
"/usr/local/bin/oras" \
248+
"/usr/local/bin/ouch" \
249+
"/usr/local/bin/rsync" \
250+
"/usr/local/bin/trufflehog" \
251+
"/usr/local/bin/xq" \
252+
"/usr/local/bin/xz" \
253+
"/usr/local/bin/yq" \
254+
"/usr/bin/zstd" \
255+
"/usr/local/bin/zstd"
256+
continue-on-error: true
257+
258+
- name: Setup Env
259+
run: |
260+
#Presets
261+
set +x ; set +e
262+
#--------------#
263+
#Docker Tags
264+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
265+
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
266+
#Copy dockerfiles
267+
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
268+
cp "${GITHUB_WORKSPACE}/main/Github/Runners/debian_loongarch64.dockerfile" "/tmp/DOCKERFILES/debian.dockerfile"
269+
continue-on-error: false
270+
271+
- name: Set up QEMU
272+
uses: docker/setup-qemu-action@v3
273+
continue-on-error: true
274+
275+
- name: Set up Docker Buildx
276+
uses: docker/setup-buildx-action@v3
277+
continue-on-error: true
278+
279+
- name: Login to Docker Hub
280+
uses: docker/login-action@v3
281+
with:
282+
username: "${{ secrets.DOCKERHUB_USERNAME }}"
283+
password: "${{ secrets.DOCKERHUB_TOKEN }}"
284+
continue-on-error: true
285+
286+
- name: Login to GHCR
287+
uses: docker/login-action@v3
288+
with:
289+
registry: ghcr.io
290+
username: "${{ github.actor }}"
291+
password: "${{ secrets.GITHUB_TOKEN }}"
292+
continue-on-error: true
293+
294+
#https://hub.docker.com/r/pkgforge/debian
295+
- name: Docker Build and Push (debian - loongarch64)
296+
uses: docker/build-push-action@v6
297+
with:
298+
context: /tmp/DOCKERFILES/
299+
file: "/tmp/DOCKERFILES/debian.dockerfile"
300+
platforms: "linux/loong64"
301+
tags: |
302+
pkgforge/debian:loongarch64
303+
pkgforge/debian:loongarch64-${{ env.DOCKER_TAG }}
304+
ghcr.io/pkgforge/devscripts/debian:loongarch64
305+
ghcr.io/pkgforge/devscripts/debian:loongarch64-${{ env.DOCKER_TAG }}
306+
outputs: type=registry,compression=zstd,compression-level=22
307+
continue-on-error: true
308+
309+
- name: Pirnt Manifest (docker.io/pkgforge/debian:loongarch64)
310+
run: |
311+
#Presets
312+
set +x ; set +e
313+
#--------------#
314+
docker manifest inspect "docker.io/pkgforge/debian:loongarch64" 2>/dev/null | jq .
315+
continue-on-error: true
316+
317+
- name: Pirnt Manifest (ghcr.io/pkgforge/devscripts/debian:loongarch64)
318+
run: |
319+
#Presets
320+
set +x ; set +e
321+
#--------------#
322+
docker manifest inspect "ghcr.io/pkgforge/devscripts/debian:loongarch64" 2>/dev/null | jq .
323+
continue-on-error: true
324+
#------------------------------------------------------------------------------------#

Github/Runners/debian.dockerfile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# syntax=docker/dockerfile:1
22
#------------------------------------------------------------------------------------#
3-
ARG TARGETARCH=amd64
4-
ENV DEBIAN_FRONTEND=noninteractive
5-
6-
# Stage for official Debian images (amd64, arm64, riscv64)
7-
FROM debian:unstable AS official
8-
RUN apt update && \
9-
apt install -y ca-certificates curl wget && \
10-
apt clean && \
11-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
12-
13-
# Create aliases for official architectures
14-
FROM official AS amd64
15-
FROM official AS arm64
16-
FROM official AS riscv64
17-
18-
# Stage for loongarch64 using pre-built image
19-
FROM docker.io/pkgforge/debian:loongarch64 AS loongarch64
20-
RUN apt update && \
21-
apt install -y ca-certificates curl wget && \
22-
apt clean && \
23-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
24-
25-
# Select based on architecture
26-
FROM ${TARGETARCH} AS final
27-
CMD ["/bin/bash"]
3+
FROM debian:unstable
4+
ENV GIT_ASKPASS="/bin/echo"
5+
ENV GIT_TERMINAL_PROMPT="0"
6+
ENV DEBIAN_FRONTEND="noninteractive"
7+
RUN <<EOS
8+
set +e
9+
#Config
10+
echo "nameserver 1.1.1.1" > "/etc/resolv.conf"
11+
echo "nameserver 2606:4700:4700::1111" >> "/etc/resolv.conf"
12+
echo "nameserver 8.8.8.8" >> "/etc/resolv.conf"
13+
echo "nameserver 2620:0:ccc::2" >> "/etc/resolv.conf"
14+
apt autoremove -y 2>/dev/null
15+
apt clean -y 2>/dev/null
16+
apt purge -y 2>/dev/null
17+
#Update
18+
apt update -y -qq
19+
apt upgrade -y -qq
20+
apt autoremove -y 2>/dev/null
21+
apt clean -y 2>/dev/null
22+
apt purge -y 2>/dev/null
23+
rm -rvf /var/lib/apt/lists/* /tmp/* /var/tmp/*
24+
EOS
25+
CMD ["/bin/bash"]
26+
#------------------------------------------------------------------------------------#
27+
#END

0 commit comments

Comments
 (0)