From d93e0d26491f9eb1e11337008ba709783a4b40ed Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 26 Aug 2023 23:36:43 -0400 Subject: [PATCH 1/2] Add Dockerfile for tarp alpine image --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7c97283 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM golang:1.21-alpine + +WORKDIR /src +# RUN apt update && apt install libzmq3-dev libczmq-dev -y +RUN apk add --no-cache libzmq czmq-dev git build-base +RUN git clone https://github.com/tmbdev/tarp.git +WORKDIR /src/tarp/tarp +RUN go clean +RUN go mod tidy +RUN go get -u +RUN CGO_ENABLED=1 go build -o tarp *.go +RUN cp tarp /bin + +FROM alpine:latest + +COPY --from=0 /bin/tarp /bin/tarp +RUN apk add --no-cache libzmq czmq-dev git +CMD ["/bin/tarp"] \ No newline at end of file From d44123923f2b06ddc1ce7b99201063e8417ab601 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 26 Aug 2023 23:39:47 -0400 Subject: [PATCH 2/2] Update README.md with docker instructions --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index eb8cd40..46d9683 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ Alternatively, you can also install from a local clone: make bin/tarp sudo make install +You can also use it from a docker image: +```bash +docker build -t tarp . +docker run tarp +``` + # Examples Download a dataset from Google Cloud, shuffle it, and split it into shards containing