diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 0bab537c..00000000 --- a/.dockerignore +++ /dev/null @@ -1,8 +0,0 @@ -* -!cmd -!go.mod -!go.sum -!internal -!Makefile -!pkg -!static diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dd486d11..d6f7d003 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -183,8 +183,10 @@ jobs: - name: Verify - hauler store extract run: | hauler store extract --help - # verify via hauler store content + # verify via extracting hauler store content hauler store extract hauler/hauler-manifest-local.yaml:latest + # view extracted content from store + cat hauler-manifest-local.yaml - name: Verify - hauler store info run: | @@ -209,6 +211,8 @@ jobs: hauler store save # verify via save with filename hauler store save --filename store.tar.zst + # verify via save with filename and platform (amd64) + hauler store save --filename store-amd64.tar.zst --platform linux/amd64 - name: Remove Hauler Store Contents run: | @@ -220,8 +224,10 @@ jobs: hauler store load --help # verify via load hauler store load haul.tar.zst - # verify via load with different temp directory + # verify via load with filename and temp directory hauler store load store.tar.zst --tempdir /opt + # verify via load with filename and platform (amd64) + hauler store load store-amd64.tar.zst - name: Verify Hauler Store Contents run: | @@ -230,9 +236,21 @@ jobs: # verify store directory structure tree -hC store + - name: Verify - docker load + run: | + docker load --help + # verify via load + docker load --input store-amd64.tar.zst + + - name: Verify Docker Images Contents + run: | + docker images --help + # verify images + docker images --all + - name: Remove Hauler Store Contents run: | - rm -rf store haul.tar.zst store.tar.zst + rm -rf store haul.tar.zst store.tar.zst store-amd64.tar.zst hauler store info - name: Verify - hauler store sync diff --git a/Dockerfile b/Dockerfile index ae3ba057..f0ebbab8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ FROM registry.suse.com/bci/golang:1.23 AS builder RUN zypper --non-interactive install make bash wget ca-certificates +RUN go install github.com/goreleaser/goreleaser/v2@latest + COPY . /build WORKDIR /build RUN make build @@ -17,6 +19,8 @@ RUN echo "hauler:x:1001:1001::/home/hauler:" > /etc/passwd \ # release stage FROM scratch AS release +ARG TARGETARCH + COPY --from=builder /var/lib/ca-certificates/ca-bundle.pem /etc/ssl/certs/ca-certificates.crt COPY --from=builder /etc/passwd /etc/passwd COPY --from=builder /etc/group /etc/group @@ -25,7 +29,7 @@ COPY --from=builder --chown=hauler:hauler /tmp/. /tmp COPY --from=builder --chown=hauler:hauler /store/. /store COPY --from=builder --chown=hauler:hauler /registry/. /registry COPY --from=builder --chown=hauler:hauler /fileserver/. /fileserver -COPY --from=builder --chown=hauler:hauler /build/bin/hauler / +COPY --from=builder --chown=hauler:hauler /build/dist/hauler_linux_${TARGETARCH}/hauler / USER hauler ENTRYPOINT [ "/hauler" ] @@ -33,11 +37,13 @@ ENTRYPOINT [ "/hauler" ] # debug stage FROM alpine AS debug +ARG TARGETARCH + COPY --from=builder /var/lib/ca-certificates/ca-bundle.pem /etc/ssl/certs/ca-certificates.crt COPY --from=builder /etc/passwd /etc/passwd COPY --from=builder /etc/group /etc/group COPY --from=builder --chown=hauler:hauler /home/hauler/. /home/hauler -COPY --from=builder --chown=hauler:hauler /build/bin/hauler /bin/hauler +COPY --from=builder --chown=hauler:hauler /build/dist/hauler_linux_${TARGETARCH}/hauler / RUN apk --no-cache add curl diff --git a/testdata/haul.tar.zst b/testdata/haul.tar.zst index 043d86d8..697945df 100644 Binary files a/testdata/haul.tar.zst and b/testdata/haul.tar.zst differ