diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000..e91ffe2 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,3 @@ +Pull requests are welcome for the translation are welcome. + + diff --git a/README.md b/README.md index 7641b4a..37c2e2a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,302 @@ +[中文版本](README-zh.md) + +# Release Log + +## Release-v0.1.0 +* Finish basic functionalities of scripts. +* Finish README.md of English version. + # docker-script -Some scipts for creating and configuring dockers +Some scripts for creating and configuring dockers. + +Usually, as a server manager, you need create a new docker for someone and configure the docker (e.g., install `oepnssh-server`, configure `sshd`, update the password of `root`, etc.). This can be annoying, if a lot of persons let you create new dockers for them. But, don't worry, this script will help you create a docker and configure it automatically. + +# How to Use This? +This part is for the server managers, if you are a user of the new docker, you can jump to [here](#something-for-docker-users). + +## Basic Usages +In general, mostly, you just need create a new docker with or with no `gpu`, so the simple way to use it is: + +```bash +# create a new docker with all gpus and configure the docker automatically +bash create_docker.sh -n -p + +# create a new docker with no gpu and configure the docker automatically +bash create_docker.sh -n -p -w 0 +``` + +The first command will create a docker with all gpus, then configure the docker automatically. The creation is same with `docker run -dit --name --publish --gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all ubuntu:latest` (as you can see, the command for creating a new docker with all gpus is extremely long). In the creation command, the default distro is `ubuntu:latest`, you can use `-d` or `--distro` to specify the distro. After creation the script will copy `./docker_initializer` (the scripts for configuring a new docker) to `new_docker_name:/`, you can use `-f` or `--file` to specify which file or directory you want to copy, but you usually don't need use this. The copy is same with `docker cp ./docker_initializer :/`. After copy, the scripts for configuring a new docker will be executed in the new docker. This process is done by `docker exec -it bash -c "cd /docker_initializer && bash installer.sh $password"` (the variable password is to determine whether or not to configure the password of user `root`, the default value is `1`, you can use `--password 0` when running `create_docker.sh`), As you can see configure process is done by `bash -c "cd /docker_initializer && bash installer.sh $password"`, so this process will only done the `-f` or `--file`'s value is same with the default value, and if it is not, the command will be run `docker exec -it bash` (enter the docker with `bash`). + +In the three processes above, if any one fails, the script will stop, so you can see what wrong with it. Besides, before executing any command before, the script will print what will be executed so that you can check if the command is what you want, once you finish the check, you can press `` or `y` (press the enter key directly or input `y` then press enter key), it is worth mentioning that the `y` you input must be a lowercase one. + +## Advanced Usages +Maybe when you create a new docker you want to mount some directories, you can use `-v` or `--volume` to do this. + +All the options you can use: + +``` +Usage: + bash create_docker.sh [options]|- + ./create_docker.sh [options] + +Options: + -n, --name: same with the --name of docker, required. + + -p, --publish: same with the --publish of docker. + + -P, --publish-all: same with the --publish-all of docker + + -w, --with-gpu: 0 or 1, whether or not to enable gpu, the default value is 1. + + -g, --gpus: same with the --gpus of docker, when gpu is enabled, the default value is +: 'all'. When gpu is disabled, the default value is empty. + + -e, --env: same with the --env of docker, when gpu is enabled, the default value is +: 'NVIDIA_DRIVER_CAPABILITIES=compute,utility NVIDIA_VISIBLE_DEVICES=all', +: you can use more than one -e to specify more than one environment +: variable. When gpu is disabled, the default value is empty. + + -d, --distro: the ditro, the default value is 'ubuntu:latest'. + + -v, --volume: same with --volume of docker, the default value is empty. + + -f, --file: a file or a directory will be copied into the new docker. The default +: value is './docker_initializer'. If you don't want to copy files into the +: docker, you can input 'n' when confirming the command. If you want copy +: more than one file, you need put all the files into a directory, then use +: '-f dir' to copy the whole directory. + + -a, --auto-install: whether or not to install automatically, the default value is 1. When +: enabled, this will install some basic tools rather than just enter the +: new docker. + + --password: whether or not to add a password for the root user, the default value is +: 1. When enabled, this will add password for the root user until success. + + -h, --help: print the manual page. + +Example: + $0 --name newdocker --publish 7777:22 --with-gpu 1 --gpus all -e \\ + NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all ubuntu:latest + + $0 -n newdocker -p 7777:22 + + $0 --name newdocker --publish 7777:22 --with-gpu 0 --distro ubuntu:latest --file \\ + ./docker_initializer + + $0 -n newdocker -p 7777:22 -w 0 + +Note: + The second example will acts same as the first one does. + The fourth example will acts same as the third one does. + If you want to pass more than one argument for the same option, you should use more than one + (e.g., -p 22:22 -p 33:33). +``` + +# Something for Docker Users +This part is for a new docker user. + +## What I Already Have? + +First, you should have to know what the script have done for your new docker: +* Change the `apt` sources +* Install `sudo`, `openssh-server`, `vim`, and `git`. +* Enable `root` login and password login. +* Configure a new password for your first login. + +There are some brief explanations why these will be done: +* When `apt` downloads from the original webs, it may be very slow. Therefore, the script changed the sources so that `apt` can download from `THU`'s server. +* Install some basic tools. +* When `ssh` is on, it will not allow you login as `root` user or with password. And configure a new `ssh` key should be done by the user (so that they can chose `passphrase` when creating). So the script just turned on these configurations. +* You must have a new password for the first login, so the script will create a one. + +## What Should I Do Next? + +**This is not only what you should do for the docker, but those you should do every time you get a server or docker.** + +If you don't want to do any configurations, the docker may also work, but this may be very inconvenient and unsafe. + +These below are strongly recommended: +* Change your `root` password +* Create a new user as your login user rather than using `root` directly, you need add a password for your new login user +* Configure login with `ssh` rather than with password + +Let me show you an example creating a user named `kaiser` (note that you should change all the `kaiser`s below to your user name): + +1. Let us first connect to the server. + + Open your terminal (choose whatever the shell you like, in `Windows` it is `cmd` or `powershell`, and in `unix-like` system it is `bash`) + + Connect to your docker using this `ssh -p port root@address`, and the `port` and `address` are those the server manager have told you. Input your password (the password the manager have told you). Once it is correct, you will enter your docker (usually in `bash`). + +2. Let us update the `root`'s password. + + Use this to update `root`'s password: `sudo passwd`. You just need enter your new password (the password should be complex and not your usually used passwrod, because you are not supposed to login with root anymore) and press enter (you need do this twice). + + Once this is finished, `root`'s password is updated, keep the new one in mind. + +3. Let us create a new user called `kaiser`. + + Use this command to create a user whose name is `kaiser`: `sudo adduser kaiser`. + + Once you press enter key, the user will be created and require you enter the password for the user, you just need enter the password (the password should be your usually used one, you will use the user to operate the docker). + + After finishing configuring your password, the command will ask you some more information, you can just press enter key to use default value. + + Now let us give `kaiser` the all `sudo` privileges. Run this `echo 'kaiser ALL=(ALL) ALL' >> /etc/sudoers`. + +4. Let us configure ssh key for `kaiser`. + + First use `exit` to close this connect, and make sure now the shell is **your system's one** (or you can do this by opening a new terminal). + + If you don't have a ssh key, you may need create a new one. This command will help you: `ssh-keygen`. For simple way, you just need press enter key when it requires your confirm. If you already have one, just use the one you have created before. + + Now you already have a ssh key, use this command to upload your ssh key to the docker for user `kaiser`: `ssh-copy-id -p port kaiser@address`, the `port` and the `address` are same with the before ones. Then you just need input the password of `kaiser`. + + If there is no any error, congratulations, you have done. But you have to do some more to make your login more convenient. + +5. Let us do something more to make login with `ssh labserver` possible. + + Now you can use `ssh -p port kaiser@address` to login your docker without inputting any password. This is OK, but every time you must enter `-p port kaiser@address` this is inconvenient. + + First, you should find where your `.ssh` is. This is usually in your home directory. Consume the username of your computer is `kaiser`, in `Windows` it will be in `C:\Users\kaiser\.ssh`, and in `unix-like` system it will be in `/home/kaiser/.ssh`. + + Once you find the `.ssh` directory, enter it. And create a file called `config` without any extension (in `Windows`, you should be carefully, and you must make sure you can see the extensions so that the filename is `config` rather than `config.txt`, etc.), and if there have been already one, you just need open it. Now that you have opened the file, append this below to the file: + + ```bash + Host labserver + HostName address + User kaiser + Port port + ``` + Don't forget change the `address` and `port`. And don't forget change all `kaiser`s with your username. + +6. This process is to make your docker unable to login using `root` user (this is optional but strongly recommended). + + Fist login the docker with `kaiser`. Then change the `PermitRootLogin yes` with `PermitRootLogin no` of `/etc/ssh/sshd_config` (use `sudo vim /etc/ssh/sshd_config` to edit the file). + + Restart your ssh service by using this command: `sudo service ssh restart`. + + After finishing this, anyone can not login as `root` even with the right password or ssh key. + + You may ask: if I really want login as `root`, what should I do? You just login as `kaiser`, then use `su root` on the docker, input the password of `root`, then you can login as `root`. + +7. This process is to make your docker unable to login using password (if you want to do this, make sure now you can login with the ssh key). + + Fist login the docker with `kaiser`. Then change the `PasswordAuthentication yes` with `PasswordAuthentication no` of `/etc/ssh/sshd_config` (use `sudo vim /etc/ssh/sshd_config` to edit the file). + + Restart your ssh service by using this command: `sudo service ssh restart`. + + Once you finish this, you cannot login with password. This is really safe. Even someone have peeped your password, they cannot login with your password, unless the hack your ssh key. + +# How Can I Add Some More Scripts for Different Distros +As you can see, the repository now only have `install_ubuntu.sh` that works for `ubuntu`. But don't worry if you want to contribute to this repository and make the scripts work for other distros, that is very easy to do. Let me show you how. + +Generally, the `create_docker.sh` need no updates. You just need update `docker_initializer/installer.sh` and `docker_initializer/installer_distro.sh` the first one is to chose which installer will be executed, its contents is like this: + +```bash +#!/usr/bin/env bash + +password=$1 + +sudo_cmd=$(which sudo) + +if $sudo_cmd cat /etc/os-release | grep -i ubuntu; then + $sudo_cmd chmod a+x ./installer_ubuntu.sh + ./installer_ubuntu.sh "$password" +else + echo "unexpected: now only support ubuntu docker" + exit 1 +fi +``` + +What you need to do for this one is simply add a new `elfi`, for example, if you want add a new installer for `centos`, it may look like this: + +```bash +#!/usr/bin/env bash + +password=$1 + +sudo_cmd=$(which sudo) + +if $sudo_cmd cat /etc/os-release | grep -i ubuntu; then + $sudo_cmd chmod a+x ./installer_ubuntu.sh + ./installer_ubuntu.sh "$password" +elif $sudo_cmd cat /etc/os-release | grep -i centos; then + $sudo_cmd chmod a+x ./installer_centos.sh + ./installer_centos.sh "$password" +else + echo "unexpected: now only support ubuntu docker" + exit 1 +fi +``` + +Then you need to update the second file. For this example, you need create a file name `installer_centos.sh` int the same directory. And write what you want do for the new distro. Here is what I have done in `installer_ubuntu.sh`: + +```bash +#!/usr/bin/env bash + +password=$1 + +sudo_cmd=$(which sudo) + +# before changing source, we must install ca-certificates +$sudo_cmd apt update +$sudo_cmd apt install -y ca-certificates + +# change the apt source +# this only works for Ubuntu 22.04 and Ubuntu 20.04 +# the original source.list will be renamed with source.list.bak +if $sudo_cmd cat /etc/os-release | grep -i ubuntu; then + $sudo_cmd cp /etc/apt/sources.list /etc/apt/sources.list.bak + if $sudo_cmd cat /etc/os-release | grep '22\.04'; then + $sudo_cmd cat ./sources.list.tuna-22.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd cat ./sources.list.tuna-22.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd apt update || exit 1 + elif $sudo_cmd cat /etc/os-release | grep '20\.04'; then + $sudo_cmd cat ./sources.list.tuna-20.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd apt update || exit 1 + else + ${sudo_cmd} echo "unexpected: only support ubuntu-22.04 and ubuntu-20.04" | \ + ${sudo_cmd} tee installer-ubuntu.log + fi +else + echo "unexpected: only support for ubuntu" | tee installer-ubuntu.log + exit 1 +fi + +# install sudo +if ! which sudo; then + apt install -y sudo + sudo_cmd=$(which sudo) +fi + +# install vim and git +$sudo_cmd apt install -y vim git + +# install openssh-server +# you should choose the right time zone +$sudo_cmd apt install -y openssh-server + +# config ssh +if ! $sudo_cmd cat /etc/ssh/sshd_config | ${sudo_cmd} grep "^\s*PermitRootLogin\s\+yes\s*\$"; then + $sudo_cmd echo "PermitRootLogin yes" | $sudo_cmd tee -a /etc/ssh/sshd_config || exit 1 +fi +if ! $sudo_cmd cat /etc/ssh/sshd_config | \ + ${sudo_cmd} grep "^\s*PasswordAuthentication\s\+yes\s*\$"; then + $sudo_cmd echo "PasswordAuthentication yes" | $sudo_cmd tee -a /etc/ssh/sshd_config || exit 1 +fi + +# restart ssh service +$sudo_cmd service ssh restart + +# start ssh when bash start +$sudo_cmd echo "service ssh start" | $sudo_cmd tee -a /root/.bashrc || exit 1 + +if [ "$password" -eq 1 ]; then + while ! $sudo_cmd passwd; do + continue + done +fi +``` + diff --git a/create_docker.sh b/create_docker.sh new file mode 100644 index 0000000..206f4eb --- /dev/null +++ b/create_docker.sh @@ -0,0 +1,202 @@ +#!/usr/bin/env bash + +docs="Usage: + bash $0 [options]|- + $0 [options] + +Options: + -n, --name: same with the --name of docker, required. + + -p, --publish: same with the --publish of docker. + + -P, --publish-all: same with the --publish-all of docker + + -w, --with-gpu: 0 or 1, whether or not to enable gpu, the default value is 1. + + -g, --gpus: same with the --gpus of docker, when gpu is enabled, the default value is +: 'all'. When gpu is disabled, the default value is empty. + + -e, --env: same with the --env of docker, when gpu is enabled, the default value is +: 'NVIDIA_DRIVER_CAPABILITIES=compute,utility NVIDIA_VISIBLE_DEVICES=all', +: you can use more than one -e to specify more than one environment +: variable. When gpu is disabled, the default value is empty. + + -d, --distro: the ditro, the default value is 'ubuntu:latest'. + + -v, --volume: same with --volume of docker, the default value is empty. + + -f, --file: a file or a directory will be copied into the new docker. The default +: value is './docker_initializer'. If you don't want to copy files into the +: docker, you can input 'n' when confirming the command. If you want copy +: more than one file, you need put all the files into a directory, then use +: '-f dir' to copy the whole directory. + + -a, --auto-install: whether or not to install automatically, the default value is 1. When +: enabled, this will install some basic tools rather than just enter the +: new docker. + + --password: whether or not to add a password for the root user, the default value is +: 1. When enabled, this will add password for the root user until success. + + -h, --help: print the manual page. + +Example: + $0 --name newdocker --publish 7777:22 --with-gpu 1 --gpus all -e \\ + NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all ubuntu:latest + + $0 -n newdocker -p 7777:22 + + $0 --name newdocker --publish 7777:22 --with-gpu 0 --distro ubuntu:latest --file \\ + ./docker_initializer + + $0 -n newdocker -p 7777:22 -w 0 + +Note: + The second example will acts same as the first one does. + The fourth example will acts same as the third one does. + If you want to pass more than one argument for the same option, you should use more than one + (e.g., -p 22:22 -p 33:33)." + +usage() { + echo -e "$docs" >&2 + exit "$1" +} + +# Note that the -l and -o cannot be truncated, +# Make sure the parameters after -l and -o are at the smae line, even it is too long +if ! options=$(getopt \ + -o n:p:Pw:g:e:d:v:f:a:h \ + -l name:,publish:,publish-all,with-gpu:,gpus:,env:,distro:,volume:,file:,auto-install:,password:,help \ + -n "$(basename "$0")" -- "$@"); then + usage 1 +fi + + +eval set -- "$options" +name=() +publish=() +gpus=() +envs=() +volume=() +autoinstall=1 +password=1 +while true ; do + case "$1" in + -n|--name) name+=("--name $2"); pure_name=$2; shift 2;; + -p|--publish) publish+=("--publish $2"); shift 2;; + -P|--publish-all) publish_all=--publish-all; shift 1;; + -w|--with-gpu) with_gpu="$2"; shift 2;; + -g|--gpus) gpus+=("--gpus $2"); shift 2;; + -e|--env) envs+=("--env $2"); shift 2;; + -d|--distro) distro="$2"; shift 2;; + -v|--volume) volume+=("$2"); shift 2;; + -f|--file) file_or_dir="$2"; shift 2;; + -a|--auto-install) autoinstall="$2"; shift 2;; + --password) password="$2"; shift 2;; + -h|--help) usage 0;; + --) shift; break;; + *) usage 1;; + esac +done + +if [ -z "$pure_name" ]; then + echo "name can not be empty" + usage 1 +fi + +with_gpu=${with_gpu:-1} + +if [ "$with_gpu" -eq 1 ]; then + if [ "${#envs[@]}" -eq 0 ]; then + envs=("-e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all") + fi + if [ "${#gpus[@]}" -eq 0 ]; then + gpus=("--gpus all") + fi +else + envs=() + gpus=() +fi + +if [ -z "$distro" ]; then + distro=ubuntu:latest +fi + +if ! declare -p file_or_dir &>/dev/null; then + file_or_dir="./docker_initializer" +fi + +debug() { + echo "options: $options" + echo "name: ${name[*]}" + echo "pure_name: $pure_name" + echo "pbulish: ${publish[*]}" + echo "publish_all: $publish_all" + echo "with_gpu: ${with_gpu}" + echo "gpus: ${gpus[*]}" + echo "envs: ${envs[*]}" + echo "volume: ${volume[*]}" + echo "file_or_dir: $file_or_dir" + echo "distro: $distro" + echo "autoinstall: $autoinstall" + echo "password: $password" +} + +sudo_cmd=$(which sudo) + +confirm_cmd() { + echo "The command will be executed: " + echo "$1" + while true; do + echo -n "[Y/n]:" + read -r confirm + if [ "$confirm" == 'y' ] || [ "$confirm" == '' ]; then + if ! bash -c "$1"; then + exit 1 + fi + break + elif [ "$confirm" == 'n' ]; then + return 1 + fi + done + return 0 +} + +docker_create_cmd=" $sudo_cmd docker run \\ + -dit \\ + ${name[*]} \\ + ${publish[*]} \\ + $publish_all \\ + ${gpus[*]} \\ + ${envs[*]} \\ + ${volume[*]} \\ + $distro" +if ! confirm_cmd "$docker_create_cmd"; then + echo "terminated" + exit 1 +fi + +docker_cp_file_cmd=" $sudo_cmd docker cp \\ + $file_or_dir \\ + $pure_name:/" +if [ "$file_or_dir" != "" ]; then + if ! confirm_cmd "$docker_cp_file_cmd"; then + echo "terminated" + exit 1 + fi +fi + +docker_enter_cmd=" $sudo_cmd docker exec \\ + -it ${pure_name} \\ + bash" +if [ "$autoinstall" -eq 1 ] && [ "$file_or_dir" == "./docker_initializer" ]; then +docker_enter_cmd="$docker_enter_cmd \\ + -c \"cd /docker_initializer && bash installer.sh $password\"" +fi +if ! confirm_cmd "$docker_enter_cmd"; then + echo "terminated" + exit 1 +fi + +exit 0 + diff --git a/docker_initializer/installer.sh b/docker_initializer/installer.sh new file mode 100644 index 0000000..5aeec8d --- /dev/null +++ b/docker_initializer/installer.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +password=$1 + +sudo_cmd=$(which sudo) + +if $sudo_cmd cat /etc/os-release | grep -i ubuntu; then + $sudo_cmd chmod a+x ./installer_ubuntu.sh + ./installer_ubuntu.sh "$password" +else + echo "unexpected: now only support ubuntu docker" + exit 1 +fi + diff --git a/docker_initializer/installer_ubuntu.sh b/docker_initializer/installer_ubuntu.sh new file mode 100644 index 0000000..198c0a8 --- /dev/null +++ b/docker_initializer/installer_ubuntu.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +password=$1 + +sudo_cmd=$(which sudo) + +# before changing source, we must install ca-certificates +$sudo_cmd apt update +$sudo_cmd apt install -y ca-certificates + +# change the apt source +# this only works for Ubuntu 22.04 and Ubuntu 20.04 +# the original source.list will be renamed with source.list.bak +if $sudo_cmd cat /etc/os-release | grep -i ubuntu; then + $sudo_cmd cp /etc/apt/sources.list /etc/apt/sources.list.bak + if $sudo_cmd cat /etc/os-release | grep '22\.04'; then + $sudo_cmd cat ./sources.list.tuna-22.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd cat ./sources.list.tuna-22.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd apt update || exit 1 + elif $sudo_cmd cat /etc/os-release | grep '20\.04'; then + $sudo_cmd cat ./sources.list.tuna-20.04 | $sudo_cmd tee /etc/apt/sources.list || exit 1 + $sudo_cmd apt update || exit 1 + else + ${sudo_cmd} echo "unexpected: only support ubuntu-22.04 and ubuntu-20.04" | \ + ${sudo_cmd} tee installer-ubuntu.log + fi +else + echo "unexpected: only support for ubuntu" | tee installer-ubuntu.log + exit 1 +fi + +# install sudo +if ! which sudo; then + apt install -y sudo + sudo_cmd=$(which sudo) +fi + +# install vim and git +$sudo_cmd apt install -y vim git + +# install openssh-server +# you should choose the right time zone +$sudo_cmd apt install -y openssh-server + +# config ssh +if ! $sudo_cmd cat /etc/ssh/sshd_config | ${sudo_cmd} grep "^\s*PermitRootLogin\s\+yes\s*\$"; then + $sudo_cmd echo "PermitRootLogin yes" | $sudo_cmd tee -a /etc/ssh/sshd_config || exit 1 +fi +if ! $sudo_cmd cat /etc/ssh/sshd_config | \ + ${sudo_cmd} grep "^\s*PasswordAuthentication\s\+yes\s*\$"; then + $sudo_cmd echo "PasswordAuthentication yes" | $sudo_cmd tee -a /etc/ssh/sshd_config || exit 1 +fi + +# restart ssh service +$sudo_cmd service ssh restart + +# start ssh when bash start +$sudo_cmd echo "service ssh start" | $sudo_cmd tee -a /root/.bashrc || exit 1 + +if [ "$password" -eq 1 ]; then + while ! $sudo_cmd passwd; do + continue + done +fi + diff --git a/docker_initializer/sources.list.tuna-20.04 b/docker_initializer/sources.list.tuna-20.04 new file mode 100644 index 0000000..30ca36f --- /dev/null +++ b/docker_initializer/sources.list.tuna-20.04 @@ -0,0 +1,8 @@ +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse diff --git a/docker_initializer/sources.list.tuna-22.04 b/docker_initializer/sources.list.tuna-22.04 new file mode 100644 index 0000000..9adc90d --- /dev/null +++ b/docker_initializer/sources.list.tuna-22.04 @@ -0,0 +1,8 @@ +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse +deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse +# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse