# 腾讯云软件源使用示例 ![badge](https://cnb.cool/examples/mirrors/mirrors.cloud.tencent.com/-/badge/git/latest/ci/pipeline-as-code) ![badge](https://cnb.cool/examples/mirrors/mirrors.cloud.tencent.com/-/badge/git/latest/ci/git-clone-yyds) ![badge](https://cnb.cool/examples/mirrors/mirrors.cloud.tencent.com/-/badge/git/latest/ci/status/push) # 编程语言 ## Maven [示例仓库](https://cnb.cool/examples/ecosystem/springboot-maven-docker) ## Gradle [示例仓库](https://cnb.cool/examples/ecosystem/springboot-gradle-docker) ## Python * [Dockerfile 中使用](./python/Dockerfile) * 本次使用 ```shell pip install -i https://mirrors.cloud.tencent.com/pypi/simple coscmd pip install -r requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple ``` * 全局设置 ```shell pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple ``` ## PHP * [Dockerfile 中使用](./php/Dockerfile) * 全局配置 * 全局配置:`composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/` * 取消配置:`composer config repo.packagist composer https://mirrors.cloud.tencent.com/composer/` * 项目配置(项目根目录下执行) * 项目配置:`composer config repo.packagist composer https://mirrors.cloud.tencent.com/composer/` * 取消配置:`composer config --unset repos.packagist` ## NPM ```shell npm config set registry https://mirrors.cloud.tencent.com/npm/ ``` ## YARN ```shell yarn config set registry https://mirrors.cloud.tencent.com/npm/ ``` # 操作系统 ## Ubuntu ### 24 * [Dockerfile 中使用](./ubuntu/24.Dockerfile) * shell 中使用 ```shell sed -Ei "s@(security|ports|archive).ubuntu.com@mirrors.cloud.tencent.com@g" /etc/apt/sources.list.d/ubuntu.sources ``` ### 22 及以下 * [Ubuntu 22 Dockerfile 中使用](./ubuntu/22.Dockerfile) * [Ubuntu 20 Dockerfile 中使用](./ubuntu/20.Dockerfile) * [Ubuntu 18 Dockerfile 中使用](./ubuntu/18.Dockerfile) * shell 中使用 ```shell sed -Ei "s@(security|ports|archive).ubuntu.com@mirrors.cloud.tencent.com@g" /etc/apt/sources.list ``` ## Debian ### bookworm * [Dockerfile 中使用](./debian/bookworm-12.Dockerfile) * shell 中使用 ```shell sed -i "s@http://deb.debian.org/debian@http://mirrors.cloud.tencent.com/debian@g" /etc/apt/sources.list.d/debian.sources ``` ### bullseye * [Dockerfile 中使用](./debian/bullseye-11.Dockerfile) * shell 中使用 ```shell sed -i "s@http://deb.debian.org/debian@http://mirrors.tencent.com/debian@g" /etc/apt/sources.list ``` ### buster * [Dockerfile 中使用](./debian/buster-10.Dockerfile) * shell 中使用 ```shell sed -i "s@http://deb.debian.org/debian-security@http://mirrors.cloud.tencent.com/debian-security@g" /etc/apt/sources.list sed -i "s@http://deb.debian.org/debian@http://mirrors.cloud.tencent.com/debian-archive/debian@g" /etc/apt/sources.list ``` ### stretch * [Dockerfile 中使用](./debian/stretch-9.Dockerfile) * shell 中使用 ```shell cat < /etc/apt/sources.list deb http://mirrors.tencent.com/debian-archive/debian stretch main #deb http://mirrors.tencent.com/debian-archive/debian stretch-backports main #deb http://mirrors.tencent.com/debian-archive/debian stretch-backports-sloppy main #deb http://mirrors.tencent.com/debian-archive/debian stretch-proposed-updates main deb http://mirrors.tencent.com/debian-archive/debian-security stretch/updates main EO ``` ## Alpine * [Dockerfile 中使用](./alpine/Dockerfile) * shell 中使用 ```shell sed -i 's@dl-cdn.alpinelinux.org@mirrors.cloud.tencent.com@g' /etc/apk/repositories ```