Skip to content

Commit

Permalink
fix(docker): update Dockerfile to be compatible with modern CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Jul 13, 2024
1 parent 7ad116a commit 6e0d87f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
19 changes: 5 additions & 14 deletions Dockerfile.darwin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} ghcr.io/darkness4/fc2-live-dl-go:latest-darwin-base-${TARGETARCH} as builder
FROM --platform=${BUILDPLATFORM} ghcr.io/darkness4/fc2-live-dl-go:latest-darwin-base-${TARGETARCH} AS builder

WORKDIR /work
COPY go.mod go.sum ./
Expand Down Expand Up @@ -29,17 +29,8 @@ RUN if [ "${TARGETARCH}" = "amd64" ]; then \
fi; \
GOARCH=${TARGETARCH} make bin/fc2-live-dl-go-darwin VERSION=${VERSION}

FROM scratch
# Helper container to copy binaries outside the container using podman/buildx export. Unused in production.
FROM scratch AS export

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /work/bin/fc2-live-dl-go-darwin /fc2-live-dl-go

ENTRYPOINT [ "/fc2-live-dl-go" ]

# Helper container to copy binaries outside the container. Unused in production.
FROM busybox as busybox

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /work/bin/fc2-live-dl-go-darwin /fc2-live-dl-go

ENTRYPOINT [ "/fc2-live-dl-go" ]
ARG TARGETARCH
COPY --from=builder /work/bin/fc2-live-dl-go-darwin /fc2-live-dl-go-darwin-${TARGETARCH}
16 changes: 8 additions & 8 deletions Dockerfile.static
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} ghcr.io/darkness4/fc2-live-dl-go:latest-static-base as builder
FROM --platform=${BUILDPLATFORM} ghcr.io/darkness4/fc2-live-dl-go:latest-static-base AS builder

WORKDIR /work
COPY go.mod go.sum ./
Expand All @@ -24,17 +24,17 @@ RUN if [ "${TARGETARCH}" = "amd64" ]; then \
fi; \
CGO_ENABLED=1 GOARCH=${TARGETARCH} make bin/fc2-live-dl-go-static VERSION=${VERSION}

FROM --platform=${TARGETPLATFORM} scratch

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /work/bin/fc2-live-dl-go-static /fc2-live-dl-go
# Helper container to copy binaries outside the container using podman/buildx export. Unused in production.
FROM scratch AS export

ENTRYPOINT [ "/fc2-live-dl-go" ]
ARG TARGETARCH
COPY --from=builder /work/bin/fc2-live-dl-go-static /fc2-live-dl-go-linux-${TARGETARCH}

# Helper container to copy binaries outside the container. Unused in production.
FROM --platform=${TARGETPLATFORM} busybox as busybox
# Running container
FROM --platform=${TARGETPLATFORM} scratch

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /work/bin/fc2-live-dl-go-static /fc2-live-dl-go

ENTRYPOINT [ "/fc2-live-dl-go" ]

2 changes: 1 addition & 1 deletion Dockerfile.static-base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 docker.io/gentoo/stage3:musl as builder
FROM --platform=linux/amd64 docker.io/gentoo/stage3:musl AS builder

RUN PORTAGE_RSYNC_EXTRA_OPTS="-q" emerge --sync

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.static-windows
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/darkness4/fc2-live-dl-go:latest-static-windows-base
FROM ghcr.io/darkness4/fc2-live-dl-go:latest-static-windows-base AS builder

WORKDIR /work
COPY go.mod go.sum ./
Expand Down

0 comments on commit 6e0d87f

Please sign in to comment.