Feat: Dockerize tokei (#930)

* Dockerize tokei

* Update README.md with how to run tokei docker

* Simplify compiler flags

* Remove superfluous dependency to libgcc

* Use Earthfile instead of Dockerfile

* Remove superfluous referencing of build step

This is not needed because it is implied.

Co-authored-by: XAMPPRocky <[email protected]>

---------

Co-authored-by: XAMPPRocky <[email protected]>
This commit is contained in:
Mihai Galos
2023-07-05 11:36:22 +02:00
committed by GitHub
co-authored by XAMPPRocky
parent 7b86e23bc9
commit d5e820ade1
2 changed files with 40 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
VERSION 0.6
FROM alpine:3.14
WORKDIR /src
build:
FROM rust:alpine3.14
RUN apk update \
&& apk add \
git \
gcc \
g++ \
pkgconfig
COPY . /src
WORKDIR /src
RUN cargo build --release
SAVE ARTIFACT /src/target/release/tokei AS LOCAL ./tokei
docker:
COPY +build/tokei /usr/local/bin/
WORKDIR /src
ENTRYPOINT [ "tokei" ]
CMD [ "--help" ]
SAVE IMAGE tokei
+16
View File
@@ -297,6 +297,22 @@ Example show total lines:
The server code hosted on tokei.rs is in [XAMPPRocky/tokei_rs](https://github.com/XAMPPRocky/tokei_rs)
## Dockerized version
Tokei is available in a small `alpine`-based docker image, buildable through:
```bash
earthly +docker
```
Once built, one can run the image with:
```bash
docker run --rm -v /path/to/analyze:/src tokei .
```
Or, to simply analyze the current folder (linux):
```bash
docker run --rm -v $(pwd):/src tokei .
```
## Supported Languages
If there is a language that you would to add to tokei feel free to make a pull