Skip to content

Commit

Permalink
Docker command
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenQuim committed Jun 5, 2024
1 parent f7543ef commit dcb4ec9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testdata
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.22 as builder

WORKDIR /go/src

COPY . .

RUN go mod download
RUN mkdir /data

RUN go build -ldflags "-s -w" -o entropy .

# Path: Dockerfile
FROM scratch

WORKDIR /bin

COPY --from=builder /go/src/entropy /bin
COPY --from=builder /data /data

ENTRYPOINT [ "entropy" ]




14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ go run github.com/EwenQuim/entropy@latest

WIP

### With docker

```bash
docker run --rm -v $(pwd):/data ewenquim/entropy /data

# More options
docker run --rm -v $(pwd):/data ewenquim/entropy -h
docker run --rm -v $(pwd):/data ewenquim/entropy -top 20 -ext js,py,go /data
```

The docker image is available on [Docker Hub](https://hub.docker.com/r/ewenquim/entropy).

The `-v` option is used to mount the current directory into the container. The `/data` directory is the default directory where the tool will look for files. **Don't forget to add /data at the end of the command**, otherwise the tool will search inside the container, not your local filesystem.

## Usage

I don't want to maintain a documentation here, so just run
Expand Down

0 comments on commit dcb4ec9

Please sign in to comment.