Skip to content

Commit

Permalink
Add discover binary to control-plane image (#1749)
Browse files Browse the repository at this point in the history
* add discover binary to control-plane image
  • Loading branch information
curtbushko authored Nov 21, 2022
1 parent a6c36a3 commit 94506bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 94506bb

Please sign in to comment.