cashapp / pranadb

Apache License 2.0
612 stars 24 forks source link

Fix Docker compose demo for M1 chips #351

Open severb opened 2 years ago

severb commented 2 years ago

make start fails on M1 with the following error:

 => ERROR [build_base 7/7] RUN go build -tags musl -o ./out/pranadb ./cmd/pranadb                                                                                                                                                                                                                      13.9s
------
 > [build_base 7/7] RUN go build -tags musl -o ./out/pranadb ./cmd/pranadb:
#14 13.37 # github.com/confluentinc/confluent-kafka-go/kafka
#14 13.37 /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.7.0/kafka/librdkafka_vendor/librdkafka_musl_linux.a(rdkafka_error.o): Relocations in generic ELF (EM: 62)
#14 13.37 /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.7.0/kafka/librdkafka_vendor/librdkafka_musl_linux.a(rdkafka_error.o): Relocations in generic ELF (EM: 62)
#14 13.37 /usr/lib/gcc/aarch64-alpine-linux-musl/10.3.1/../../../../aarch64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.7.0/kafka/librdkafka_vendor/librdkafka_musl_linux.a: error adding symbols: file in wrong format
#14 13.37 collect2: error: ld returned 1 exit status

Running DOCKER_DEFAULT_PLATFORM=linux/amd64 make start fixes it, but we should make it work out of the box.

purplefox commented 2 years ago

@severb assigning this to you. I don't have an M1 so this is hard for me to reproduce.

xuebingli commented 2 years ago

Will adding DOCKER_DEFAULT_PLATFORM=linux/amd64 make start to Docker-based demo doc be sufficient to close this issue?

purplefox commented 2 years ago

Will adding DOCKER_DEFAULT_PLATFORM=linux/amd64 make start to Docker-based demo doc be sufficient to close this issue?

We need someone who has an M1 laptop to verify that. If it works, then the issue can be closed.