test
Some checks failed
Build Alpine RootFS and Docker Image (latest) / build-rootfs (push) Failing after 13s
Build Alpine RootFS and Docker Image (latest) / push-tarball (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / push-docker (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / update-changelog (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / update-build-info (push) Has been skipped
Some checks failed
Build Alpine RootFS and Docker Image (latest) / build-rootfs (push) Failing after 13s
Build Alpine RootFS and Docker Image (latest) / push-tarball (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / push-docker (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / update-changelog (push) Has been skipped
Build Alpine RootFS and Docker Image (latest) / update-build-info (push) Has been skipped
This commit is contained in:
@@ -24,18 +24,25 @@ jobs:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build custom Alpine builder image
|
||||
- name: Build Alpine Base Image
|
||||
run: |
|
||||
docker build -t alpine-builder:latest .
|
||||
docker build -t alpine-builder .
|
||||
container_id=$(docker create alpine-builder)
|
||||
docker cp "$container_id:/alpine-base.tar.gz" .
|
||||
docker rm "$container_id"
|
||||
|
||||
- name: Run Alpine build scripts
|
||||
run: |
|
||||
mkdir -p latest
|
||||
bash base-image-script/alpine-base_pt1.sh
|
||||
# - name: Build custom Alpine builder image
|
||||
# run: |
|
||||
# docker build -t alpine-builder:latest .
|
||||
|
||||
- name: Run Alpine build scripts inside builder container
|
||||
run: |
|
||||
docker run --rm --privileged -v "$PWD":/workspace -w /workspace alpine-builder bash base-image-script/alpine-base_pt1.sh
|
||||
# - name: Run Alpine build scripts
|
||||
# run: |
|
||||
# mkdir -p latest
|
||||
# bash base-image-script/alpine-base_pt1.sh
|
||||
|
||||
# - name: Run Alpine build scripts inside builder container
|
||||
# run: |
|
||||
# docker run --rm --privileged -v "$PWD":/workspace -w /workspace alpine-builder bash base-image-script/alpine-base_pt1.sh
|
||||
|
||||
- name: Show tarball
|
||||
run: ls -lh ${{ env.OUTPUT_TAR }}
|
||||
|
||||
39
Dockerfile
39
Dockerfile
@@ -1,15 +1,36 @@
|
||||
FROM alpine:latest
|
||||
FROM alpine:3.20 AS builder
|
||||
LABEL maintainer="fithwum"
|
||||
|
||||
ARG VERSION
|
||||
WORKDIR /builder
|
||||
|
||||
# Install needed Alpine build tools
|
||||
RUN apk update && apk add --no-cache bash curl wget git sudo jq util-linux coreutils ca-certificates \
|
||||
&& update-ca-certificates
|
||||
# Install tools needed for building rootfs
|
||||
RUN apk update && apk add --no-cache \
|
||||
bash curl wget git jq ca-certificates coreutils \
|
||||
tar gzip
|
||||
|
||||
COPY base-image-script/ base-image-script/
|
||||
RUN chmod +x base-image-script/*.sh
|
||||
# Download alpine-make-rootfs script
|
||||
RUN wget https://raw.githubusercontent.com/alpinelinux/alpine-make-rootfs/master/alpine-make-rootfs \
|
||||
&& chmod +x alpine-make-rootfs
|
||||
|
||||
# Default command (overridden by CI)
|
||||
CMD ["bash"]
|
||||
# Build the rootfs
|
||||
RUN ./alpine-make-rootfs \
|
||||
--branch v3.20 \
|
||||
--mirror http://dl-cdn.alpinelinux.org/alpine \
|
||||
--packages "bash curl ca-certificates nano" \
|
||||
alpine-rootfs
|
||||
|
||||
# Run custom script inside rootfs without chroot (simulate setup)
|
||||
COPY base-image-script/alpine-base_pt2.sh /builder/alpine-rootfs/
|
||||
RUN chmod +x /builder/alpine-rootfs/alpine-base_pt2.sh && \
|
||||
chroot /builder/alpine-rootfs /alpine-base_pt2.sh || true
|
||||
|
||||
# Clean up the part2 script after execution
|
||||
RUN rm -f /builder/alpine-rootfs/alpine-base_pt2.sh
|
||||
|
||||
# Package it
|
||||
RUN mkdir -p /output && \
|
||||
tar -czf /output/alpine-base.tar.gz -C alpine-rootfs .
|
||||
|
||||
# Final image to export tarball
|
||||
FROM scratch AS export-stage
|
||||
COPY --from=builder /output/alpine-base.tar.gz /
|
||||
|
||||
Reference in New Issue
Block a user