mirror of
https://github.com/hybridgroup/gocv
synced 2025-08-25 08:41:04 +08:00
20 lines
806 B
Plaintext
Executable File
20 lines
806 B
Plaintext
Executable File
# to build this docker image:
|
|
# docker build -f Dockerfile-static-builder -t gocv-static-builder .
|
|
# or for multi-arch builds:
|
|
# docker buildx build -f Dockerfile-static-builder -t ghcr.io/hybridgroup/gocv-static-builder --platform=linux/amd64,linux/arm64 --push .
|
|
#
|
|
# to use this docker image:
|
|
# cd /path/to/my/project
|
|
# docker run --rm -e "BINARYNAME=mjpeg-streamer" -e "SRCPATH=./cmd/mjpeg-streamer" -v $(pwd):/src -v $(pwd)/build:/build -a stdout -a stderr --platform linux/amd64 gocv-static-builder
|
|
#
|
|
# NOTE that you cannot use highgui from the static build!
|
|
#
|
|
FROM --platform=$BUILDPLATFORM ghcr.io/hybridgroup/opencv:4.12.0-static AS gocv-static-builder
|
|
|
|
WORKDIR /src
|
|
|
|
ENV BINARYNAME=gocv_static_binary
|
|
ENV SRCPATH=.
|
|
|
|
CMD go build -tags static -o /build/$BINARYNAME -buildvcs=false $SRCPATH
|