Skip to content

Commit 8818d91

Browse files
Alvin ReyesLexLuthr
andauthored
feat: add docker to containerize a standalone boost-client (#1616)
* feat: add docker to containerize a standalone boost-client * chore: cleaned up mainnet docker build * Update docker/boost-client/Dockerfile.source thank you! Co-authored-by: LexLuthr <[email protected]> * modified based on review/feedback * use make boost instead --------- Co-authored-by: LexLuthr <[email protected]>
1 parent f164ad4 commit 8818d91

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ docker/lotus-all-in-one: info/lotus-all-in-one | $(lotus_src_dir)
250250
-t $(lotus_base_image) --build-arg GOFLAGS=-tags=debug .
251251
.PHONY: docker/lotus-all-in-one
252252

253+
# boost-client main
254+
docker/mainnet/boost-client: build/.update-modules
255+
DOCKER_BUILDKIT=1 $(docker_build_cmd) \
256+
-t $(docker_user)/boost-main:main --build-arg BUILD_VERSION=dev \
257+
-f docker/boost-client/Dockerfile.source --target boost-main .
258+
.PHONY: docker/mainnet/boost-client
259+
253260
### devnet images
254261
docker/%:
255262
cd docker/devnet/$* && DOCKER_BUILDKIT=1 $(docker_build_cmd) -t $(docker_user)/$*-dev:dev \

docker/boost-client/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DOCKER_USER=filecoin
2+
BOOST_IMAGE=${DOCKER_USER}/boost-main:main
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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"]

docker/boost-client/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
boost -v

0 commit comments

Comments
 (0)