Files
Riccardo Schirone 5cfa9bd26e Add support for ARM (#207)
* Fix integration-test run

* use the proper oss-fuzz-aixcc commit to run integration-test
* determine OSS_FUZZ_CONTAINER_ORG at runtime
* use `git diff` in the patcher to create the patch to fix a problem
  with patches affecting non-newline terminated files

* fix parsing

* fix program-model lint

* Modify CRS to work on MacOS/ARM

* Use LibUCL for testing

* use example-libpng

* fix linting

* common: fix tests
2025-07-31 09:55:36 -04:00

52 lines
1.8 KiB
Docker

ARG BASE_IMAGE=ubuntu:24.04
FROM $BASE_IMAGE AS base
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get install -y python3.10 curl
RUN curl -fsSL https://get.docker.com | sh
FROM base AS builder
COPY --from=ghcr.io/astral-sh/uv:0.5.20 /uv /uvx /bin/
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.10
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=common/uv.lock,target=/common/uv.lock \
--mount=type=bind,source=common/pyproject.toml,target=/common/pyproject.toml \
--mount=type=bind,source=common/README.md,target=/common/README.md \
--mount=type=bind,source=program-model/uv.lock,target=/app/uv.lock \
--mount=type=bind,source=program-model/pyproject.toml,target=/app/pyproject.toml \
--mount=type=bind,source=program-model/README.md,target=/app/README.md \
cd /app && uv sync --frozen --no-install-project --no-editable
COPY ./common /common
COPY ./program-model /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-editable
FROM base AS cscope-builder
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y autoconf gcc make bison flex libncurses-dev
COPY external/aixcc-cscope /cscope
RUN cd /cscope && autoreconf -i -s && ./configure && make && make install
FROM base AS runtime
WORKDIR /app
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y codequery libncurses-dev git && \
rm -rf /var/lib/apt/lists/*
COPY --from=cscope-builder /usr/local/bin/cscope /usr/local/bin/cscope
COPY --from=builder --chown=app:app /app/.venv /app/.venv
COPY common/container-entrypoint.sh /container-entrypoint.sh
ENV PATH=/app/.venv/bin:$PATH
ENTRYPOINT ["/container-entrypoint.sh"]