Skip to content

Commit b690489

Browse files
Fix Dockerfile to include mkarchiso execution
Fixes #77 Update Dockerfile to include mkarchiso execution and enhance workflow checks. * **Dockerfile**: - Add `RUN mkarchiso -v -w /workdir/workdir -o /workdir/out .` to execute `mkarchiso` command. - Add comments to explain the purpose of each command and section. * **README.md**: - Update the "Build the ISO in the container" section to reflect the automated `mkarchiso` execution. * **.github/workflows/dockerfile-check.yaml**: - Add a step to verify the ISO file's integrity and size after the build process. - Add comments to explain the purpose of each step in the workflow.
1 parent db99043 commit b690489

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

.github/workflows/dockerfile-check.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,38 @@ jobs:
2020
run: |
2121
set -e # Exit immediately if a command exits with a non-zero status
2222
docker build -t arch-iso-builder . || { echo "Docker build failed"; exit 1; }
23-
docker run --rm --privileged -v "$(pwd)":/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ." || { echo "ISO creation failed"; exit 1; }
23+
24+
- name: Verify ISO
25+
run: |
26+
set -e # Exit immediately if a command exits with a non-zero status
27+
cd out/
28+
29+
# Check if ISO exists
30+
iso_count=$(ls -1 *.iso 2>/dev/null | wc -l)
31+
if [ $iso_count -eq 0 ]; then
32+
echo '::error::No ISO file found'
33+
exit 1
34+
elif [ $iso_count -gt 1 ]; then
35+
echo '::error::Multiple ISO files found'
36+
exit 1
37+
fi
38+
39+
iso_file=$(ls *.iso)
40+
41+
# Check ISO size (minimum 500MB)
42+
size=$(stat -c%s "$iso_file")
43+
if [ $size -lt 524288000 ]; then
44+
echo "::error::ISO file too small: $((size / 1024 / 1024))MB"
45+
exit 1
46+
fi
47+
48+
# Verify ISO checksum
49+
sha256sum "$iso_file" > checksum.sha256
50+
sha256sum -c checksum.sha256 || {
51+
echo '::error::ISO checksum verification failed'
52+
exit 1
53+
}
54+
55+
# Generate additional checksums
56+
md5sum "$iso_file" > checksum.md5
57+
sha1sum "$iso_file" > checksum.sha1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ To install Docker, follow the instructions for your operating system:
7373
7474
3. **Build the ISO in the container**:
7575
76-
Build the ISO with this command:
76+
The Dockerfile now includes the `mkarchiso` command to automate the ISO build process. Simply run the container to build the ISO:
7777
7878
```bash
79-
docker run --rm --privileged -v $(pwd):/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ."
79+
docker run --rm --privileged -v $(pwd):/workdir arch-iso-builder
8080
```
8181
8282
4. **Retrieve the ISO**:

dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ WORKDIR /workdir
1010
# Copy files into the container
1111
COPY . .
1212

13-
# Instead of running mkarchiso here, we leave it for later execution
13+
# Run mkarchiso to build the ISO
14+
RUN mkarchiso -v -w /workdir/workdir -o /workdir/out .
15+
1416
# Create an entrypoint or leave it to manual execution
1517
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)