Skip to content

Commit

Permalink
docker: add dockerfile for container that can perform static builds o…
Browse files Browse the repository at this point in the history
…f your own GoCV project. Note that HighGUI is not currently supported by static builds

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Sep 18, 2024
1 parent 68c10c2 commit f0a4b80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile-static-builder
Original file line number Diff line number Diff line change
@@ -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 .

0 comments on commit f0a4b80

Please sign in to comment.