forked from jonoton/scout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm64
49 lines (45 loc) · 1.81 KB
/
Dockerfile.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Scout Docker Image
# Build:
# docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f Dockerfile.arm64 -t scout:arm64 .
# Run in foreground and remove after:
# docker run -it --rm -p 8080:8080 -v HOST_DATA_PATH:/scout/data -v HOST_CONFIG_PATH:/scout/.config -v HOST_LOGS_PATH:/scout/.logs scout:arm64
# Run in background and keep:
# docker run -d -p 8080:8080 -v HOST_DATA_PATH:/scout/data -v HOST_CONFIG_PATH:/scout/.config -v HOST_LOGS_PATH:/scout/.logs scout:arm64
# Keep Host Date Time Localization
# Add to the lines above: -v /etc/localtime:/etc/localtime:ro
# GoCV
FROM ubuntu:18.04 AS gocv-arm64
LABEL maintainer="jonotoninnovation"
ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="America/New_York"
RUN apt update && apt install -y sudo git wget build-essential
RUN apt purge -y golang
RUN mkdir /Downloads
RUN wget -c https://golang.org/dl/go1.15.8.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
RUN go get -d gocv.io/x/[email protected]
RUN cd $GOPATH/pkg/mod/gocv.io/x/[email protected] && make install
RUN cd $GOPATH/pkg/mod/gocv.io/x/[email protected] && go install -v .
# Scout
FROM gocv-arm64 AS scout-arm64
LABEL maintainer="jonotoninnovation"
ARG UNAME=user
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN mkdir /scout && chown $UID:$GID /scout
WORKDIR /go/src/github.com/jonoton/scout
COPY . .
RUN chown -R $UID:$GID /go
USER $UNAME
RUN mkdir -p /scout/data && mkdir -p /scout/.config && mkdir -p /scout/.logs
RUN ln -s /scout/.config /go/src/github.com/jonoton/scout/.config && ln -s /scout/.logs /go/src/github.com/jonoton/scout/.logs
RUN go get -d -v ./... && go install -v ./...
CMD /go/bin/scout