Skip to content

Commit 36f421c

Browse files
committed
Add example Earthfile
1 parent c1a1994 commit 36f421c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Earthfile.example

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
VERSION 0.6
2+
3+
ARG GO_VERSION=1.20
4+
ARG GOLINT_VERSION=1.47.3
5+
6+
go-deps:
7+
ARG GO_VERSION
8+
FROM golang:$GO_VERSION
9+
WORKDIR /build
10+
COPY go.mod go.sum ./
11+
RUN go mod download
12+
RUN apt-get update
13+
SAVE ARTIFACT go.mod AS LOCAL go.mod
14+
SAVE ARTIFACT go.sum AS LOCAL go.sum
15+
16+
build:
17+
FROM +go-deps
18+
COPY . .
19+
COPY +libwhisper/whisper.cpp /whisper.cpp
20+
RUN C_INCLUDE_PATH=/whisper.cpp LIBRARY_PATH=/whisper.cpp go build ./
21+
SAVE ARTIFACT out AS LOCAL out
22+
23+
libwhisper:
24+
FROM +go-deps
25+
WORKDIR /build
26+
RUN git clone https://github.com/ggerganov/whisper.cpp.git
27+
RUN cd whisper.cpp && make libwhisper.a
28+
SAVE ARTIFACT whisper.cpp AS LOCAL whisper
29+
30+
image:
31+
FROM +go-deps
32+
RUN apt-get install -y ffmpeg bash wget
33+
COPY +libwhisper/whisper.cpp /whisper
34+
ARG MODEL=small
35+
RUN /whisper/models/download-ggml-model.sh $MODEL

0 commit comments

Comments
 (0)