Skip to content

Commit

Permalink
docker: add dockerfile example showing how to build using static linking
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Sep 18, 2024
1 parent 03eb508 commit 68c10c2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile-static
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# to build this docker image:
# docker build -f Dockerfile-static -t gocv-static .
#
FROM ghcr.io/hybridgroup/opencv:4.10.0-static AS gocv-build

ENV GOPATH /go

COPY . /go/src/gocv.io/x/gocv/

WORKDIR /go/src/gocv.io/x/gocv

RUN ls -la /usr/local/lib/opencv4/3rdparty/

RUN go build -tags static -o /build/gocv_version ./cmd/version/

FROM ubuntu:latest AS final

COPY --from=gocv-build /build/gocv_version /run/gocv_version

CMD ["/run/gocv_version"]

0 comments on commit 68c10c2

Please sign in to comment.