2024-05-02 18:04:55 +00:00
|
|
|
ARG OPENCV_VERSION=4.9.0
|
|
|
|
FROM golang:1.22-alpine as gobuilder
|
2020-01-04 13:10:36 +00:00
|
|
|
|
|
|
|
|
2024-05-02 18:04:55 +00:00
|
|
|
FROM ghcr.io/hybridgroup/opencv:${OPENCV_VERSION} as builder
|
2020-01-04 13:10:36 +00:00
|
|
|
|
|
|
|
LABEL maintainer="Cyrille Nofficial"
|
|
|
|
|
|
|
|
COPY --from=gobuilder /usr/local/go /usr/local/go
|
|
|
|
ENV GOPATH /go
|
|
|
|
ENV PATH /usr/local/go/bin:$GOPATH/bin:/usr/local/go/bin:$PATH
|
|
|
|
|
|
|
|
RUN mkdir -p "/src $GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
ADD . .
|
|
|
|
|
2024-05-02 18:04:55 +00:00
|
|
|
RUN go build -mod vendor -a ./cmd/rc-road/
|
2020-01-04 13:10:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-02 18:04:55 +00:00
|
|
|
FROM ghcr.io/hybridgroup/opencv:${OPENCV_VERSION}
|
2020-01-04 13:10:36 +00:00
|
|
|
|
|
|
|
ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64
|
|
|
|
|
|
|
|
USER 1234
|
|
|
|
COPY --from=builder /src/rc-road /go/bin/rc-road
|
|
|
|
ENTRYPOINT ["/go/bin/rc-road"]
|