From f7e2645a8cb79beeeb54f2d2c46f7851baa9945d Mon Sep 17 00:00:00 2001 From: Owen Cabalceta Date: Wed, 9 Oct 2024 14:01:46 -0400 Subject: [PATCH] chore: standardize dockerfile --- Dockerfile | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index d817d5ec..7d406450 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,24 +4,14 @@ FROM docker.io/library/golang:1.19-alpine as builder WORKDIR /src -ARG VERSION -ARG GITCOMMIT -ARG BUILDTIME - RUN apk add --no-cache --no-progress \ ca-certificates \ - curl \ - git \ - openssh \ - gcc \ - libc-dev - + curl + # Download spruce here to eliminate the need for curl in the final image RUN mkdir -p /go/bin && \ - arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ - curl -L -o /go/bin/spruce https://github.com/geofffranks/spruce/releases/download/v1.30.2/spruce-linux-${arch} && \ - chmod +x /go/bin/spruce && \ - sha1sum /go/bin/spruce + curl -L -o /go/bin/spruce https://github.com/geofffranks/spruce/releases/download/v1.29.0/spruce-linux-amd64 && \ + chmod +x /go/bin/spruce COPY . . @@ -33,18 +23,17 @@ FROM alpine:latest # Copy over the standard things you'd expect. COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /src/caduceus / -COPY --from=builder /src/.release/docker/entrypoint.sh / +COPY caduceus / +COPY .release/docker/entrypoint.sh / # Copy over spruce and the spruce template file used to make the actual configuration file. -COPY --from=builder /src/.release/docker/caduceus_spruce.yaml /tmp/caduceus_spruce.yaml -COPY --from=builder /go/bin/spruce /bin/ +COPY .release/docker/caduceus_spruce.yaml /tmp/caduceus_spruce.yaml +COPY --from=builder /go/bin/spruce /bin/ # Include compliance details about the container and what it contains. -COPY --from=builder /src/Dockerfile \ - /src/NOTICE \ - /src/LICENSE \ - /src/CHANGELOG.md / +COPY Dockerfile / +COPY NOTICE / +COPY LICENSE / # Make the location for the configuration file that will be used. RUN mkdir /etc/caduceus/ \