-
Notifications
You must be signed in to change notification settings - Fork 76
feat: add docker to containerize a standalone boost-client #1616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4e29546
feat: add docker to containerize a standalone boost-client
alvin-reyes ce86f16
chore: cleaned up mainnet docker build
alvin-reyes 55b7d77
Update docker/boost-client/Dockerfile.source
df03d6c
modified based on review/feedback
alvin-reyes 177088e
Merge branch 'main' of https://github.com/alvin-reyes/boost
alvin-reyes 3eb89e7
use make boost instead
alvin-reyes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||
alvin-reyes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| set -e | ||
| boost -v | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.