From 244824de85d9a791207e0906df444e9bdfb243ec Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Wed, 11 Mar 2026 14:54:06 +0100 Subject: [PATCH] add dockerfile/composefile/targets for externally built fail --- Makefile | 13 +++++- docker-compose-env.yaml | 29 +++++++++++++ docker-compose.yaml | 3 +- fail-base.dockerfile | 6 ++- fail-env.dockerfile | 94 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 docker-compose-env.yaml create mode 100644 fail-env.dockerfile diff --git a/Makefile b/Makefile index ccaed4d6..741d8e62 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,20 @@ docker: docker build -t gitea.vps.chriphost.de/christoph/fail-generic-tracing:latest -f fail-generic-tracing.dockerfile . docker build -t gitea.vps.chriphost.de/christoph/fail-demo:latest -f fail-demo.dockerfile . --build-arg CACHE_DATE="$(shell date)" +docker-env: + docker build -t gitea.vps.chriphost.de/christoph/fail-env:latest -f fail-env.dockerfile . + run: - docker compose up -d --force-recreate --renew-anon-volumes -y + docker compose -f docker-compose.yaml up -d --force-recreate --renew-anon-volumes -y + +run-env: + docker compose -f docker-compose-env.yaml up -d --force-recreate --renew-anon-volumes -y stop: - docker compose down + docker compose -f docker-compose.yaml down + +stop-env: + docker compose -f docker-compose-env.yaml down ssh: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 5022 fail@127.0.0.1 diff --git a/docker-compose-env.yaml b/docker-compose-env.yaml new file mode 100644 index 00000000..48a75f63 --- /dev/null +++ b/docker-compose-env.yaml @@ -0,0 +1,29 @@ +services: + fail-db: + image: mysql + container_name: fail-db + environment: + MYSQL_ROOT_PASSWORD: fail + MYSQL_USER: fail + MYSQL_PASSWORD: fail + MYSQL_DATABASE: fail + ports: + - "3306:3306" + networks: + - fail-network + + fail-env: + image: gitea.vps.chriphost.de/christoph/fail-env:latest + container_name: fail-env + ports: + - "5000:5000" # Result Browser + - "5022:22" # SSH + networks: + - fail-network + volumes: + - "../3 Wasm:/home/fail/build" + - "../8 FailMars:/home/fail/mars" + +networks: + fail-network: + driver: bridge diff --git a/docker-compose.yaml b/docker-compose.yaml index 133b2bf5..441f9399 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -21,7 +21,8 @@ services: networks: - fail-network volumes: - - "../3 Wasm:/home/fail/fail-wasm-root" + - "../3 Wasm:/home/fail/build" + - "../8 FailMars:/home/fail/mars" networks: fail-network: diff --git a/fail-base.dockerfile b/fail-base.dockerfile index ec107f80..7691c080 100644 --- a/fail-base.dockerfile +++ b/fail-base.dockerfile @@ -49,7 +49,8 @@ RUN git clone https://github.com/llvm/llvm-project.git && cd llvm-project \ && cd / && rm -rf ./llvm-project # Install packages required to build FAIL* -RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \ +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \ # binutils-dev \ libmysqlclient-dev \ libprotobuf-dev \ @@ -79,7 +80,8 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-inst libasound2-dev # Install packages required to run FAIL* -RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \ +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \ protobuf-compiler \ libtinfo6 \ # libtinfo5 \ diff --git a/fail-env.dockerfile b/fail-env.dockerfile new file mode 100644 index 00000000..e45945ee --- /dev/null +++ b/fail-env.dockerfile @@ -0,0 +1,94 @@ +FROM ubuntu:noble + +# Install basic packages +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + cmake-curses-gui \ + wget \ + git \ + doxygen \ + screen \ + openssh-server \ + neovim \ + ranger \ + # binutils-dev \ + libmysqlclient-dev \ + libcapstone4 \ + libprotobuf-dev \ + libtinfo-dev \ + # libpcl1-dev \ + libdwarf-dev \ + libelf-dev \ + libiberty-dev \ + libboost-thread1.74-dev \ + libboost-system1.74-dev \ + libboost-regex1.74-dev \ + libboost-coroutine1.74-dev \ + libboost-context1.74-dev \ + libfontconfig1-dev \ + zlib1g-dev \ + libz3-dev \ + libsdl1.2-dev \ + # libsdl2-dev \ + libgtk2.0-dev \ + # libgtk-3-dev \ + # libwxbase3.0-dev \ + # libwxgtk3.0-gtk3-dev \ + libncurses-dev \ + # libncurses5-dev \ + libx11-dev \ + xorg-dev \ + libasound2-dev \ + protobuf-compiler \ + libtinfo6 \ + # libtinfo5 \ + libmariadb3 \ + libprotobuf32t64 \ + libncurses6 \ + grub-common \ + xorriso \ + grub-pc-bin \ + mysql-client \ + unzip \ + bochs \ + python3-setuptools \ + python3-flask \ + python3-mysqldb \ + python3-yaml + +RUN wget -O "libpcl1.deb" "http://archive.ubuntu.com/ubuntu/pool/universe/libp/libpcl1/libpcl1_1.12-2_amd64.deb" \ + && dpkg -i "libpcl1.deb" \ + && rm -f "libpcl1.deb" + +# Fix shebangs +RUN ln -sf /usr/bin/python3 /usr/bin/python + +# Add a user for compiling FAIL* +RUN useradd fail \ + && mkdir /home/fail && chown fail /home/fail \ + && echo 'fail:fail' | chpasswd && chsh fail --shell /bin/bash \ + && adduser fail sudo + +# SSH login fix. Otherwise user is kicked off after login +RUN mkdir /var/run/sshd \ + && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd + +ENV NOTVISIBLE="in users profile" +RUN echo "export VISIBLE=now" >> /etc/profile + +USER fail +ENV HOME=/home/fail +WORKDIR /home/fail + +USER root + +# Password for MySQL Daemon +ADD my.cnf /home/fail/.my.cnf +RUN chown fail /home/fail/.my.cnf + +# Accept SSH connections +EXPOSE 22 +CMD ["/usr/sbin/sshd", "-D"]