forked from temperley-systems/swift-arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (20 loc) · 838 Bytes
/
Dockerfile
File metadata and controls
24 lines (20 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Swift base image
FROM swift:6.0-slim
# Create working directory
WORKDIR /app
# Install build dependencies (for building flatc from source)
RUN apt-get update && \
apt-get install -y cmake make g++ git curl unzip && \
rm -rf /var/lib/apt/lists/*
# Build FlatBuffers from source (ARM-compatible)
ENV FLATBUFFERS_VERSION=25.9.23
RUN git clone --depth 1 --branch v${FLATBUFFERS_VERSION} https://github.com/google/flatbuffers.git && \
cd flatbuffers && \
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release . && \
make -j$(nproc) && \
mv flatc /usr/local/bin/flatc && \
cd .. && rm -rf flatbuffers
# Default entrypoint: generate Swift bindings from any mounted .fbs files
# Usage: container run -v "$(pwd)":/src flatc-swift
ENTRYPOINT ["/usr/local/bin/flatc", "--swift", "-o", "/src/Generated"]
WORKDIR /src