go build 时出现 undefined: kafka.Message
二、解决方法1、打开动态编译
ENV CGO_ENABLED=1
2、若是跨平台编译,目标平台是linux
需要添加:-tags musl
3、实例
FROM golang:1.13-alpine AS builder ENV GOOS linux ENV GOARCH amd64 # missed this very obvious change ENV CGO_ENABLED 1 RUN apk update && apk upgrade && apk add --no-cache git # needed for gcc RUN apk add --no-cache git build-base WORKDIR /build COPY . ./ # confluent-kafka-go recommends musl tags for alpine linux builds RUN go build -tags musl三、参考
1、 https://github.com/confluentinc/confluent-kafka-go/issues/479
2、https://github.com/confluentinc/confluent-kafka-go
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)