From 55786ff7e2a2ddb37fd1bcf76c0dac65eff861df Mon Sep 17 00:00:00 2001 From: yourmoonlight Date: Thu, 22 Aug 2024 20:57:26 +0800 Subject: [PATCH] install SQLite 3.46.1 in the dockerfile (#2489) * install SQLite 3.46.1 in the dockerfile * install SQLite 3.46.1 in the dockerfile both main and debug --- docker/Dockerfile | 38 ++++++++++++++++++++++++++++++++------ docker/DockerfileDebug | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f1ee8fe5e6..ef97027212 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,14 +17,27 @@ RUN set -eux; \ g++ \ cmake \ make \ - libsqlite3-dev \ libprotobuf-dev \ - protobuf-compiler; \ + protobuf-compiler \ + build-essential \ + libreadline-dev; \ rm -rf /var/lib/apt/lists/* +# Install SQLite 3.46.1 with multi-threading enabled +RUN set -eux; \ + wget https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz; \ + tar xvf sqlite-autoconf-3460100.tar.gz; \ + cd sqlite-autoconf-3460100; \ + CFLAGS="-DSQLITE_THREADSAFE=2" ./configure --prefix=/usr/local; \ + make; \ + make install; \ + cd ..; \ + rm -rf sqlite-autoconf-3460100 sqlite-autoconf-3460100.tar.gz; \ + ldconfig + ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ + PATH=/usr/local/cargo/bin:/usr/local/bin:$PATH \ RUSTUP_VERSION=1.26.0 \ RUSTUP_SHA256=0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db \ RUST_ARCH=x86_64-unknown-linux-gnu @@ -58,11 +71,24 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ ca-certificates \ - libsqlite3-dev \ wget \ - libssl-dev; \ + libssl-dev \ + build-essential \ + libreadline-dev; \ rm -rf /var/lib/apt/lists/* +# Install SQLite 3.46.1 with multi-threading enabled +RUN set -eux; \ + wget https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz; \ + tar xvf sqlite-autoconf-3460100.tar.gz; \ + cd sqlite-autoconf-3460100; \ + CFLAGS="-DSQLITE_THREADSAFE=2" ./configure --prefix=/usr/local; \ + make; \ + make install; \ + cd ..; \ + rm -rf sqlite-autoconf-3460100 sqlite-autoconf-3460100.tar.gz; \ + ldconfig + RUN set -eux; \ wget "http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb"; \ DEBIAN_FRONTEND=noninteractive dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; @@ -74,4 +100,4 @@ COPY --from=builder $RELEASE_PATH/rooch-faucet \ /rooch-faucet/ ENTRYPOINT [ "/rooch/rooch" ] -CMD [ "server", "start" ] +CMD [ "server", "start" ] \ No newline at end of file diff --git a/docker/DockerfileDebug b/docker/DockerfileDebug index 40df92076b..355bba3096 100644 --- a/docker/DockerfileDebug +++ b/docker/DockerfileDebug @@ -17,11 +17,24 @@ RUN set -eux; \ g++ \ cmake \ make \ - libsqlite3-dev \ libprotobuf-dev \ - protobuf-compiler; \ + protobuf-compiler \ + build-essential \ + libreadline-dev; \ rm -rf /var/lib/apt/lists/* +# Install SQLite 3.46.1 with multi-threading enabled +RUN set -eux; \ + wget https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz; \ + tar xvf sqlite-autoconf-3460100.tar.gz; \ + cd sqlite-autoconf-3460100; \ + CFLAGS="-DSQLITE_THREADSAFE=2" ./configure --prefix=/usr/local; \ + make; \ + make install; \ + cd ..; \ + rm -rf sqlite-autoconf-3460100 sqlite-autoconf-3460100.tar.gz; \ + ldconfig + ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ @@ -58,11 +71,24 @@ RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ ca-certificates \ - libsqlite3-dev \ wget \ - libssl-dev; \ + libssl-dev \ + build-essential \ + libreadline-dev; \ rm -rf /var/lib/apt/lists/* +# Install SQLite 3.46.1 with multi-threading enabled +RUN set -eux; \ + wget https://www.sqlite.org/2024/sqlite-autoconf-3460100.tar.gz; \ + tar xvf sqlite-autoconf-3460100.tar.gz; \ + cd sqlite-autoconf-3460100; \ + CFLAGS="-DSQLITE_THREADSAFE=2" ./configure --prefix=/usr/local; \ + make; \ + make install; \ + cd ..; \ + rm -rf sqlite-autoconf-3460100 sqlite-autoconf-3460100.tar.gz; \ + ldconfig + RUN set -eux; \ wget "http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb"; \ DEBIAN_FRONTEND=noninteractive dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; @@ -74,4 +100,4 @@ COPY --from=builder $RELEASE_PATH/rooch-faucet \ /rooch-faucet/ ENTRYPOINT [ "/rooch/rooch" ] -CMD [ "server", "start" ] +CMD [ "server", "start" ] \ No newline at end of file