前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Docker国内镜像source

Docker国内镜像source

作者头像
Ryan-Miao
发布2019-04-18 20:13:49
4.2K0
发布2019-04-18 20:13:49
举报
文章被收录于专栏:Ryan MiaoRyan Miao

现在使用docker的镜像大多基于几种基本Linux系统。虽然我不需要在容器李安装很多东西,但经常需要一些必要的工具,而基础镜像里并不包含,比如vim, ifconfig, curl等。考虑下载速度,最后修改镜像的source为国内地址。现在收集一些docker的基础镜像中国镜像源。

Github: https://github.com/Ryan-Miao/docker-china-source

docker hub国内镜像

下载docker image也可以走国内镜像。

/etc/docker/daemon.json

代码语言:javascript
复制
{ 
"registry-mirrors": ["https://registry.docker-cn.com", "http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn"] 
}

alpine

Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.

特点是轻量,小,现在docker推荐的base镜像系统,绝大多数公共docker镜像都有alpine版本。

新建repositories

代码语言:javascript
复制
https://mirrors.aliyun.com/alpine/v3.6/main/

https://mirrors.aliyun.com/alpine/v3.6/community/

现在制作一个lua解析容器:

Dockerfile

代码语言:javascript
复制
FROM alpine

COPY repositories /etc/apk/repositories
RUN apk update && apk add vim curl net-tools lua

centos6

有时候还是想继续用centos6.

wget http://mirrors.aliyun.com/repo/Centos-6.repo

Dockerfile

代码语言:javascript
复制
FROM centos:6
MAINTAINER Ryan Miao
WORKDIR /tmp
COPY Centos-6.repo /etc/yum.repos.d/CentOS-Base.repo
RUN yum clean all && yum makecache
RUN yum install -y  vim git net-tools curl wget 

debian

Debian是社区类Linux的典范,是迄今为止最遵循GNU规范的Linux系统, 包括Debian和Ubuntu等.

很多镜像选择debian作为基础镜像,比如nginx

新建sources.list

代码语言:javascript
复制
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib

Dockerfile

代码语言:javascript
复制
FROM nginx:1.15.10
MAINTAINER Ryan Miao <ryan.miao@nf-3.com>


COPY sources.list   /etc/apt/sources.list
RUN apt-get update 
RUN apt-get install -y net-tools procps curl wget vim telnet cron
本文参与?腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-04-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客?前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与?腾讯云自媒体分享计划? ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • docker hub国内镜像
  • alpine
  • centos6
  • debian
相关产品与服务
容器镜像服务
容器镜像服务(Tencent Container Registry,TCR)为您提供安全独享、高性能的容器镜像托管分发服务。您可同时在全球多个地域创建独享实例,以实现容器镜像的就近拉取,降低拉取时间,节约带宽成本。TCR 提供细颗粒度的权限管理及访问控制,保障您的数据安全。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com