Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,31 @@ env:
jobs:
build-and-push:
name: Build and Push Docker Images
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
target:
- blacklight_node
- keeper
arch:
- amd64
- arm64
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-latest
- arch: arm64
platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -63,18 +68,18 @@ jobs:
type=sha,prefix=sha-
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image (${{ matrix.target }})
- name: Build and push docker image
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
target: ${{ matrix.target }}
file: ./docker/${{ matrix.target }}.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.target }}
cache-to: type=gha,mode=max,scope=${{ matrix.target }}
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
build-args: |
BLACKLIGHT_VERSION=${{ steps.version.outputs.version }}
provenance: false
27 changes: 27 additions & 0 deletions docker/blacklight_node.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM rust:1.91-alpine AS builder

ARG BLACKLIGHT_VERSION

WORKDIR /app

RUN apk add --no-cache musl-dev git pkgconf openssl-dev

# Copy project files
COPY Cargo.toml ./
COPY crates ./crates
COPY nilcc-simulator ./nilcc-simulator
COPY keeper ./keeper
COPY blacklight-node ./blacklight-node
COPY monitor ./monitor

RUN BLACKLIGHT_VERSION="${BLACKLIGHT_VERSION}" RUSTFLAGS="-Ctarget-feature=-crt-static" cargo build --release --bin blacklight-node && \
mkdir -p /out/bin && \
mv target/release/blacklight-node /out/bin/

FROM alpine

RUN apk add libgcc openssl
WORKDIR /app

COPY --from=builder /out/bin/blacklight-node /usr/local/bin/blacklight-node
ENTRYPOINT ["/usr/local/bin/blacklight-node"]
26 changes: 26 additions & 0 deletions docker/keeper.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM rust:1.91-alpine AS builder

WORKDIR /app

RUN apk add --no-cache musl-dev git pkgconf openssl-dev

# Copy project files
COPY Cargo.toml ./
COPY crates ./crates
COPY nilcc-simulator ./nilcc-simulator
COPY keeper ./keeper
COPY blacklight-node ./blacklight-node
COPY monitor ./monitor

RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo build --release --bin keeper && \
mkdir -p /out/bin && \
mv target/release/keeper /out/bin/

FROM alpine

RUN apk add libgcc openssl
WORKDIR /app

COPY --from=builder /out/bin/keeper /usr/local/bin/keeper
ENTRYPOINT ["/usr/local/bin/keeper"]