# Dockerfile to build NetNewsWire from source (macOS project) in a Linux container.
# This environment cannot produce a macOS/macOS-like build using Xcode, but this
# container exposes the repository and provides a generic Linux build setup to host
# Linux build tools and any cross-platform steps you provide.
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install common build tools. Linux builds for a macOS project are not supported here,
# but this provides a consistent, reproducible environment to host the source.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
pkg-config \
python3 \
unzip \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# Optionally install Swift tooling in case a Linux-based Swift build is attempted later
# (not required for macOS Xcode projects, but helpful for cross-platform steps).
RUN apt-get update \
&& apt-get install -y --no-install-recommends swift \
&& rm -rf /var/lib/apt/lists/*
# Copy the repository
WORKDIR /src
COPY . /src
# Try common Linux-based build steps if present. These are no-ops for macOS/Xcode projects
# but allow the container to participate in workflows that expect a build step.
RUN if [ -f ./setup.sh ]; then \
chmod +x ./setup.sh && ./setup.sh; \
fi
RUN if [ -f ./build.sh ]; then \
chmod +x ./build.sh && ./build.sh; \
fi
# If a Makefile exists, build with make
RUN if [ -f Makefile ]; then make -j$(nproc); fi
# Final image to run the code in a minimal environment
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
bash \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY --from=builder /src /src
# Default command
CMD ["bash"]
# .dockerignore .git node_modules build dist *.log *.tmp .DS_Store
Concerns: Building a macOS/Xcode project (NetNewsWire) from Linux in this Dockerfile is not feasible; Linux build steps rely on user-provided scripts and will not produce a macOS app by default., The final image primarily copies the source tree; without a successful Linux-based build or explicit artifacts, it may not produce a runnable application., If the repository lacks setup.sh, build.sh, or a Makefile, no build will occur and the container will simply provide the source. Smoke [PASS]: test -d /src && ls -la /src | head -n 20 Smoke [PASS]: if [ -f /src/setup.sh ]; then echo 'setup.sh exists'; fi Smoke [PASS]: if [ -f /src/build.sh ]; then echo 'build.sh exists'; fi; if [ -f /src/Makefile ]; then echo 'Makefile exists'; fi