-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata-loader.Dockerfile
29 lines (22 loc) · 1.09 KB
/
data-loader.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.23 as builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -ldflags "-s -w" -a -o data-loader ./cmd/data-loader
FROM python:3.12
RUN pip install --no-cache-dir "huggingface_hub[cli]"==0.24.6 modelscope==1.18.1 setuptools && \
rclone_version=v1.65.0 && \
arch=$(uname -m | sed -E 's/x86_64/amd64/g;s/aarch64/arm64/g') && \
filename=rclone-${rclone_version}-linux-${arch} && \
wget https://github.com/rclone/rclone/releases/download/${rclone_version}/${filename}.zip -O ${filename}.zip && \
unzip ${filename}.zip && mv ${filename}/rclone /usr/local/bin && rm -rf ${filename} ${filename}.zip
COPY --from=builder /workspace/data-loader /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/data-loader"]