You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.5 KiB
50 lines
1.5 KiB
# Alternative Dockerfile using debootstrap approach |
|
# This version uses a more modern base and cross-compiles for legacy compatibility |
|
|
|
FROM debian:oldstable AS builder |
|
|
|
# Install build dependencies |
|
RUN apt-get update && apt-get install -y \ |
|
wget \ |
|
rpm2cpio \ |
|
cpio \ |
|
build-essential \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
# Create workspace |
|
WORKDIR /build |
|
|
|
# Download and extract CentOS 3.9 libstdc++.5 and essential libraries |
|
RUN mkdir -p rpms && cd rpms && \ |
|
wget -q https://archive.kernel.org/centos-vault/3.9/os/i386/RedHat/RPMS/compat-libstdc++-7.3-2.96.122.i386.rpm && \ |
|
wget -q https://archive.kernel.org/centos-vault/3.9/os/i386/RedHat/RPMS/libstdc++-3.2.3-47.3.i386.rpm |
|
|
|
# Extract libraries |
|
RUN cd rpms && \ |
|
for rpm in *.rpm; do rpm2cpio "$rpm" | cpio -idmv; done |
|
|
|
# Final stage - minimal runtime |
|
FROM debian:oldstable-slim |
|
|
|
# Install minimal GCC toolchain compatible with old C++ libraries |
|
RUN apt-get update && apt-get install -y \ |
|
gcc-10 \ |
|
g++-10 \ |
|
make \ |
|
autoconf \ |
|
automake \ |
|
libtool \ |
|
m4 \ |
|
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ |
|
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
# Copy extracted libstdc++.5 from builder |
|
COPY --from=builder /build/rpms/usr/lib/libstdc++.so.5* /usr/lib/i386-linux-gnu/ |
|
|
|
# Set up PFEXTLIB directory |
|
WORKDIR /usr/local/PFEXTLIB-1.2 |
|
ENV PREFIX=/usr/local/PFEXTLIB-1.2 |
|
ENV LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu:$LD_LIBRARY_PATH |
|
|
|
CMD ["/bin/bash"]
|
|
|