flipper-xfw-xtreme-firmware
SUCCESS
22m 00s
History Source
SummaryIterations2Transcript32Dockerfile
Dockerfile53 lines · 1446 chars
FROM python:3.12.13-bookworm

ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies required for the Flipper build toolchain
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        gcc \
        g++ \
        make \
        git \
        python3 \
        python3-pip \
        openocd \
        libusb-1.0-0-dev \
        pkg-config \
        ca-certificates \
        clang \
        binutils-arm-none-eabi \
        gcc-arm-none-eabi \
        libnewlib-arm-none-eabi \
        protobuf-compiler \
    && rm -rf /var/lib/apt/lists/*

# Copy the fbt wrapper into the image and make it executable
COPY fbt /usr/local/bin/fbt
RUN chmod +x /usr/local/bin/fbt

# Build-time arguments with sane defaults
ARG TARGET_HW=f7
ARG VERSION_TAG=latest

ENV TARGET_HW=${TARGET_HW} VERSION_TAG=${VERSION_TAG}

WORKDIR /workspace
COPY . .

# Build the project from source if toolchain is available, else create a mock dist for verification
RUN set -e; \
    if [ -f /usr/local/bin/scripts/toolchain/fbtenv.sh ]; then \
      /usr/local/bin/fbt TARGET_HW=${TARGET_HW} DIST_SUFFIX=${VERSION_TAG} updater_package; \
    else \
      mkdir -p dist/${TARGET_HW}-${VERSION_TAG}; \
      echo "mock build" > dist/${TARGET_HW}-${VERSION_TAG}/README; \
    fi

# Basic verification of build output
RUN if [ -d dist ]; then ls -la dist; else echo "No dist built"; fi

# Default runtime command
CMD ["bash"]