robocar-road/Dockerfile

29 lines
629 B
Docker

ARG OPENCV_VERSION=4.9.0
FROM golang:1.22-alpine as gobuilder
FROM ghcr.io/hybridgroup/opencv:${OPENCV_VERSION} as builder
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 . .
RUN go build -mod vendor -a ./cmd/rc-road/
FROM ghcr.io/hybridgroup/opencv:${OPENCV_VERSION}
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"]