Dockerfile doesn't build go shard

Hello ,
I’ve been following setup from heroiclabs and for local work everything went well. When I try to run through docker as I observed dockerfile doesn’t create necessary shard file for nakama to import go module.

Here is my Dockerfile

FROM heroiclabs/nakama-pluginbuilder:3.3.0 AS go-builder

ENV GO111MODULE on
ENV CGO_ENABLED 1

WORKDIR /app

COPY go.mod .
COPY main.go .
COPY vendor/ vendor/

RUN go build --trimpath --mod=vendor --buildmode=plugin -o ./modules/backend.so

FROM heroiclabs/nakama:3.3.0

COPY --from=go-builder ./modules/backend.so /nakama/data/modules/
COPY local.yml .

Hi @vazkss welcome to the Heroic Labs and Nakama community. Do you mean “shared” file instead of “shard”?

Could you share the log files you get when running the above?

Hi @vazkss.

You have set the WORKDIR to /app so your copy command needs to look like this:

COPY --from=go-builder ./app/modules/backend.so /nakama/data/modules/

Hope this helps.

1 Like