-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DOCKER_USER=filecoin | ||
BOOST_IMAGE=${DOCKER_USER}/boost-main:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
######################################################################################### | ||
FROM golang:1.20-bullseye as builder | ||
|
||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
bzr pkg-config \ | ||
clang \ | ||
curl \ | ||
gcc git \ | ||
hwloc \ | ||
jq \ | ||
libhwloc-dev wget \ | ||
mesa-opencl-icd \ | ||
ocl-icd-opencl-dev | ||
|
||
WORKDIR /go/src/ | ||
|
||
COPY Makefile /go/src/ | ||
### make configurable filecoin-ffi build | ||
ARG FFI_BUILD_FROM_SOURCE=0 | ||
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} | ||
############################################## | ||
# prebuild filecoin-ffi | ||
COPY extern /go/src/extern | ||
COPY build /go/src/build | ||
COPY .git/modules/extern/filecoin-ffi /go/src/.git/modules/extern/filecoin-ffi | ||
|
||
RUN make build/.filecoin-install | ||
############################################## | ||
COPY . /go/src | ||
############################################## | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
make boost | ||
######################################################################################### | ||
FROM ubuntu:20.04 as runner | ||
|
||
RUN apt update && apt install -y \ | ||
curl \ | ||
hwloc \ | ||
jq | ||
|
||
## Fix missing lib libhwloc.so.5 | ||
RUN ls -1 /lib/*/libhwloc.so.* | head -n 1 | xargs -n1 -I {} ln -s {} /lib/libhwloc.so.5 | ||
|
||
WORKDIR /app | ||
|
||
######################################################################################### | ||
FROM runner as boost-main | ||
|
||
ARG BUILD_VERSION=0.1 | ||
|
||
LABEL org.opencontainers.image.version=$BUILD_VERSION \ | ||
org.opencontainers.image.authors="Boost Dev Team" \ | ||
name="boost-client" \ | ||
maintainer="Boost Dev Team" \ | ||
vendor="Boost Dev Team" \ | ||
version=$BUILD_VERSION \ | ||
release=$BUILD_VERSION \ | ||
summary="This image is used to host the boost-dev storage provider" \ | ||
description="This image is used to host the boost-dev storage provider" | ||
|
||
ENV BOOST_PATH /var/lib/boost | ||
VOLUME /var/lib/boost | ||
EXPOSE 8080 | ||
|
||
COPY --from=builder /go/src/boost /usr/local/bin/ | ||
COPY docker/boost-client/entrypoint.sh /app/ | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
boost -v |