-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathDockerfile.manager
47 lines (33 loc) · 1.41 KB
/
Dockerfile.manager
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
41
42
43
44
45
46
47
FROM golang:1.21.8-bullseye AS build
RUN apt-get update && apt-get install -y tzdata ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
ENV XDG_CACHE_HOME="/tmp"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && chmod +x rustup.sh &&./rustup.sh -y
ENV PATH="/root/.cargo/bin:$PATH"
WORKDIR /build/
COPY . /build/
# make configurable filecoin-ffi build
ARG FFI_BUILD_FROM_SOURCE=0
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
ARG FFI_USE_BLST_PORTABLE=0
ENV FFI_USE_BLST_PORTABLE=${FFI_USE_BLST_PORTABLE}
RUN make dist-clean
ARG RUSTFLAGS=""
ARG GOFLAGS=""
RUN make build-manager
FROM ubuntu:20.04
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /lib/*/libdl.so.2 /lib/
COPY --from=build /lib/*/librt.so.1 /lib/
COPY --from=build /lib/*/libgcc_s.so.1 /lib/
COPY --from=build /lib/*/libutil.so.1 /lib/
COPY --from=build /usr/lib/*/libltdl.so.7 /lib/
COPY --from=build /usr/lib/*/libnuma.so.1 /lib/
COPY --from=build /usr/lib/*/libhwloc.so.15 /lib/
COPY --from=build /usr/lib/*/libOpenCL.so.1 /lib/
RUN mkdir -p /etc/OpenCL/vendors \
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# copy the binary from build
COPY --from=build /build/dist/bin/damocles-manager /damocles-manager
EXPOSE 1789
ENTRYPOINT ["/damocles-manager"]