Skip to content

Commit 584941b

Browse files
authored
✨ Fixing container build for other archs (#60)
Reasonable change
2 parents 3b98481 + 410bf13 commit 584941b

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ ARG deployment_base_image
2121
ARG deployment_base_image_tag
2222
ARG goprivate
2323

24+
# Build step only to fetch the ssh_known_hosts
25+
FROM ${deployment_base_image}:${deployment_base_image_tag} AS sshbuilder
26+
WORKDIR /ssh
27+
28+
RUN apk add --no-cache openssh openssh-client
29+
30+
COPY ./hack/update-ssh-known-hosts.sh ./
31+
32+
# Known Hosts
33+
RUN ./update-ssh-known-hosts.sh
34+
2435
# Build architecture
2536
ARG ARCH
2637

@@ -50,9 +61,6 @@ RUN --mount=type=secret,id=netrc,required=false,target=/root/.netrc \
5061
# Copy the sources
5162
COPY ./ ./
5263

53-
# Known Hosts
54-
RUN ./hack/update-ssh-known-hosts.sh
55-
5664
# Cache the go build into the Go’s compiler cache folder so we take benefits of compiler caching across docker build calls
5765
RUN --mount=type=secret,id=netrc,required=false,target=/root/.netrc \
5866
--mount=type=cache,target=/root/.cache/go-build \
@@ -93,7 +101,7 @@ ENV GOROOT=/usr/local/go
93101

94102
WORKDIR /
95103
COPY --from=builder /workspace/manager .
96-
COPY --from=builder /workspace/hack/ssh_known_hosts /etc/ssh/ssh_known_hosts
104+
COPY --from=sshbuilder /ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts
97105

98106
# Create non-root user
99107
RUN adduser -u 65532 -D -h /home/nonroot -s /bin/sh nonroot

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ CAPI_KIND_CLUSTER_NAME ?= capi-test
220220
# It is set by Prow GIT_TAG, a git-based tag of the form vYYYYMMDD-hash, e.g., v20210120-v0.3.10-308-gc61521971
221221

222222
#TAG ?= dev
223+
# Next release v1.0.0-alpha.11
223224
TAG ?= v1.0.0-alpha.10
224225
ARCH ?= $(shell go env GOARCH)
225-
ALL_ARCH = amd64 arm64 #ppc64le s390 arm
226+
ALL_ARCH = amd64 arm64 ppc64le
226227

227228
# Allow overriding manifest generation destination directory
228229
MANIFEST_ROOT ?= config

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ Examples of `Cdk8sAppProxy` usage can be found in the `/examples` directory in t
4545
- [`examples/cdk8sappproxy_sample-go.yaml`](./examples/cdk8sappproxy_sample-go.yaml): This example demonstrates how to deploy a sample cdk8s application from a public Git repository to clusters matching a specific label selector. It shows the usage of the `gitRepository` field.
4646
- [`examples/cdk8sappproxy_sample-typescript.yaml`](./examples/cdk8sappproxy_sample-typescript.yaml): This directory contains a sample cdk8s application written in Typescript, which also generates a kustomization file.
4747

48+
### Supported Platforms:
49+
50+
`amd64 arm64 ppc64le`
51+
52+
`s390` and `arm` is currently not supported.
53+
4854
### Code of conduct
4955

5056
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
template:
88
spec:
99
containers:
10-
- image: ghcr.io/eitco/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller-arm64:v1.0.0-alpha.10
10+
- image: ghcr.io/eitco/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller:v1.0.0-alpha.10
1111
name: manager

config/default/manager_image_patch.yaml-e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
template:
88
spec:
99
containers:
10-
- image: ghcr.io/eitco/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller-amd64:v1.0.0-alpha.10
10+
- image: ghcr.io/eitco/cluster-api-addon-provider-cdk8s/cluster-api-cdk8s-controller-ppc64le:v1.0.0-alpha.10
1111
name: manager

hack/update-ssh-known-hosts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
set -e
44

0 commit comments

Comments
 (0)