zoukankan      html  css  js  c++  java
  • Docker国内镜像source

    现在使用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
    
    
  • 相关阅读:
    grub.conf文件说明
    grub手动引导win7
    手动grub引导redhat
    grub的三种安装方式
    试题系列五(公鸡5元一只,母鸡3元一只,小鸡1元3只,求100元刚好买100只鸡的可能)
    试题系列四(袋中有6红球 3黄球 3绿球,从中取6个球,求所有拿到球的颜色的可能 c(12,6))
    试题系列三(求任意两个数的最大公约数)
    试题系列二(求1000内的完数)
    试题系列一(求4,5,6,7所有四位数的排列组合)
    pthread_cleanup_push和pthread_cleanup_pop清除函数是否执行的说明
  • 原文地址:https://www.cnblogs.com/woshimrf/p/docker-china-source.html
Copyright © 2011-2022 走看看