Skip to content

Instantly share code, notes, and snippets.

@dertom95
Last active November 5, 2023 22:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dertom95/b3811188e9b8f97c99cf7ba62f905754 to your computer and use it in GitHub Desktop.
Save dertom95/b3811188e9b8f97c99cf7ba62f905754 to your computer and use it in GitHub Desktop.
Dockerfile to create nakama-image for arm64
version: '3'
services:
postgres:
container_name: postgres
image: arm64v8/postgres:9.6-alpine
environment:
- POSTGRES_DB="nakama"
volumes:
- /home/odroid/_dev/ALWAYSDEL/nakama/postgres:/var/lib/postgresql/data
expose:
- "8080"
- "5432"
ports:
- "5432:5432"
- "8080:8080"
nakama:
container_name: nakama
image: heroiclabs/nakama:latest-arm64v8
entrypoint:
- "/bin/sh"
- "-ecx"
- >
sleep 15 &&
/nakama/nakama migrate up --database.address postgres@postgres:5432/nakama &&
exec /nakama/nakama --name nakama1 --database.address postgres@postgres:5432/nakama --logger.level DEBUG --session.token_expiry_sec 7200
restart: always
links:
- "postgres:db"
depends_on:
- postgres
volumes:
- /host/path/for/nakama:/nakama/data
expose:
- "7349"
- "7350"
- "7351"
ports:
- "7349:7349"
- "7350:7350"
- "7351:7351"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7350/"]
interval: 10s
timeout: 5s
retries: 5
volumes:
data:
## Copyright 2018 The Nakama Authors
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:##www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
# docker build "$PWD" --build-arg commit="$(git rev-parse --short HEAD)" --build-arg version=v2.1.1 -t heroiclabs/nakama:2.1.1
# docker build "$PWD" --build-arg commit="$(git rev-parse --short HEAD)" --build-arg version="v2.1.1-$(git rev-parse --short HEAD)" -t heroiclabs/nakama-prerelease:"2.1.1-$(git rev-parse --short HEAD)"
FROM arm64v8/golang:1.12.7-alpine3.10 as builder
ARG commit
ARG version
ENV GOOS linux
ENV GOARCH arm64
ENV CGO_ENABLED 0
RUN apk --no-cache add ca-certificates gcc musl-dev git && \
git config --global advice.detachedHead false && \
git clone --no-checkout https://github.com/heroiclabs/nakama /go/src/github.com/heroiclabs/nakama
WORKDIR /go/src/github.com/heroiclabs/nakama
RUN git checkout "$commit" && \
go build -o /go/build/nakama -gcflags "-trimpath $PWD" -asmflags "-trimpath $PWD" -ldflags "-s -w -X main.version=$version -X main.commitID=$commit"
FROM arm64v8/alpine:3.10
MAINTAINER Heroic Labs <support@heroiclabs.com>
ARG version
LABEL version=$version
LABEL variant=nakama
LABEL description="Distributed server for social and realtime games and apps."
RUN mkdir -p /nakama/data/modules && \
apk --no-cache add ca-certificates curl iproute2 unzip rsync git tini
WORKDIR /nakama/
COPY --from=builder "/go/build/nakama" /nakama/
EXPOSE 7349 7350 7351
ENTRYPOINT ["/sbin/tini", "--", "/nakama/nakama"]
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:7350/ || exit 1
sudo docker build "$PWD" --build-arg commit="$(git rev-parse --short HEAD)" --build-arg version=v2.1.1 -t heroiclabs/nakama:2.1.1
free(): invalid pointer
SIGABRT: abort
PC=0x7fa5fe74d8 m=0 sigcode=18446744073709551610
signal arrived during cgo execution
goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x49fb28, 0x4420047cd8, 0x29)
/usr/lib/go-1.8/src/runtime/cgocall.go:131 +0x9c fp=0x4420047ca0 sp=0x4420047c60
github.com/docker/docker-credential-helpers/secretservice._Cfunc_free(0x58ada0)
github.com/docker/docker-credential-helpers/secretservice/_obj/_cgo_gotypes.go:111 +0x38 fp=0x4420047cd0 sp=0x4420047ca0
github.com/docker/docker-credential-helpers/secretservice.Secretservice.List.func5(0x58ada0)
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/obj-aarch64-linux-gnu/src/github.com/docker/docker-credential-helpers/secretservice/secretservice_linux.go:96 +0x44 fp=0x4420047d00 sp=0x4420047cd0
github.com/docker/docker-credential-helpers/secretservice.Secretservice.List(0x0, 0x554f80, 0x442006e2c0)
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/obj-aarch64-linux-gnu/src/github.com/docker/docker-credential-helpers/secretservice/secretservice_linux.go:97 +0x1c4 fp=0x4420047da0 sp=0x4420047d00
github.com/docker/docker-credential-helpers/secretservice.(*Secretservice).List(0x57b3b8, 0x40ed60, 0x442000c001, 0x40e80c)
<autogenerated>:4 +0x48 fp=0x4420047de0 sp=0x4420047da0
github.com/docker/docker-credential-helpers/credentials.List(0x555ac0, 0x57b3b8, 0x555000, 0x4420088008, 0x0, 0x0)
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/obj-aarch64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:145 +0x28 fp=0x4420047e60 sp=0x4420047de0
github.com/docker/docker-credential-helpers/credentials.HandleCommand(0x555ac0, 0x57b3b8, 0x7ff032485f, 0x4, 0x554fc0, 0x4420088000, 0x555000, 0x4420088008, 0x442006e250, 0x49f99c)
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/obj-aarch64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:60 +0x12c fp=0x4420047ed0 sp=0x4420047e60
github.com/docker/docker-credential-helpers/credentials.Serve(0x555ac0, 0x57b3b8)
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/obj-aarch64-linux-gnu/src/github.com/docker/docker-credential-helpers/credentials/credentials.go:41 +0x1a0 fp=0x4420047f50 sp=0x4420047ed0
main.main()
/build/golang-github-docker-docker-credential-helpers-iveBZG/golang-github-docker-docker-credential-helpers-0.5.0/secretservice/cmd/main_linux.go:9 +0x40 fp=0x4420047f80 sp=0x4420047f50
runtime.main()
/usr/lib/go-1.8/src/runtime/proc.go:185 +0x1f4 fp=0x4420047fd0 sp=0x4420047f80
runtime.goexit()
/usr/lib/go-1.8/src/runtime/asm_arm64.s:981 +0x4 fp=0x4420047fd0 sp=0x4420047fd0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go-1.8/src/runtime/asm_arm64.s:981 +0x4
r0 0x0
r1 0x7ff0324028
r2 0x0
r3 0x8
r4 0x0
r5 0x7ff0324028
r6 0xffffffffffffffff
r7 0xffffffffffffffff
r8 0x87
r9 0xffffffffffffffff
r10 0xffffffffffffffff
r11 0xffffffffffffffff
r12 0xffffffffffffffff
r13 0xffffffffffffffff
r14 0x8
r15 0x0
r16 0x54e168
r17 0x7fa602c838
r18 0x7fa6108a70
r19 0x7fa6107000
r20 0x6
r21 0x7fa6333000
r22 0x7ff0324260
r23 0x2
r24 0x7fa6107000
r25 0x1
r26 0x7fa60de778
r27 0x2
r28 0x7ff0324290
r29 0x7ff0324000
lr 0x7fa5fe7464
sp 0x7ff0324000
pc 0x7fa5fe74d8
fault 0x0
Sending build context to Docker daemon 63.49kB
Step 1/21 : FROM arm64v8/golang:1.12.7-alpine3.10 as builder
---> eb77e2f2146a
Step 2/21 : ARG commit
---> Using cache
---> 75393f9421db
Step 3/21 : ARG version
---> Using cache
---> f1257ce257e6
Step 4/21 : ENV GOOS linux
---> Using cache
---> 9bb3f9d61623
Step 5/21 : ENV GOARCH arm64
---> Using cache
---> 5b7ae680f542
Step 6/21 : ENV CGO_ENABLED 0
---> Running in d60ff9601075
Removing intermediate container d60ff9601075
---> 9bc9998433db
Step 7/21 : RUN apk --no-cache add ca-certificates gcc musl-dev git && git config --global advice.detachedHead false && git clone --no-checkout https://github.com/heroiclabs/nakama /go/src/github.com/heroiclabs/nakama
---> Running in f3b949e98d3b
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/aarch64/APKINDEX.tar.gz
(1/17) Upgrading musl (1.1.22-r2 -> 1.1.22-r3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment