82 lines
1.9 KiB
Docker
82 lines
1.9 KiB
Docker
# Dockerfile for Debian build environment
|
|
# Automates all setup steps from the build-debian workflow job
|
|
#
|
|
# Usage:
|
|
# docker build -f scripts/docker/Dockerfile.debian -t android-file-handler-debian-builder .
|
|
# docker run -v $(pwd):/workspace -w /workspace android-file-handler-debian-builder
|
|
|
|
# Use Debian 13 "Trixie" (latest stable release)
|
|
FROM debian:13
|
|
|
|
# Set build argument for fpm version (can be overridden at build time)
|
|
ARG FPM_VERSION=1.16.0
|
|
|
|
# Install system dependencies including Python build dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
curl \
|
|
git \
|
|
build-essential \
|
|
ruby \
|
|
ruby-dev \
|
|
gcc \
|
|
make \
|
|
zlib1g-dev \
|
|
ca-certificates \
|
|
tcl8.6 \
|
|
tk8.6 \
|
|
tcl8.6-dev \
|
|
tk8.6-dev \
|
|
libx11-6 \
|
|
libxext6 \
|
|
libxrender1 \
|
|
libxcb1 \
|
|
libbz2-dev \
|
|
libreadline-dev \
|
|
libsqlite3-dev \
|
|
libssl-dev \
|
|
libffi-dev \
|
|
wget \
|
|
tar \
|
|
liblzma-dev \
|
|
patch && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install pyenv
|
|
ENV PYENV_ROOT="/root/.pyenv"
|
|
ENV PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv
|
|
|
|
# Install Python 3.12 via pyenv
|
|
RUN eval "$(pyenv init -)" && \
|
|
pyenv install 3.12.0 && \
|
|
pyenv global 3.12.0 && \
|
|
pyenv rehash
|
|
|
|
# Update PATH to include pyenv shims
|
|
ENV PATH="/root/.pyenv/shims:$PATH"
|
|
|
|
# Install Poetry
|
|
RUN curl -sSL https://install.python-poetry.org | python3 - --yes
|
|
|
|
# Add Poetry to PATH
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
|
|
# Verify Poetry installation
|
|
RUN poetry --version
|
|
|
|
# Install fpm
|
|
RUN gem install --no-document -v "${FPM_VERSION}" fpm
|
|
|
|
# Set working directory
|
|
WORKDIR /workspace
|
|
|
|
# Set environment variables for build
|
|
ENV CI_CD=true
|
|
ENV DISTRO_TYPE=debian
|
|
|
|
# Default command runs the build script
|
|
CMD ["sh", "-c", "poetry install --no-interaction && poetry run python scripts/build_package_linux.py"]
|