Hi @subhoatg
Unfortunately, we don’t currently support Alpine, but support will be coming soon in the next version of the Go API! You’ll have to switch to another base image for now such as golang:buster and ubuntu:latest for your build and main images respectively.
In addition, the Solace PubSub+ Go API uses C code under the hood for performance, thus requires CGO_ENABLED=1 when building.
@amackenzie > Thanks for your reply.
I tried with the below Dockerfile.
FROM golang:1.18-buster as builder
WORKDIR /app
RUN apt update
RUN apt install build-essential -y
COPY patterns/direct_subscriber.go ./direct_subscriber.go
COPY go.mod go.sum ./
RUN go mod download
RUN ls /app
WORKDIR /app
RUN CGO_ENABLED=1 GOOS=linux go build -o main . #main image
FROM ubuntu:latest
ENV APP_USER app
ENV APP_HOME /app
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
Copy the output from builder image to main image
COPY --from=builder /app ./
RUN chown -R $APP_USER:$APP_USER $APP_HOME
USER $APP_USER
Run the sync agent executable by default when the container starts.
ENTRYPOINT [“./main”]
But now I am getting a different error.
=> ERROR [builder 10/10] RUN CGO_ENABLED=1 go build -o main . 2.3s
> [builder 10/10] RUN CGO_ENABLED=1 go build -o main .: #18 2.250 # solace.dev/go/messaging/internal/ccsmp #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a(solClient.o): Relocations in generic ELF (EM: 62) #18 2.250 /usr/bin/ld: /go/pkg/mod/solace.dev/go/messaging@v1.0.1/internal/ccsmp/lib/linux/libsolclient.a: error adding symbols: file in wrong format #18 2.250 collect2: error: ld returned 1 exit status
executor failed running [/bin/sh -c CGO_ENABLED=1 go build -o main .]: exit code: 2
Hi @subhoatg ,
Support of Alpine and M1 will be coming towards the end of this year. I’ll be sure to make a community post when it happens so be in the lookout for that announcement.
Hello,
may I ask if we are now enabled to use Alpine with MUSL to statically link our dependencies?
I think static linking with glibc will also cause licencing issues if one plans to distribute a piece of software to customers thats using solace internally ?
Hi @subhoatg ,
We had announced the C API support for Alpine (which is required for the Go API) and that announcement was made here: PubSub+ Messaging API for C - Alpine Linux Support — Solace Community
As for the Go API it officially supports Alpine Linux as of version 1.1.0 (with the current version being v.1.2.0)
This concludes support for Alpine, however support for Mac M series is still pending and expected on or before June 2023. Similarly to the the Alpine support, I will be making another community post once it is released for general awareness.
Thank you,
MV