-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 865 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 865 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
FROM golang:1.26.0 AS build
ARG TARGETARCH
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY script/ script/
COPY . .
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
gcc-aarch64-linux-gnu \
&& rm -rf /var/lib/apt/lists/*
ENV VENDOR_DIR=/opt
ENV TARGETOS=linux
RUN script/vendor-onnxruntime
ENV ONNX_DIR=/opt/onnxruntime
ENV OUTPUT=/build/snips.sh
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
export CC=aarch64-linux-gnu-gcc; \
fi && \
script/build
FROM gcr.io/distroless/cc-debian12
COPY --from=build /opt/onnxruntime/lib /opt/onnxruntime/lib
COPY --from=build /build/snips.sh /usr/bin/snips.sh
ENV LD_LIBRARY_PATH=/opt/onnxruntime/lib
ENV SNIPS_HTTP_INTERNAL=http://0.0.0.0:8080
ENV SNIPS_SSH_INTERNAL=ssh://0.0.0.0:2222
EXPOSE 8080 2222
ENTRYPOINT ["/usr/bin/snips.sh"]