Skip to content

Commit

Permalink
Merge pull request #781 from xmidt-org/update-dockerfile
Browse files Browse the repository at this point in the history
chore:Update dockerfile.
  • Loading branch information
schmidtw authored Sep 4, 2024
2 parents 4d1e26b + ac7b35b commit 6581507
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
## SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC
## SPDX-FileCopyrightText: 2022 Comcast Cable Communications Management, LLC
## SPDX-License-Identifier: Apache-2.0
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 \
make \
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 . .

RUN make test release

##########################
# Build the final image.
##########################
Expand All @@ -36,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/argus /
COPY --from=builder /src/.release/docker/entrypoint.sh /
COPY argus /
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/argus_spruce.yaml /tmp/argus_spruce.yaml
COPY --from=builder /go/bin/spruce /bin/
COPY .release/docker/argus_spruce.yaml /tmp/argus_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/argus/ \
Expand Down

0 comments on commit 6581507

Please sign in to comment.