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

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

docker hub国内镜像

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

/etc/docker/daemon.json

{
"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

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

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

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

Dockerfile

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

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

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

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

Docker国内镜像source的更多相关文章

  1. Docker - Docker国内镜像的配置及使用

    Docker国内镜像 DaoCloud - Docker加速器 阿里云 - 开发者平台 微镜像 - 希云cSphere 镜像广场 - 时速云 灵雀云 网易蜂巢 阿里云的Docker加速器 阿里云 - ...

  2. Docker - 国内镜像的配置及使用

    Docker国内镜像 DaoCloud - Docker加速器 阿里云 - 开发者平台 微镜像 - 希云cSphere 网易蜂巢 阿里云的Docker加速器 阿里云 - 开发者平台:https://d ...

  3. docker国内镜像拉取和镜像加速registry-mirrors配置修改

    docker国内镜像拉取和镜像加速registry-mirrors配置修改 学习了:http://blog.csdn.net/u014231523/article/details/61197945 站 ...

  4. docker 国内镜像源

    参考:docker 国内镜像源 作者:Joncc Linux环境 # vi /etc/docker/daemon.json { "registry-mirrors": [" ...

  5. docker安装mysql、es、jenkins等一些步骤以及如何设置docker国内镜像

    CentOS7安装Docker步骤: (0)删除旧的可能安装过的包 yum remove docker \                   docker-client \              ...

  6. Docker国内镜像源设置

    编辑json文件,添加如下内容后重启docker即可. [root@Docker ~]# cat /etc/docker/daemon.json{ "registry-mirrors&quo ...

  7. 使用docker国内镜像解决方案

    1:蜂巢镜像 https://c.163yun.com/hub#/m/library/ 例如: docker pull hub.c.163.com/library/nginx:1.8 再次执行dock ...

  8. Docker:docker国内镜像加速

    创建或修改 /etc/docker/daemon.json 文件,修改为如下形式 { "registry-mirrors": [ "https://registry.do ...

  9. docker 国内镜像加速

    CentOS7 对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件): {"registry-mirrors& ...

随机推荐

  1. Linux安装Tomcat-Nginx-FastDFS-Redis-Solr-集群——【第十一集之安装FastDFS】

    1,安装FastDFS之前,先安装libevent工具包. yum -y install libevent 2,安装libfastcommonV1.0.7工具包.有可能找到新版本的zip压缩包:lib ...

  2. Spring Security(15)——权限鉴定结构 RoleVoter

    http://www.cnblogs.com/fenglan/p/5913432.html

  3. 无法启动 Maya 集成的 qt designer 的解决方法和原因 以及 中英文切换

    无法启动 Maya 集成的 qt designer 的解决方法和原因 以及 中英文切换 前言: Maya 集成了 PySide,同时集成了qt designer,在 Maya 的安装目录下的 bin ...

  4. Codeforces 208A-Dubstep(字符串)

    Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performanc ...

  5. JavaEE 之 文件上传

    1.文件上传 a.配置mySpring-servlet.xml <bean id="multipartResolver" class="org.springfram ...

  6. pymysql:Mysql拒绝从远程访问的解决办法

    pymysql:Mysql拒绝从远程访问的解决办法 pymysql连接数据库 # 导入pymysql模块 import pymysql # 连接database conn = pymysql.conn ...

  7. Shell学习之Bash变量详解(二)

    Shell学习之Bash变量详解 目录 Bash变量 Bash变量注意点 用户自定义变量 环境变量 位置参数变量 预定义变量 Bash变量 用户自定义变量:在Bash中由用户定义的变量. 环境变量:这 ...

  8. Spring AOP 源码分析 - 拦截器链的执行过程

    1.简介 本篇文章是 AOP 源码分析系列文章的最后一篇文章,在前面的两篇文章中,我分别介绍了 Spring AOP 是如何为目标 bean 筛选合适的通知器,以及如何创建代理对象的过程.现在我们的得 ...

  9. 鼠标hover时图片效果

    <!DOCTYPE html><head><meta http-equiv="Content-Type" content="text/htm ...

  10. 146. 大小写转换 II

    146. Lowercase to Uppercase II Description Implement an upper method to convert all characters in a ...