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

add go-discover binary to control-plane image #1749

Merged
merged 3 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## UNRELEASED

BUG FIXES:
* Control Plane
* Add discover binary to control-plane image [[GH-1749](https://github.com/hashicorp/consul-k8s/pull/1749)]
* Helm:
* Don't pass in a CA file to the API Gateway controller when `externalServers.useSystemRoots` is `true`. [[GH-1743](https://github.com/hashicorp/consul-k8s/pull/1743)]

Expand Down
9 changes: 8 additions & 1 deletion control-plane/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
#
# ===================================

# go-discover builds the discover binary (which we don't currently publish
# either).
FROM golang:1.19.2-alpine as go-discover
RUN CGO_ENABLED=0 go install github.com/hashicorp/go-discover/cmd/discover@49f60c093101c9c5f6b04d5b1c80164251a761a6

# dev copies the binary from a local build
# -----------------------------------
# BIN_NAME is a requirement in the hashicorp docker github action

FROM alpine:3.16 AS dev

# NAME and VERSION are the name of the software in releases.hashicorp.com
Expand Down Expand Up @@ -43,6 +47,7 @@ RUN apk add --no-cache ca-certificates gnupg libcap openssl su-exec iputils libc
RUN addgroup ${BIN_NAME} && \
adduser -S -G ${BIN_NAME} 100

COPY --from=go-discover /go/bin/discover /bin/
COPY pkg/bin/linux_${TARGETARCH}/${BIN_NAME} /bin
COPY cni/pkg/bin/linux_${TARGETARCH}/${CNI_BIN_NAME} /bin

Expand Down Expand Up @@ -94,6 +99,7 @@ ARG TARGETARCH
RUN addgroup ${BIN_NAME} && \
adduser -S -G ${BIN_NAME} 100

COPY --from=go-discover /go/bin/discover /bin/
COPY dist/${TARGETOS}/${TARGETARCH}/${BIN_NAME} /bin/
COPY dist/cni/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/

Expand Down Expand Up @@ -155,6 +161,7 @@ RUN groupadd --gid 1000 ${BIN_NAME} && \
adduser --uid 100 --system -g ${BIN_NAME} ${BIN_NAME} && \
usermod -a -G root ${BIN_NAME}

COPY --from=go-discover /go/bin/discover /bin/
COPY dist/${TARGETOS}/${TARGETARCH}/${BIN_NAME} /bin/
COPY dist/cni/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/

Expand Down