Skip to content

Commit

Permalink
Merge pull request #191 from xmidt-org/docker
Browse files Browse the repository at this point in the history
update dockerfile and release workflow
  • Loading branch information
piccione99 authored Jan 22, 2025
2 parents d59fa4d + 007ab2e commit 6a73a64
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ on:

jobs:
ci:
uses: xmidt-org/shared-go/.github/workflows/ci.yml@59f5d322b0ee953245334530336f8e6503cacb65 # v4.4.27
uses: xmidt-org/shared-go/.github/workflows/ci.yml@766cd1914571123cc26ab6e0f1782c784dc4f11f # v4.4.28
with:
release-type: program
license-skip: true
release-type: program
release-arch-arm64: false
release-docker: true
release-docker-latest: true
release-docker-major: true
release-docker-minor: true
release-docker-extras: |
.release/docker
LICENSE
NOTICE
yaml-lint-skip: false
secrets: inherit
33 changes: 10 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
## SPDX-FileCopyrightText: 2016 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 \
upx
curl

# Download spruce here to eliminate the need for curl in the final image
RUN mkdir -p /go/bin && \
Expand All @@ -25,8 +15,6 @@ RUN mkdir -p /go/bin && \

COPY . .

RUN make test release

##########################
# Build the final image.
##########################
Expand All @@ -35,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/petasos /
COPY --from=builder /src/.release/docker/entrypoint.sh /
COPY petasos /
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/petasos_spruce.yaml /tmp/petasos_spruce.yaml
COPY --from=builder /go/bin/spruce /bin/
COPY .release/docker/petasos_spruce.yaml /tmp/petasos_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/petasos/ \
Expand All @@ -62,4 +49,4 @@ EXPOSE 6401
EXPOSE 6402
EXPOSE 6403

CMD ["/petasos"]
CMD ["/petasos"]

0 comments on commit 6a73a64

Please sign in to comment.