Files
swift-dev-container/Dockerfile
Michael Housh 125209a99b
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 13m54s
feat: Adds swift backtrace build arg, defaults to disabling which currently prints a bunch of memory warnings.
2025-12-01 13:12:05 -05:00

47 lines
1.1 KiB
Docker

ARG SWIFT_VERSION="swift:latest"
ARG SWIFT_BACKTRACE="enable=no"
FROM docker.io/${SWIFT_VERSION} AS build
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y \
cmake \
rustup \
&& rm -rf /var/lib/apt/lists/*
RUN rustup default stable && \
cargo install --git https://github.com/MordechaiHadad/bob.git && \
/root/.cargo/bin/bob install nightly && \
/root/.cargo/bin/bob use nightly
FROM docker.io/${SWIFT_VERSION}
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y \
cmake \
curl \
git \
tree-sitter-cli \
wget \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /root/.cargo/bin/bob /root/bin/bob
COPY --from=build /root/.local/share/bob /root/.local/share/bob
RUN cat >> /root/.bashrc <<EOF
PATH="/root/bin:/root/.local/share/bob/nvim-bin:$PATH"
alias n='nvim'
EOF
ENV SWIFT_BACKTRACE=${SWIFT_BACKTRACE}
WORKDIR /root/dev
VOLUME /root/dev
CMD [ "/bin/bash", "-c", "/root/.local/share/bob/nvim-bin/nvim" ]