From f0a4b80839d6a5b0164d477344cf166db5a11967 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Wed, 18 Sep 2024 11:45:30 +0200 Subject: [PATCH] docker: add dockerfile for container that can perform static builds of your own GoCV project. Note that HighGUI is not currently supported by static builds Signed-off-by: deadprogram --- Dockerfile-static-builder | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 Dockerfile-static-builder diff --git a/Dockerfile-static-builder b/Dockerfile-static-builder new file mode 100755 index 00000000..d5bb2aa6 --- /dev/null +++ b/Dockerfile-static-builder @@ -0,0 +1,16 @@ +# to build this docker image: +# docker build -f Dockerfile-static-builder -t gocv-static-builder . +# +# to use this docker image: +# cd /path/to/my/project +# docker run --rm -e "BINARYNAME=myapp" -v $(pwd):/src -v $(pwd)/build:/build -a stdout -a stderr gocv-static-builder +# +# NOTE that you cannot use highgui from the static build! +# +FROM ghcr.io/hybridgroup/opencv:4.10.0-static AS gocv-static-builder + +WORKDIR /src + +ENV BINARYNAME=gocv_static_binary + +CMD go build -tags static -o /build/$BINARYNAME -buildvcs=false .