From 3a163cca8a38a9b66ed5efaea47c0fb73fb73e5c Mon Sep 17 00:00:00 2001 From: EwenQuim Date: Mon, 10 Jun 2024 08:58:50 +0200 Subject: [PATCH] Docker buildx commands + brew install command --- .dockerignore | 2 +- Dockerfile | 4 +++- Makefile | 4 ++-- README.md | 10 +++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index d383c56..1cc9ae4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1 @@ -testdata +testdata/* diff --git a/Dockerfile b/Dockerfile index db98d16..4f55307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM golang:1.22 as builder +ARG TARGETARCH + WORKDIR /go/src COPY . . @@ -7,7 +9,7 @@ COPY . . RUN go mod download RUN mkdir /data -RUN go build -ldflags "-s -w" -o entropy . +RUN GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "-s -w" -o entropy . # Path: Dockerfile FROM scratch diff --git a/Makefile b/Makefile index c67c34a..011a78a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -docker-build: - docker buildx build --platform linux/amd64,linux/arm64 --tag ewenquim/entropy:latest . +docker-buildx: + docker buildx build --platform linux/amd64,linux/arm64 --tag ewenquim/entropy:latest --push . docker-run: docker run --rm -v $(pwd):/data ewenquim/entropy /data diff --git a/README.md b/README.md index c56a8af..9092f00 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,15 @@ go run github.com/EwenQuim/entropy@latest ### With brew -WIP +```bash +brew install ewenquim/repo/entropy +entropy + +# More options +entropy -h +entropy -top 20 -ext go,py,js +entropy -top 5 -ignore-ext min.js,_test.go,pdf,png,jpg my-folder my-file1 my-file2 +``` ### With docker