Skip to content

Commit 5bfe33c

Browse files
authored
Update sqlite and ssl (#90)
* Update sqlite and ssl * don't need to specify libssl3 * Update to alpine 3.21 which uses openssl 3 * Remove python 3.8 * Try to compile and use openssl 3.0.15 * Fixup typo * Add in CONFIGURE_OPTS * pyenv build adjustments * Some more updates * handle either lib or lib64? * force openssl to use lib dir to simplify pyenv build * remove unneeded items from openssl * Adjust some more config options based on documentation * Try qemu-cache-optional for riscv * Switch back to main
1 parent 20d4f8b commit 5bfe33c

File tree

7 files changed

+57
-50
lines changed

7 files changed

+57
-50
lines changed

.github/workflows/build-ubuntu-22.04-risc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
build:
2525
uses: Chia-Network/actions/.github/workflows/docker-build.yaml@main
2626
with:
27+
enable-qemu-cache: false
2728
alternate-latest-mode: true
2829
runs-on: k8s-public
2930
timeout-minutes: 240

alpine/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.16.2
1+
FROM alpine:3.21
22
WORKDIR /root
33

44
# Set environment variables for rust and pyenv
@@ -7,21 +7,15 @@ ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
77
ENV PATH="/root/.cargo/bin:${PATH}"
88
ENV RUST_BACKTRACE=1
99

10-
RUN sh -c "echo https://mirrors.edge.kernel.org/alpine/v3.16.2/community >> /etc/apk/repositories"
11-
RUN apk add bash git curl python3 openssl openssl-dev perl linux-headers make gcc musl-dev patch patchelf
10+
RUN apk add bash git curl python3 openssl openssl-dev perl linux-headers make gcc musl-dev patch patchelf py3-pip
1211
# Additional pyenv dependencies
1312
RUN apk add --no-cache build-base libffi-dev bzip2-dev zlib-dev xz-dev readline-dev sqlite-dev tk-dev
1413

1514
# Install Rust
1615
RUN curl --proto '=https' --tlsv1.2 -sSf -o rustup https://sh.rustup.rs
1716
RUN sh ./rustup -y
1817

19-
# Build a copy of openssl - needed for the rust-openssl crate
20-
COPY build-openssl.sh .
21-
RUN sh ./build-openssl.sh
22-
2318
RUN curl https://pyenv.run | bash && \
24-
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.8 && \
2519
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.9 && \
2620
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.10 && \
2721
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --skip-existing 3.11 && \

alpine/build-openssl.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

rocky8/Dockerfile

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,39 @@ RUN yum -y groupinstall "Development Tools" && \
1717

1818
# Compile newer version of sqlite3
1919
RUN cd ~ && \
20-
wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \
21-
tar -xzf sqlite-autoconf-3400100.tar.gz && \
22-
cd sqlite-autoconf-3400100 && \
20+
wget -q https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz && \
21+
tar -xzf sqlite-autoconf-3450100.tar.gz && \
22+
cd sqlite-autoconf-3450100 && \
2323
CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/usr/sqlite3 && \
2424
make && \
2525
make install && \
2626
cd ~ && \
2727
rm -rf ~/sqlite-autoconf*
2828

29+
# Compile newer version of openssl \
30+
RUN cd ~ && \
31+
yum -y install perl-IPC-Cmd perl-Pod-Html && \
32+
wget -q https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz && \
33+
tar -xzf openssl-3.0.15.tar.gz && \
34+
cd openssl-3.0.15 && \
35+
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl --libdir=lib no-ssl3 no-idea no-dtls no-srp no-comp shared && \
36+
make && \
37+
make install && \
38+
cd ~ && \
39+
rm -rf ~/openssl-3.0.15*
40+
2941
# Compile newer version of python3
30-
RUN yum -y install openssl openssl-devel zlib-devel bzip2 bzip2-devel readline-devel tk-devel libffi-devel xz-devel && \
42+
RUN yum -y install zlib-devel bzip2 bzip2-devel readline-devel tk-devel libffi-devel xz-devel && \
3143
cd ~ && \
3244
# Set up pyenv \
45+
export PYTHON_CONFIGURE_OPTS="--with-openssl=/usr/local/ssl --with-openssl-rpath=auto --enable-shared --enable-optimizations" && \
3346
git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
34-
pyenv install 3.10 && \
35-
pyenv global 3.10 && \
47+
pyenv install 3.11 --verbose && \
48+
pyenv global 3.11 && \
3649
pip install --upgrade pip && \
3750
pip install --no-cache-dir py3createtorrent awscli && \
38-
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.40.1")' && \
51+
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.45.1")' && \
52+
python3 -c 'import sys; import ssl; sys.exit(ssl.OPENSSL_VERSION_INFO != (3,0,0,15,0))' && \
3953
yum clean all
4054

4155
# Add nodejs

ubuntu-20.04/Dockerfile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,42 @@ RUN apt-get update && \
4242
vim \
4343
wget \
4444
xz-utils \
45-
zlib1g-dev && \
45+
zlib1g-dev \
46+
checkinstall && \
4647
rm -rf /var/lib/apt/lists/*
4748

4849
# Compile newer version of sqlite3 \
4950
RUN cd ~ && \
50-
wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \
51-
tar -xzf sqlite-autoconf-3400100.tar.gz && \
52-
cd sqlite-autoconf-3400100 && \
51+
wget -q https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz && \
52+
tar -xzf sqlite-autoconf-3450100.tar.gz && \
53+
cd sqlite-autoconf-3450100 && \
5354
CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/usr && \
5455
make && \
5556
make install && \
5657
cd ~ && \
5758
rm -rf ~/sqlite-autoconf*
5859

60+
# Compile newer version of openssl \
61+
RUN cd ~ && \
62+
wget -q https://github.com/openssl/openssl/releases/download/openssl-3.0.15/openssl-3.0.15.tar.gz && \
63+
tar -xzf openssl-3.0.15.tar.gz && \
64+
cd openssl-3.0.15 && \
65+
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl --libdir=lib no-ssl3 no-idea no-dtls no-srp no-comp shared && \
66+
make && \
67+
make install && \
68+
cd ~ && \
69+
rm -rf ~/openssl-3.0.15*
70+
5971
# Set up pyenv \
6072
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
61-
pyenv install 3.10 && \
62-
pyenv global 3.10 && \
73+
export PYTHON_CONFIGURE_OPTS="--with-openssl=/usr/local/ssl --with-openssl-rpath=auto --enable-shared --enable-optimizations" && \
74+
pyenv install 3.11 --verbose && \
75+
pyenv global 3.11 && \
6376
pip install --upgrade pip && \
6477
pip install --no-cache-dir py3createtorrent && \
65-
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.40.1")'
78+
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.45.1")' && \
79+
python3 -c 'import sys; import ssl; sys.exit(ssl.OPENSSL_VERSION_INFO != (3,0,0,15,0))'
80+
6681

6782
# Add nodejs
6883
ENV NODE_MAJOR=18

ubuntu-22.04-risc/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ RUN curl -L -O https://ftpmirror.gnu.org/gnu/binutils/binutils-2.38.tar.gz && \
1818

1919
FROM base AS sqlite
2020

21-
RUN curl -L -O https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \
22-
tar -xvzf sqlite-autoconf-3400100.tar.gz && \
23-
cd sqlite-autoconf-3400100 && \
21+
RUN curl -L -O https://sqlite.org/2024/sqlite-autoconf-3450100.tar.gz && \
22+
tar -xvzf sqlite-autoconf-3450100.tar.gz && \
23+
cd sqlite-autoconf-3450100 && \
2424
CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/opt/sqlite3 && \
2525
make && \
2626
make install && \
@@ -46,16 +46,14 @@ ARG PYTHON_CONFIGURE_OPTS="--enable-shared"
4646
ARG LDFLAGS="-Wl,-rpath,/opt/sqlite3/lib -L/opt/sqlite3/lib -lsqlite3"
4747
ARG CPPFLAGS="-I/opt/sqlite3/include"
4848

49-
RUN pyenv install 3.8
5049
RUN pyenv install 3.9
5150
RUN pyenv install 3.10
5251
RUN pyenv install 3.11
5352
RUN pyenv install 3.12
5453

55-
RUN pyenv global 3.12 3.11 3.10 3.9 3.8
54+
RUN pyenv global 3.12 3.11 3.10 3.9
5655

5756
# make sure sqlite is loaded from the expected path
58-
RUN ldd $(python3.8 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/
5957
RUN ldd $(python3.9 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/
6058
RUN ldd $(python3.10 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/
6159
RUN ldd $(python3.11 -c 'import _sqlite3; print(_sqlite3.__file__)') | grep /opt/sqlite3/lib/

ubuntu-22.04/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ RUN apt-get update && \
4747

4848
# Compile newer version of sqlite3 \
4949
RUN cd ~ && \
50-
wget -q https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \
51-
tar -xzf sqlite-autoconf-3400100.tar.gz && \
52-
cd sqlite-autoconf-3400100 && \
50+
wget -q https://sqlite.org/2024/sqlite-autoconf-3450100.tar.gz && \
51+
tar -xzf sqlite-autoconf-3450100.tar.gz && \
52+
cd sqlite-autoconf-3450100 && \
5353
CFLAGS="-DSQLITE_MAX_VARIABLE_NUMBER=500000" ./configure --prefix=/usr && \
5454
make && \
5555
make install && \
@@ -58,11 +58,12 @@ RUN cd ~ && \
5858

5959
# Set up pyenv
6060
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
61-
pyenv install 3.10 && \
62-
pyenv global 3.10 && \
61+
export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-optimizations" && \
62+
pyenv install 3.11 --verbose && \
63+
pyenv global 3.11 && \
6364
pip install --upgrade pip && \
6465
pip install --no-cache-dir py3createtorrent && \
65-
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.40.1")'
66+
python3 -c 'import sys; import sqlite3; sys.exit(sqlite3.sqlite_version != "3.45.1")'
6667

6768
# Add nodejs
6869
ENV NODE_MAJOR=18

0 commit comments

Comments
 (0)