Skip to content

Commit

Permalink
Merge pull request #561 from xmidt-org/denopink/chore/standardize-doc…
Browse files Browse the repository at this point in the history
…kerfile

chore: standardize dockerfile
  • Loading branch information
denopink authored Oct 9, 2024
2 parents 7c09625 + f7e2645 commit e1c8709
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .

Expand All @@ -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/ \
Expand Down

0 comments on commit e1c8709

Please sign in to comment.