FROM debian:bookworm-slim
ARG PTY_AGENT_VERSION=
ARG PTY_AGENT_INSTALL_SOURCE=crates
ENV CARGO_HOME=/usr/local/cargo
ENV RUSTUP_HOME=/usr/local/rustup
ENV PATH=/usr/local/cargo/bin:/usr/bin:/bin
ENV SHELL=/bin/bash
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
build-essential \
ca-certificates \
clang \
cmake \
curl \
git \
libssl-dev \
pkg-config \
vim-tiny \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal --default-toolchain stable
WORKDIR /workspace
RUN mkdir -p /workspace
RUN if [ "$PTY_AGENT_INSTALL_SOURCE" = "crates" ]; then \
if [ -n "$PTY_AGENT_VERSION" ]; then \
cargo install pty-agent --version "$PTY_AGENT_VERSION"; \
else \
cargo install pty-agent; \
fi; \
fi
CMD ["pty-agent", "--help"]