apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
247 stars 111 forks source link

Adding s390x support to solr-operator docker image #261

Open anujajakhade opened 3 years ago

anujajakhade commented 3 years ago

Hi, I could successfully build the solr-operator image for s390x and deploy the solr operator pod on s390x without doing any code changes. The docker hub image of solr-operator currently supports only amd64 and arm64. Can we make this image support s390x as well?

HoustonPutman commented 3 years ago

I've tried building the docker image multi-architecture with s390x, but it fails...

 => [internal] load build definition from Dockerfile                                    0.5s
 => => transferring dockerfile: 32B                                                     0.0s
 => [internal] load .dockerignore                                                       0.8s
 => => transferring context: 2B                                                         0.0s
 => [internal] load metadata for gcr.io/distroless/base:debug-nonroot                   0.4s
 => [internal] load metadata for docker.io/library/golang:1.16                          1.9s
 => [auth] library/golang:pull token for registry-1.docker.io                           0.0s
 => CACHED [stage-1 1/5] FROM gcr.io/distroless/base:debug-nonroot@sha256:2b2be54c1ed2  0.0s
 => => resolve gcr.io/distroless/base:debug-nonroot@sha256:2b2be54c1ed2cb5f590caa3b979  0.6s
 => [internal] load build context                                                       0.5s
 => => transferring context: 104.77kB                                                   0.1s
 => [builder  1/15] FROM docker.io/library/golang:1.16@sha256:7f69ee6e3ea6c3acab98576d  0.7s
 => => resolve docker.io/library/golang:1.16@sha256:7f69ee6e3ea6c3acab98576d8d51bf2e72  0.6s
 => CACHED [builder  2/15] WORKDIR /workspace                                           0.0s
 => ERROR [builder  3/15] RUN go install sigs.k8s.io/controller-tools/cmd/controller-g  1.2s
------
 > [builder  3/15] RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0;     go install github.com/google/go-licenses@latest:
#9 0.847 Illegal instruction
#9 0.889 Illegal instruction
------
Dockerfile:20
--------------------
  19 |     # Download necessary libraries
  20 | >>> RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0; \
  21 | >>>     go install github.com/google/go-licenses@latest
  22 |
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0;     go install github.com/google/go-licenses@latest]: exit code: 132
anujajakhade commented 3 years ago

Hi @HoustonPutman Thank you for your reply. I had followed the steps mentioned in the Makefile and GA on s390x.

Looks like you are using buildx for creating the multiarch image. Can you please share your steps?

HoustonPutman commented 3 years ago

I just tried running this on my Mac after pulling the latest main.

docker buildx build --platform "linux/s390x" --build-arg GIT_SHA=6f26747 . --tag solr-operator:test -f ./build/Dockerfile