Last active
October 23, 2024 08:55
-
-
Save Akanoa/042d5125cd5c112edd1983d13dd462cc to your computer and use it in GitHub Desktop.
FoundationDB simulation image compatible with devcontainers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM foundationdb/build:centos7-20240830040217-57ee4b82e7 | |
ARG FDB_VERSION=7.3.43 | |
ARG RUST_VERSION=1.82.0 | |
RUN yum update -y && \ | |
yum install -y gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel ncurses-devel nss-devel bison | |
COPY scripts/install_glibc.sh /root/. | |
RUN /root/install_glibc.sh "2.18" | |
RUN /root/install_glibc.sh "2.22" | |
RUN /root/install_glibc.sh "2.25" | |
RUN rm /var/lib/rpm/__db.* && \ | |
cd /var/cache/yum && \ | |
rm -fr * && \ | |
yum clean all && \ | |
yum update && \ | |
yum groupinstall -y 'Development Tools' | |
RUN yum install -y python3 bison make gcc | |
COPY scripts/install_gcc.sh /root/. | |
RUN /root/install_gcc.sh | |
COPY scripts/install_make.sh /root/. | |
RUN /root/install_make.sh | |
COPY scripts/install_glibc2.28.sh /root/. | |
COPY patches/patch_nss_test2.diff /root/. | |
RUN /root/install_glibc2.28.sh | |
RUN pushd /tmp && \ | |
wget -q "https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-clients-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
rpm -i "/tmp/foundationdb-clients-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
rm "/tmp/foundationdb-clients-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
popd | |
RUN pushd /tmp && \ | |
wget -q "https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/foundationdb-server-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
rpm -i "/tmp/foundationdb-server-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
rm "/tmp/foundationdb-server-${FDB_VERSION}-1.el7.x86_64.rpm" && \ | |
popd | |
RUN /root/.cargo/bin/rustup upgrade && \ | |
/root/.cargo/bin/rustup default "${RUST_VERSION}" && \ | |
/root/.cargo/bin/rustup component add rustfmt && \ | |
/root/.cargo/bin/rustup component add clippy \ | |
ENV PATH="$PATH:/root/.cargo/bin" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pushd /opt | |
GCC_VERSION=9.2.0 | |
wget https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz | |
tar xzvf gcc-${GCC_VERSION}.tar.gz | |
mkdir obj.gcc-${GCC_VERSION} | |
cd gcc-${GCC_VERSION} | |
./contrib/download_prerequisites | |
cd ../obj.gcc-${GCC_VERSION} | |
../gcc-${GCC_VERSION}/configure --disable-multilib --enable-languages=c,c++ | |
make -j 16 | |
make install | |
popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
set -e | |
pushd /opt | |
GLIBC_VERSION=$1 | |
# GNU="https://ftp.gnu.org/gnu" | |
GNU_MIRROR="https://mirrors.aliyun.com/gnu" | |
wget ${GNU_MIRROR}/glibc/glibc-${GLIBC_VERSION}.tar.xz | |
tar -xf glibc-${GLIBC_VERSION}.tar.xz | |
cd glibc-${GLIBC_VERSION} | |
mkdir build | |
cd build | |
../configure --prefix=/usr --with-headers=/usr/include --with-binutils=/usr/bin --disable-profile --enable-add-ons | |
../configure --prefix=/usr \ | |
--with-headers=/usr/include \ | |
--with-binutils=/usr/bin \ | |
--enable-add-ons \ | |
--enable-obsolete-nsl \ | |
--disable-profile \ | |
--disable-sanity-checks \ | |
--disable-werror | |
make -j16 | |
make DESTDIR=/tmp/stage install | |
make install | |
popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
set -e | |
make --version | |
pushd /opt | |
GLIBC_VERSION=2.28 | |
# GNU="https://ftp.gnu.org/gnu" | |
GNU_MIRROR="https://mirrors.aliyun.com/gnu" | |
wget ${GNU_MIRROR}/glibc/glibc-${GLIBC_VERSION}.tar.xz | |
tar -xf glibc-${GLIBC_VERSION}.tar.xz | |
cd glibc-${GLIBC_VERSION} | |
mkdir build | |
cd build | |
../configure --prefix=/usr --with-headers=/usr/include --with-binutils=/usr/bin --disable-profile --enable-add-ons | |
../configure --prefix=/usr \ | |
--with-headers=/usr/include \ | |
--with-binutils=/usr/bin \ | |
--enable-add-ons \ | |
--enable-obsolete-nsl \ | |
--disable-profile \ | |
--disable-sanity-checks \ | |
--disable-werror | |
make -j16 | |
make DESTDIR=/tmp/stage install | |
pushd .. | |
cp /root/patch_nss_test2.diff . | |
# path test installations | |
# https://sourceware.org/bugzilla/attachment.cgi?id=10318&action=diff#a/scripts/test-installation.pl_sec1 | |
patch -p1 < patch_nss_test2.diff | |
popd | |
make install -j16 | |
popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pushd /opt | |
curl http://ftp.gnu.org/gnu/make/make-4.3.tar.gz > /opt/make-4.3.tar.gz | |
tar -zxvf make-4.3.tar.gz | |
cd make-4.3 | |
./configure --prefix=/usr | |
make -j16 | |
make install | |
popd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl | |
index b2e4ba7..2b70f11 100755 | |
--- a/scripts/test-installation.pl | |
+++ b/scripts/test-installation.pl | |
@@ -125,7 +125,7 @@ while (<SOVERSIONS>) { | |
next if ($build_mathvec == 0 && $name eq "mvec"); | |
if ($name ne "nss_ldap" && $name ne "db1" | |
&& $name ne "thread_db" | |
- && $name ne "nss_test1" && $name ne "libgcc_s") { | |
+ && $name ne "nss_test1" && $name ne "nss_test2" && $name ne "libgcc_s") { | |
$link_libs .= " -l$name"; | |
$versions{$name} = $version; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment