|
| 1 | +FROM centos:centos8 |
| 2 | + |
| 3 | +# Update CentOS 8 repositories (CentOS 8 is EOL, use vault) |
| 4 | +RUN cd /etc/yum.repos.d/ && \ |
| 5 | + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \ |
| 6 | + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* |
| 7 | + |
| 8 | +# Update system |
| 9 | +RUN yum update -y |
| 10 | + |
| 11 | +# Install base development tools and dependencies |
| 12 | +RUN yum install -y \ |
| 13 | + gcc \ |
| 14 | + clang \ |
| 15 | + llvm \ |
| 16 | + elfutils-libelf-devel \ |
| 17 | + kernel-devel \ |
| 18 | + kernel-headers \ |
| 19 | + make \ |
| 20 | + iproute \ |
| 21 | + iputils \ |
| 22 | + git \ |
| 23 | + vim-enhanced \ |
| 24 | + which \ |
| 25 | + python3-pip \ |
| 26 | + cmake \ |
| 27 | + llvm-devel \ |
| 28 | + clang-devel \ |
| 29 | + gcc-toolset-11 \ |
| 30 | + jq \ |
| 31 | + time |
| 32 | + |
| 33 | +# Install Development Tools group |
| 34 | +RUN dnf group install -y "Development Tools" |
| 35 | + |
| 36 | +# Set up working directory |
| 37 | +WORKDIR /opt |
| 38 | + |
| 39 | +# Build and install bpftool and libbpf |
| 40 | +RUN . /opt/rh/gcc-toolset-11/enable && \ |
| 41 | + git clone --recurse-submodules https://github.com/libbpf/bpftool.git && \ |
| 42 | + cd bpftool && \ |
| 43 | + git checkout tags/v7.5.0 && \ |
| 44 | + cd libbpf && \ |
| 45 | + git checkout tags/v1.5.0 && \ |
| 46 | + cd /opt/bpftool/libbpf/src && \ |
| 47 | + make -j && \ |
| 48 | + make install && \ |
| 49 | + cd /opt/bpftool/src && \ |
| 50 | + make -j && \ |
| 51 | + make install |
| 52 | + |
| 53 | +# Build and install yaml-cpp |
| 54 | +RUN . /opt/rh/gcc-toolset-11/enable && \ |
| 55 | + git clone https://github.com/jbeder/yaml-cpp.git && \ |
| 56 | + cd yaml-cpp && \ |
| 57 | + git checkout tags/yaml-cpp-0.7.0 && \ |
| 58 | + mkdir build && \ |
| 59 | + cd build && \ |
| 60 | + cmake -DYAML_BUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF .. && \ |
| 61 | + make -j && \ |
| 62 | + make install |
| 63 | + |
| 64 | +# Build and install json-c |
| 65 | +RUN . /opt/rh/gcc-toolset-11/enable && \ |
| 66 | + git clone https://github.com/json-c/json-c.git && \ |
| 67 | + cd json-c && \ |
| 68 | + git checkout tags/json-c-0.15-20200726 && \ |
| 69 | + mkdir build && \ |
| 70 | + cd build && \ |
| 71 | + cmake .. && \ |
| 72 | + make -j && \ |
| 73 | + make install |
| 74 | + |
| 75 | +# Update library path |
| 76 | +RUN echo "/usr/local/lib64" > /etc/ld.so.conf.d/local.conf && \ |
| 77 | + echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf && \ |
| 78 | + ldconfig |
| 79 | + |
| 80 | +# Create datacrumbs directory |
| 81 | +WORKDIR /opt/datacrumbs |
| 82 | + |
| 83 | +# Set environment variables |
| 84 | +ENV PATH="/opt/rh/gcc-toolset-11/root/usr/bin:${PATH}" |
| 85 | +ENV LD_LIBRARY_PATH="/opt/rh/gcc-toolset-11/root/usr/lib64:/usr/local/lib64:/usr/local/lib:${LD_LIBRARY_PATH}" |
| 86 | + |
| 87 | +# Create entrypoint script |
| 88 | +RUN echo '#!/bin/bash' > /entrypoint.sh && \ |
| 89 | + echo '. /opt/rh/gcc-toolset-11/enable' >> /entrypoint.sh && \ |
| 90 | + echo 'exec "$@"' >> /entrypoint.sh && \ |
| 91 | + chmod +x /entrypoint.sh |
| 92 | + |
| 93 | +# Set the entrypoint |
| 94 | +ENTRYPOINT ["/entrypoint.sh"] |
| 95 | + |
| 96 | +# By default, run bash |
| 97 | +CMD ["/bin/bash"] |
| 98 | + |
| 99 | +# Add labels for better container management |
| 100 | +LABEL maintainer="DataCrumbs Team" |
| 101 | +LABEL description="DataCrumbs eBPF-based data provenance tracking system" |
| 102 | +LABEL version="1.0" |
0 commit comments