-
Notifications
You must be signed in to change notification settings - Fork 0
/
gocv.Dockerfile
32 lines (22 loc) · 941 Bytes
/
gocv.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG OPENCV_VERSION
FROM querycap/opencv-debian:$OPENCV_VERSION-ffmpeg-buster-$TARGETARCH AS gocv
LABEL maintainer="querycap"
LABEL DATE="2020-11-19"
ARG GOLANG_VERSION
ARG GOCV_VERSION
ARG TARGETARCH
ENV GOLANG_VERSION $GOLANG_VERSION
RUN apt-get update && apt-get install -y --no-install-recommends \
git software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN set -eux; curl -o go.tgz -fsSL https://dl.google.com/go/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz && \
tar -C /usr/local -xf go.tgz && \
rm go.tgz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
RUN go get -u -d gocv.io/x/gocv@v${GOCV_VERSION} \
&& cd $GOPATH/pkg/mod/gocv.io/x/gocv@v${GOCV_VERSION}/cmd/version \
&& go build -o /usr/bin/gocv_version -i main.go
CMD ["/usr/bin/gocv_version"]