FROM yveshield/gocv-alpine:4.1.1-buildstage as build-stage RUN go get -u -d gocv.io/x/gocv ADD . /StreamWatcher RUN cd $GOPATH/src/gocv.io/x/gocv && go build -o $GOPATH/bin/gocv-version ./cmd/version/main.go RUN $GOPATH/bin/gocv-version RUN cd $GOPATH/src/gocv.io/x/gocv && go build -o $GOPATH/bin/StreamWatcher /StreamWatcher/*.go FROM yveshield/gocv-alpine:4.1.1-runtime COPY --from=build-stage /go/bin/StreamWatcher /StreamWatcher ENTRYPOINT [ "/StreamWatcher" ]