Skip to content
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

RTI dockerfile support for multi-architecture builds #464

Merged
merged 5 commits into from
Aug 2, 2024
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
20 changes: 18 additions & 2 deletions .github/workflows/build-rti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@ on:
workflow_call:

jobs:
run:
native-build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Check out reactor-c repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build the RTI with AUTH=OFF
run: .github/scripts/build-rti.sh -DAUTH=OFF
- name: Build the RTI with AUTH=ON
run: .github/scripts/build-rti.sh -DAUTH=ON

docker-build:
runs-on: ubuntu-latest
steps:
- name: Check out reactor-c repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
file: ./core/federated/RTI/rti.Dockerfile
context: .
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64
push: false
tags: lflang/rti:latest
17 changes: 13 additions & 4 deletions core/federated/RTI/rti.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Docker file for building the image of the rti
FROM alpine:latest
ARG BASEIMAGE=alpine:latest
FROM ${BASEIMAGE} as builder
COPY . /lingua-franca
WORKDIR /lingua-franca/core/federated/RTI
RUN set -ex && apk add --no-cache gcc musl-dev cmake make && \
Expand All @@ -9,5 +9,14 @@ RUN set -ex && apk add --no-cache gcc musl-dev cmake make && \
make && \
make install

# Use ENTRYPOINT not CMD so that command-line arguments go through
ENTRYPOINT ["RTI"]
WORKDIR /lingua-franca

# application stage
FROM ${BASEIMAGE} as app
LABEL maintainer="lf-lang"
LABEL source="https://github.com/lf-lang/reactor-c/tree/main/core/federated/RTI"
COPY --from=builder /usr/local/bin/RTI /usr/local/bin/RTI

WORKDIR /lingua-franca

ENTRYPOINT ["/usr/local/bin/RTI"]
Loading