Skip to content

Commit

Permalink
chore: multi-arch support with buildx in all Dockerfiles (#5273)
Browse files Browse the repository at this point in the history
* chore: use buildx to build grpc-ping-go

Signed-off-by: kahirokunn <[email protected]>

* chore: support grpc-ping-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-clojure multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-dart multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-deno multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-elixir multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-haskell multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-java-micronaut multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-java-quarkus multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-r multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-rserver multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-rust multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-swift multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-vertx multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support iris-classifier multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-python multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support node-heartbeat-source multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support cloudevents-dotnet multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support cloudevents-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support cloudevents-nodejs multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support cloudevents-rust multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support gitwebhook-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-csharp multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-java-spark multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-java-spring multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-kotlin multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-nodejs multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-php multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-python multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-shell multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support knative-routing-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support kong-routing-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support multi-container multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support secrets-go multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support knative-docs multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-r Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support helloworld-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support cloudevents-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support gitwebhook-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support knative-routing-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support kong-routing-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support servingcontainer Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support sidecarcontainer Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support secrets-go Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

* chore: support multi-container Dockerfile multiple architecture

Signed-off-by: kahirokunn <[email protected]>

---------

Signed-off-by: kahirokunn <[email protected]>
  • Loading branch information
kahirokunn committed Sep 6, 2023
1 parent 6b0b256 commit 8e917ed
Show file tree
Hide file tree
Showing 59 changed files with 179 additions and 262 deletions.
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-clojure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-clojure .

# Push the container to docker registry
docker push {username}/helloworld-clojure
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-clojure" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-clojure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-clojure .

# Push the container to docker registry
docker push {username}/helloworld-clojure
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-clojure" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-dart .
# Push the container to docker registry
docker push {username}/helloworld-dart
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-dart" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
9 changes: 3 additions & 6 deletions code-samples/community/serving/helloworld-dart/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ that you can use for testing. It reads in the env variable `TARGET` and prints
## Prerequisites

- A Kubernetes cluster with Knative installed and DNS configured. Follow the
[Knative installation instructions](https://knative.dev/docs/install/) if
[Knative installation instructions](https://knative.dev/docs/install/) if
you need to create one.
- [Docker](https://www.docker.com) installed and running on your local machine,
and a Docker Hub account configured (we'll use it for a container registry).
Expand Down Expand Up @@ -64,11 +64,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-dart .
# Push the container to docker registry
docker push {username}/helloworld-dart
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-dart" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-deno .
# Push the container to docker registry
docker push {username}/helloworld-deno
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-deno" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-deno/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-deno .
# Push the container to docker registry
docker push {username}/helloworld-deno
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-deno" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-elixir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ above.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-elixir .
# Push the container to docker registry
docker push {username}/helloworld-elixir
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-elixir" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-elixir/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ above.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-elixir .
# Push the container to docker registry
docker push {username}/helloworld-elixir
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-elixir" --push .
```

1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-haskell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-haskell .
# Push the container to docker registry
docker push {username}/helloworld-haskell
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-haskell" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-haskell/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-haskell .
# Push the container to docker registry
docker push {username}/helloworld-haskell
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-haskell" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,8 @@ your sample app to your cluster:
following commands with your Docker Hub username.

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-java-micronaut .

# Push the container to docker registry
docker push {username}/helloworld-java-micronaut
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-micronaut" --push .
```

1. Now that your container image is in the registry, you can deploy it to your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,8 @@ your sample app to your cluster:
following commands with your Docker Hub username.

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-java-micronaut .

# Push the container to docker registry
docker push {username}/helloworld-java-micronaut
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-micronaut" --push .
```

1. Now that your container image is in the registry, you can deploy it to your
Expand Down
11 changes: 4 additions & 7 deletions code-samples/community/serving/helloworld-java-quarkus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,12 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-java-quarkus .
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-quarkus" --push .
# (OR)
# Build the container on your local machine - Quarkus native mode
docker build -t {username}/helloworld-java-quarkus -f Dockerfile.native .
# Push the container to docker registry
docker push {username}/helloworld-java-quarkus
# Build and push the container on your local machine. - Quarkus native mode
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-quarkus" --push . -f Dockerfile.native
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
11 changes: 4 additions & 7 deletions code-samples/community/serving/helloworld-java-quarkus/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,12 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-java-quarkus .
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-quarkus" --push .
# (OR)
# Build the container on your local machine - Quarkus native mode
docker build -t {username}/helloworld-java-quarkus -f Dockerfile.native .
# Push the container to docker registry
docker push {username}/helloworld-java-quarkus
# Build and push the container on your local machine. - Quarkus native mode
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-java-quarkus" --push . -f Dockerfile.native
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
5 changes: 4 additions & 1 deletion code-samples/community/serving/helloworld-r/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# https://hub.docker.com/_/golang
FROM golang:1.12 as builder

ARG TARGETOS
ARG TARGETARCH

# Copy local code to the container image.
WORKDIR /go/src/github.com/knative/docs/helloworld-r
COPY invoke.go .

# Build the command inside the container.
# (You may fetch or manage dependencies here,
# either manually or with a tool like "godep".)
RUN CGO_ENABLED=0 GOOS=linux go build -v -o invoke
RUN CGO_ENABLED=0 GOOS=linux GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o invoke

# The official R base image
# https://hub.docker.com/_/r-base
Expand Down
12 changes: 6 additions & 6 deletions code-samples/community/serving/helloworld-r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ cd knative-docs/code-samples/community/serving/hello-world/helloworld-r
# https://hub.docker.com/_/golang
FROM golang:1.12 as builder

ARG TARGETOS
ARG TARGETARCH

# Copy local code to the container image.
WORKDIR /go/src/github.com/knative/docs/helloworld-r
COPY invoke.go .

# Build the command inside the container.
# (You may fetch or manage dependencies here,
# either manually or with a tool like "godep".)
RUN CGO_ENABLED=0 GOOS=linux go build -v -o invoke
RUN CGO_ENABLED=0 GOOS=linux GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o invoke

# The official R base image
# https://hub.docker.com/_/r-base
Expand Down Expand Up @@ -131,11 +134,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-r .
# Push the container to docker registry
docker push {username}/helloworld-r
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-r" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
12 changes: 6 additions & 6 deletions code-samples/community/serving/helloworld-r/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ cd knative-docs/code-samples/community/serving/hello-world/helloworld-r
# https://hub.docker.com/_/golang
FROM golang:1.12 as builder

ARG TARGETOS
ARG TARGETARCH

# Copy local code to the container image.
WORKDIR /go/src/github.com/knative/docs/helloworld-r
COPY invoke.go .

# Build the command inside the container.
# (You may fetch or manage dependencies here,
# either manually or with a tool like "godep".)
RUN CGO_ENABLED=0 GOOS=linux go build -v -o invoke
RUN CGO_ENABLED=0 GOOS=linux GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o invoke

# The official R base image
# https://hub.docker.com/_/r-base
Expand Down Expand Up @@ -131,11 +134,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-r .
# Push the container to docker registry
docker push {username}/helloworld-r
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-r" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-rserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-rserver .
# Push the container to docker registry
docker push {username}/helloworld-rserver
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-rserver" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-rserver/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ folder) you're ready to build and deploy the sample app.
username:
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-rserver .
# Push the container to docker registry
docker push {username}/helloworld-rserver
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-rserver" --push .
```
1. After the build has completed and the container is pushed to docker hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-rust .

# Push the container to docker registry
docker push {username}/helloworld-rust
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-rust" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-rust/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-rust .

# Push the container to docker registry
docker push {username}/helloworld-rust
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-rust" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-swift .

# Push the container to docker registry
docker push {username}/helloworld-swift
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-swift" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-swift/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,8 @@ folder) you're ready to build and deploy the sample app.
username:

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-swift .

# Push the container to docker registry
docker push {username}/helloworld-swift
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-swift" --push .
```

1. After the build has completed and the container is pushed to Docker Hub, you
Expand Down
7 changes: 2 additions & 5 deletions code-samples/community/serving/helloworld-vertx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,8 @@ your sample app to your cluster:
following commands with your Docker Hub username.

```bash
# Build the container on your local machine
docker build -t {username}/helloworld-vertx .

# Push the container to docker registry
docker push {username}/helloworld-vertx
# Build and push the container on your local machine.
docker buildx build --platform linux/arm64,linux/amd64 -t "{username}/helloworld-vertx" --push .
```

1. Now that your container image is in the registry, you can deploy it to your
Expand Down
Loading

0 comments on commit 8e917ed

Please sign in to comment.