33import os
44from urllib import request
55
6- RUST_VERSION = '1.71.1'
7- RUSTUP_VERSION = '1.26.0'
6+ RUST_VERSION = '1.71.1'
7+ RUSTUP_VERSION = '1.26.0'
8+ OPENSSL_VERSION = '3.1.3'
89
910RUST_ARCH = 'x86_64-unknown-linux-gnu'
1011
@@ -21,6 +22,11 @@ def fetch_rustup_hash():
2122 with request .urlopen (url ) as f :
2223 return f .read ().decode ('utf-8' ).split ()[0 ]
2324
25+ def fetch_openssl_hash ():
26+ url = f'https://www.openssl.org/source/openssl-{ OPENSSL_VERSION } .tar.gz.sha256'
27+ with request .urlopen (url ) as f :
28+ return f .read ().decode ('utf-8' ).split ()[0 ]
29+
2430
2531def load_template (dist ):
2632 with open (f'templates/{ dist } .Dockerfile' , 'r' ) as f :
@@ -35,20 +41,23 @@ def save_dockerfile(dist, contents):
3541 f .write (contents )
3642
3743
38- def generate_dockerfile (dist , rustup_sha256 ):
44+ def generate_dockerfile (dist , rustup_sha256 , openssl_sha256 ):
3945 template = load_template (dist )
4046 rendered = template \
4147 .replace ('%%RUST_VERSION%%' , RUST_VERSION ) \
4248 .replace ('%%RUSTUP_VERSION%%' , RUSTUP_VERSION ) \
4349 .replace ('%%RUSTUP_SHA256%%' , rustup_sha256 ) \
44- .replace ('%%RUST_ARCH%%' , RUST_ARCH )
50+ .replace ('%%RUST_ARCH%%' , RUST_ARCH ) \
51+ .replace ('%%OPENSSL_VERSION%%' , OPENSSL_VERSION ) \
52+ .replace ('%%OPENSSL_SHA256%%' , openssl_sha256 )
4553 save_dockerfile (dist , rendered )
4654
4755
4856def main ():
4957 rustup_sha256 = fetch_rustup_hash ()
58+ openssl_sha256 = fetch_openssl_hash ()
5059 for dist in DISTRIBUTIONS :
51- generate_dockerfile (dist , rustup_sha256 )
60+ generate_dockerfile (dist , rustup_sha256 , openssl_sha256 )
5261
5362
5463if __name__ == '__main__' :
0 commit comments