各种镜像加速配置

各种镜像加速配置

docker 镜像加速

Linux下,/etc/docker/daemon.json,如果没有则创建.

{
	"registry-mirrors":[
		"http://f1361db2.m.daocloud.io",
		"https://dockerhub.azk8s.cn",
		"https://hub-mirror.c.163.com"
	]
}

然后重新加载配置,并重启docker.

systemctl daemon-reload
systemctl restart docker

注意: 配置文件的json格式要严格,最后的一项的逗号一定不要加,否则docker会启动失败.

上面的地址可能失效,还可以使用阿里云镜像加速(个人推荐):

1.在阿里云平台上搜索 容器镜像服务.

在这里插入图片描述
在这里插入图片描述
2.开通此服务

3.获取加速器地址
在这里插入图片描述

4.将此地址加入到daemon.json中.

gradle 镜像加速

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
    	// 以下四行代码为阿里gradle 源
        maven{ url 'https://maven.aliyun.com/repository/google'}
        maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
        maven{ url 'https://maven.aliyun.com/repository/public'}
        maven{ url 'https://maven.aliyun.com/repository/jcenter'}
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
    	// 所有的model 都优先使用阿里源
        maven{ url 'https://maven.aliyun.com/repository/google'}
        maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
        maven{ url 'https://maven.aliyun.com/repository/public'}
        maven{ url 'https://maven.aliyun.com/repository/jcenter'}
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

maven镜像加速

修改maven安装路径下,/conf/setting.xml,在<mirrors></mirrors>标签添加阿里云镜像.

<mirror> 
	<id>nexus-aliyun</id>
	<mirrorOf>central</mirrorOf>
	<name>Nexus aliyun</name>
	<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

nodejs 镜像加速

npm config set registry https://registry.npm.taobao.org

配置完后,可以通过以下命令查看是否配置成功.

npm config ls
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值