FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    build-essential \
    python3 \
    python3-pip \
    gdb \
    && rm -rf /var/lib/apt/lists/*

RUN pip3 install pwntools

WORKDIR /challenge

COPY ecu_sim.c Makefile ./
COPY flag.txt /flag.txt

RUN make

RUN chmod 444 /flag.txt

EXPOSE 18088

CMD ["/challenge/ecu_sim"]
