Skip to content

Commit

Permalink
docker: add manifest and update related documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pilebones committed Mar 23, 2022
1 parent c735089 commit 37dd554
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LICENSE
readme.md
matcher.sample
.git
21 changes: 21 additions & 0 deletions Dockfile.multistage
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##
## Build
##

FROM golang:1.18.0-alpine3.15 AS builder

WORKDIR /build
COPY go.mod .
COPY go.sum .
RUN go mod download
ADD . /build
RUN CGO_ENABLED=0 go build -o /go-udev

##
## Deploy
##

FROM alpine:latest
WORKDIR /
COPY --from=builder /go-udev /go-udev
ENTRYPOINT ["/go-udev"]
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ You could pass this file using for both mode:
```

## Docker usage

### How to build docker image
```
docker build . -f Dockfile.multistage -t go-udev
```

### How to execute `go-udev -info` using docker image
```
docker run -rm -t go-udev -info
```

### How to execute `go-udev -monitor` using docker image
```
docker run --rm -v=/dev:/dev -v /run/udev:/run/udev:ro -t go-udev -monitor
```
Warning: unsafe method because we share host /dev directory to the container.

*__TODO__: unsafe and `-monitor` is not fully functional in docker, fix working in progress...*

## Throubleshooting

Don't hesitate to notice if you detect a problem with this tool or library.
Expand Down

0 comments on commit 37dd554

Please sign in to comment.