-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into distributed-post-v…
…erification
- Loading branch information
Showing
4 changed files
with
185 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Docker Build and Push | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: spacemeshos/postcli:latest, spacemeshos/postcli:${{ GITHUB.SHA }}, spacemeshos/postcli:${{ github.ref_name }} |
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,46 @@ | ||
FROM golang:1.21 as builder | ||
RUN set -ex \ | ||
&& apt-get update --fix-missing \ | ||
&& apt-get install -qy --no-install-recommends \ | ||
unzip sudo \ | ||
ocl-icd-opencl-dev | ||
|
||
WORKDIR /src | ||
COPY Makefile* . | ||
RUN make get-postrs-lib | ||
|
||
# We want to populate the module cache based on the go.{mod,sum} files. | ||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN go mod download | ||
|
||
# Here we copy the rest of the source code | ||
COPY . . | ||
|
||
# And compile the project | ||
RUN --mount=type=cache,id=build,target=/root/.cache/go-build make build | ||
|
||
FROM ubuntu:22.04 AS postcli | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV SHELL /bin/bash | ||
USER root | ||
RUN set -ex \ | ||
&& apt-get update --fix-missing \ | ||
&& apt-get install -qy --no-install-recommends \ | ||
locales \ | ||
ocl-icd-libopencl1 clinfo \ | ||
pocl-opencl-icd libpocl2 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& update-locale LANG=en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US.UTF-8 | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
# Finally we copy the statically compiled Go binary. | ||
COPY --from=builder /src/build/postcli /bin/ | ||
COPY --from=builder /src/build/libpost.so /bin/ | ||
|
||
ENTRYPOINT ["/bin/postcli"] |
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
Oops, something went wrong.