From 7a5d9b80c7c6f7141305e98d8c5bd501138ea000 Mon Sep 17 00:00:00 2001 From: Abdullah Date: Thu, 4 Jan 2024 20:49:33 +0100 Subject: [PATCH] Update Dockerfile. Add build ARG I was building docker image on my windows machine and I got the following error ```sqlite3-binding.c:35911:42: error: 'pread64' undeclared here (not in a function); did you mean 'pread'?``` I searched a bit and apply suggestion (suggested [here](https://github.com/mattn/go-sqlite3/issues/1164) After the change, I was able to build my Docker image successfully on my windows machine. I think suggested change will also work for linux machine. --- server/go-kgp/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/go-kgp/Dockerfile b/server/go-kgp/Dockerfile index 63868ca..b249588 100644 --- a/server/go-kgp/Dockerfile +++ b/server/go-kgp/Dockerfile @@ -7,6 +7,7 @@ RUN apk add --no-cache sqlite graphviz gcc libc-dev ADD . /app/ WORKDIR /app/ RUN go mod download +ARG CGO_CFLAGS="-D_LARGEFILE64_SOURCE" RUN go build -v -o /go-kgp ./cmd/practice # Mount an external volume and use it as a working directory @@ -15,4 +16,4 @@ VOLUME /data/ # Expose end-points and start the server EXPOSE 8080 EXPOSE 2671 -ENTRYPOINT ["/go-kgp"] \ No newline at end of file +ENTRYPOINT ["/go-kgp"]