Add Dockerfile and image

This commit is contained in:
Milan Nikolic
2018-11-17 18:04:51 +01:00
parent 8ebd729dcd
commit fb1388a10a
2 changed files with 26 additions and 0 deletions

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM golang:alpine as build
WORKDIR /build
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -tags jpeg -o cam2ip -ldflags "-s -w"
FROM scratch
COPY --from=build /build/cam2ip /cam2ip
EXPOSE 56000
ENTRYPOINT ["/cam2ip"]

View File

@@ -48,6 +48,10 @@ Binaries are compiled with static OpenCV/libjpeg-turbo libraries, they should ju
This will install app in `$GOPATH/bin/cam2ip`.
### Run in Docker container
docker run --device=/dev/video0:/dev/video0 -p56000:56000 -it gen2brain/cam2ip
### Usage
```