mirror of
https://github.com/hybridgroup/gocv
synced 2025-08-25 08:41:04 +08:00
22 lines
601 B
Plaintext
Executable File
22 lines
601 B
Plaintext
Executable File
# to build this docker image:
|
|
# docker buildx build -f Dockerfile-static -t gocv-static --platform=linux/amd64,linux/arm64 .
|
|
#
|
|
FROM --platform=$BUILDPLATFORM ghcr.io/hybridgroup/opencv:4.12.0-static AS gocv-build
|
|
|
|
ENV GOPATH /go
|
|
|
|
COPY . /go/src/gocv.io/x/gocv/
|
|
|
|
WORKDIR /go/src/gocv.io/x/gocv
|
|
|
|
RUN --mount=target=. \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
go build -tags static -o /build/gocv_version ./cmd/version/
|
|
|
|
FROM debian:bullseye AS final
|
|
|
|
COPY --from=gocv-build /build/gocv_version /run/gocv_version
|
|
|
|
CMD ["/run/gocv_version"]
|