-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.gocv.arm64
32 lines (29 loc) · 1.61 KB
/
Dockerfile.gocv.arm64
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
# GoCV Docker Image
# Build:
# docker build -f Dockerfile.gocv.arm64 -t gocv:arm64 .
# golang
FROM ubuntu:20.04 AS golang-arm64-stage
LABEL maintainer="jonotoninnovation"
ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="America/New_York"
RUN apt update && apt install -y sudo git wget curl build-essential cmake gcc g++ pkg-config unzip tzdata
RUN apt purge -y golang
RUN mkdir /Downloads
RUN wget -c https://go.dev/dl/go1.23.5.linux-arm64.tar.gz -O - | tar -xz -C /Downloads
ENV GOROOT="/Downloads/go"
ENV PATH=$PATH:$GOROOT/bin
RUN which go && go version
ENV GOPATH=/go
ENV GO111MODULE=on
RUN mkdir -p "$GOPATH/src"
WORKDIR /go/src
# gocv
FROM golang-arm64-stage AS gocv-stage
RUN export WANT_GENERAL_DEBS="sudo git wget curl build-essential cmake gcc g++ pkg-config unzip tzdata" &&\
export WANT_OPENCV_DEBS="unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev libharfbuzz-dev libfreetype-dev" &&\
export WANT_OPENCV_DEBS_EXTRA="libavutil-dev libv4l-dev libswresample-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libxvidcore-dev libx264-dev libgtk-3-dev libopenexr-dev libwebp-dev libatlas-base-dev gfortran" && \
apt update && apt install -y $WANT_GENERAL_DEBS $WANT_OPENCV_DEBS $WANT_OPENCV_DEBS_EXTRA
RUN mkdir -p $GOPATH/pkg/mod/gocv.io/x/gocv@v0.37.0
RUN git clone --depth 1 --branch v0.37.0 https://github.com/hybridgroup/gocv.git $GOPATH/pkg/mod/gocv.io/x/gocv@v0.37.0
RUN cd $GOPATH/pkg/mod/gocv.io/x/gocv@v0.37.0 && make install
RUN cd $GOPATH/pkg/mod/gocv.io/x/gocv@v0.37.0 && go install -v .