Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixing remote spire agent docker file to resolve build issues #235

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,16 @@
#
# ----------------------------------------------------------------------------------

# Build utility container
ARG BUILDER_BASE=golang:1.20-alpine3.17
FROM ${BUILDER_BASE} AS builder

WORKDIR /edgex-go

RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories

RUN apk add --update --no-cache make git build-base curl

ARG SPIRE_RELEASE=1.6.3

# build spire from the source in order to be compatible with arch arm64 as well
RUN mkdir -p spire-build
WORKDIR /edgex-go/spire-build
RUN wget -q "https://github.com/spiffe/spire/archive/refs/tags/v${SPIRE_RELEASE}.tar.gz" && \
tar xv --strip-components=1 -f "v${SPIRE_RELEASE}.tar.gz" && \
echo "building spire from source..." && \
make bin/spire-server bin/spire-agent

# Deployment image
FROM alpine:3.17

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2022 Intel Corporation'
copyright='Copyright (c) 2023 Intel Corporation'

RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories
RUN apk update && apk --no-cache --update add dumb-init openssl gcompat

COPY --from=builder /edgex-go/spire-build/bin/spire-agent /usr/local/bin
COPY --from=builder /edgex-go/spire-build/bin/spire-server /usr/local/bin
COPY --from=ghcr.io/spiffe/spire-agent:1.6.3 /opt/spire/bin/spire-agent /usr/local/bin
COPY --from=ghcr.io/spiffe/spire-server:1.6.3 /opt/spire/bin/spire-server /usr/local/bin

COPY docker-entrypoint.sh /usr/local/bin/
COPY agent.conf /usr/local/etc/spire/agent.conf.tpl
Expand Down