1
+ #########################################################################################
2
+ FROM golang:1.20-bullseye as builder
3
+
4
+ RUN apt update && apt install -y \
5
+ build-essential \
6
+ bzr pkg-config \
7
+ clang \
8
+ curl \
9
+ gcc git \
10
+ hwloc \
11
+ jq \
12
+ libhwloc-dev wget \
13
+ mesa-opencl-icd \
14
+ ocl-icd-opencl-dev
15
+
16
+ WORKDIR /go/src/
17
+
18
+ COPY Makefile /go/src/
19
+ ### make configurable filecoin-ffi build
20
+ ARG FFI_BUILD_FROM_SOURCE=0
21
+ ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
22
+ ##############################################
23
+ # prebuild filecoin-ffi
24
+ COPY extern /go/src/extern
25
+ COPY build /go/src/build
26
+ COPY .git/modules/extern/filecoin-ffi /go/src/.git/modules/extern/filecoin-ffi
27
+
28
+ RUN make build/.filecoin-install
29
+ ##############################################
30
+ COPY . /go/src
31
+ ##############################################
32
+
33
+ RUN --mount=type=cache,target=/root/.cache/go-build \
34
+ --mount=type=cache,target=/go/pkg/mod \
35
+ make boost
36
+ #########################################################################################
37
+ FROM ubuntu:20.04 as runner
38
+
39
+ RUN apt update && apt install -y \
40
+ curl \
41
+ hwloc \
42
+ jq
43
+
44
+ ## Fix missing lib libhwloc.so.5
45
+ RUN ls -1 /lib/*/libhwloc.so.* | head -n 1 | xargs -n1 -I {} ln -s {} /lib/libhwloc.so.5
46
+
47
+ WORKDIR /app
48
+
49
+ #########################################################################################
50
+ FROM runner as boost-main
51
+
52
+ ARG BUILD_VERSION=0.1
53
+
54
+ LABEL org.opencontainers.image.version=$BUILD_VERSION \
55
+ org.opencontainers.image.authors="Boost Dev Team" \
56
+ name="boost-client" \
57
+ maintainer="Boost Dev Team" \
58
+ vendor="Boost Dev Team" \
59
+ version=$BUILD_VERSION \
60
+ release=$BUILD_VERSION \
61
+ summary="This image is used to host the boost-dev storage provider" \
62
+ description="This image is used to host the boost-dev storage provider"
63
+
64
+ ENV BOOST_PATH /var/lib/boost
65
+ VOLUME /var/lib/boost
66
+ EXPOSE 8080
67
+
68
+ COPY --from=builder /go/src/boost /usr/local/bin/
69
+ COPY docker/boost-client/entrypoint.sh /app/
70
+
71
+ ENTRYPOINT ["./entrypoint.sh"]
0 commit comments