From 170f62a78788be44e8da1c5e0098cd86fc1e9006 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sat, 23 Dec 2023 02:31:29 +0800 Subject: [PATCH] dockerfiles: add freighter for Rust crates.io --- dockerfiles/freighter/Dockerfile | 14 +++ dockerfiles/freighter/config.toml | 159 ++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 dockerfiles/freighter/Dockerfile create mode 100644 dockerfiles/freighter/config.toml diff --git a/dockerfiles/freighter/Dockerfile b/dockerfiles/freighter/Dockerfile new file mode 100644 index 0000000..5c5f81a --- /dev/null +++ b/dockerfiles/freighter/Dockerfile @@ -0,0 +1,14 @@ +FROM rust:bookworm +MAINTAINER Aron Xu + +RUN set -e; \ + git clone --depth=1 https://github.com/open-rust-initiative/freighter; \ + cd freighter; \ + cargo build --release; \ + mkdir -p /root/freighter; \ + cp /freighter/target/release/freighter /usr/local/bin/ + +#COPY dockerfiles/freighter/config.toml /root/freighter/ + +WORKDIR /root/freighter +CMD /bin/bash diff --git a/dockerfiles/freighter/config.toml b/dockerfiles/freighter/config.toml new file mode 100644 index 0000000..a16ef67 --- /dev/null +++ b/dockerfiles/freighter/config.toml @@ -0,0 +1,159 @@ +[log] +# log format encoder, see https://docs.rs/log4rs/1.2.0/log4rs/append/file/struct.FileAppenderDeserializer.html#configuration +# for more information +encoder = "{d}:{l} - {m}{n}" + +# log level +level = "info" + +# will delete and regenerate log file if exceeded the limit, unit is MB +limit = 100 + + +[crates] +# download index from domain +index_domain = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" + +# download crates from domain +domain = "https://static.crates.io/crates" + +# Number of crates download threads +download_threads = 16 + +# A list of domains that provide service in order +# localhost means read from filesystem +# It is better to add s3 domain at the first line +serve_domains = [ + "localhost", + # "https://static.crates.io", +] + +#(optional) set up a git local path you want to serve +#serve_index = "/opt/rust/" + +[rustup] +# download rustup from domain +domain = "https://static.rust-lang.org" + +# Number of rust toolchain download threads +download_threads = 16 + +# stable versions that you want to sync with +sync_stable_versions = [ + "1.9", + "1.10", + "1.11", + "1.12", + "1.12.1", + "1.13", + "1.14", + "1.15", + "1.15.1", + "1.16", + "1.17", + "1.18", + "1.19", + "1.20", + "1.21", + "1.22", + "1.22.1", + "1.23", + "1.24", + "1.24.1", + "1.25", + "1.26", + "1.26.1", + "1.26.2", + "1.27", + "1.27.1", + "1.27.2", + "1.28", + "1.29", + "1.29.1", + "1.29.2", + "1.30", + "1.30.1", + "1.31", + "1.31.1", + "1.32", + "1.33", + "1.34", + "1.34.1", + "1.34.2", + "1.35", + "1.36", + "1.37", + "1.38", + "1.39", + "1.40", + "1.41", + "1.41.1", + "1.42", + "1.43", + "1.43.1", + "1.44", + "1.44.1", + "1.45", + "1.45.1", + "1.45.2", + "1.46", + "1.47", + "1.48", + "1.49", + "1.50", + "1.51", + "1.52", + "1.52.1", + "1.53", + "1.54", + "1.55", + "1.56", + "1.56.1", + "1.57", + "1.58", + "1.58.1", + "1.59", + "1.60", + "1.61", + "1.62", + "1.62.1", + "1.63", + "1.64", + "1.65", + "1.66", + "1.66.1", + "1.67", + "1.67.1", + "1.68", + "1.68.1", + "1.68.2", + "1.69", + "1.70" +] + +# days you want to keep for historical nightly version +sync_nightly_days = 30 + +# days you want to keep for historical beta version +sync_beta_days = 30 + +# A list of domains that provide service in order +# localhost means read from filesystem +serve_domains = [ + "localhost", + # "https://static.rust-lang.org", +] + +# (optional) set this value to sync historical nightly and beta version +history_version_start_date = "2016-03-01" + + +[proxy] +# use true flag to enable proxy +enable = false + +# used for git index proxy +git_index_proxy = "http://127.0.0.1:6780" + +# used for crates and toolchain download proxy +download_proxy = "http://127.0.0.1:6780"