Skip to content

Commit c7e292e

Browse files
authored
i386-debian-full docker ci
1 parent a856a16 commit c7e292e

3 files changed

Lines changed: 71 additions & 2 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docker
2+
3+
on:
4+
5+
workflow_dispatch:
6+
inputs:
7+
image:
8+
description: "Docker image name and tag"
9+
required: true
10+
default: "i386-debian-full"
11+
publish_tag:
12+
description: "ghcr.io TAG"
13+
required: false
14+
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
env:
20+
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
21+
22+
jobs:
23+
24+
build:
25+
name: Build
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Build
34+
id: build
35+
run: |
36+
image="$(echo ${{ inputs.image }} | tr -d '[:space:]')"
37+
echo "image=$image" >> "$GITHUB_OUTPUT"
38+
echo "Building: $image"
39+
40+
cd tools/docker/debian
41+
docker build . --platform linux/386 -t "$image" .
42+
- name: Export image
43+
id: export
44+
run: |
45+
image='${{ steps.build.outputs.image }}'
46+
output_fn="$(echo "$image" | tr ':' '_')"
47+
echo "output_fn=$output_fn" >> "$GITHUB_OUTPUT"
48+
docker save "$image" -o '${{ runner.temp }}/image.tar'
49+
sha256sum '${{ runner.temp }}/image.tar' > '${{ runner.temp }}/image.tar.sha256'
50+
- name: Upload artifact
51+
continue-on-error: true
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: ${{ steps.export.outputs.output_fn }}
55+
path: |
56+
${{ runner.temp }}/image.tar
57+
${{ runner.temp }}/image.tar.sha256
58+
compression-level: 9
59+
retention-days: 1
60+
61+
- name: Push to registry
62+
if: ${{ inputs.publish_tag != '' }}
63+
run: |
64+
image="${{ steps.build.outputs.image }}"
65+
echo "Pushing: $image"
66+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
67+
docker tag "$image" "${{ env.REGISTRY_IMAGE }}:${{ inputs.publish_tag }}"
68+
docker push "${{ env.REGISTRY_IMAGE }}:${{ inputs.publish_tag }}"
69+
echo "Pushed: $image to ghcr.io/${{ github.repository }}:${{ inputs.publish_tag }}"

tools/docker/debian/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /root/build
66
# ------------------------------------------------------------------------------
77

88
ENV INSTALL_DIR=/usr/local/bin
9-
ENV DEBIAN_FRONTEND noninteractive
9+
ENV DEBIAN_FRONTEND=noninteractive
1010

1111
# ------------------------------------------------------------------------------
1212
# Base image

tools/docker/debian/build-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CONTAINER_NAME=debian-full
99
IMAGE_NAME=i386/debian-full
1010

1111
mkdir -p "$IMAGES"
12-
docker build . --platform linux/386 --rm --tag "$IMAGE_NAME" &> build.log
12+
docker build . --platform linux/386 --rm --tag "$IMAGE_NAME" # &> build.log
1313
docker rm "$CONTAINER_NAME" || true
1414
docker create --platform linux/386 -t -i --name "$CONTAINER_NAME" "$IMAGE_NAME" bash
1515

0 commit comments

Comments
 (0)