diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..24ab96737 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM golang:1.20-alpine3.17 as builder +RUN apk add --no-cache gcc musl-dev git build-base pkgconfig libsodium-dev + +ENV GOOS=linux + +WORKDIR /etc/ente/ + +COPY go.mod . +COPY go.sum . +RUN go mod download + +COPY . . +RUN --mount=type=cache,target=/root/.cache/go-build \ + go build -o ente-cli main.go + +FROM alpine:3.17 +RUN apk add libsodium-dev +COPY --from=builder /etc/ente/ente-cli . +#COPY configurations configurations +#COPY migrations migrations +#COPY mail-templates mail-templates + +ARG GIT_COMMIT +ENV GIT_COMMIT=$GIT_COMMIT + +CMD ["./ente-cli"] diff --git a/README.md b/README.md index 8d2e1b7bf..b0fe07ad5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # cli tool for exporting ente photos +### Getting Started + +#### Accounts + +* Add an account + ```shell + ente-cli account add + ``` + +* List accounts + ```shell + ente-cli account list + ``` + + + ## Testing Run the release script to build the binary and run it. @@ -18,17 +34,13 @@ or you can run the following command ./bin/ente-cli --help ``` -### Getting Started - -#### Accounts - -* Add an account - ```shell - ente-cli account add - ``` - -* List accounts - ```shell - ente-cli account list - ``` +## Docker + Build the docker image + ```shell + docker build -t ente-cli:latest . + ``` + Run the commands using: + ```shell + docker run -it --rm ente-cli:latest ./ente-cli --help + ```