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
    
    
  • 相关阅读:
    java Activiti 工作流引擎 SSM 框架模块设计方案
    自定义表单 Flowable 工作流 Springboot vue.js 前后分离 跨域 有代码生成器
    数据库设计的十个最佳实践
    activiti 汉化 stencilset.json 文件内容
    JAVA oa 办公系统模块 设计方案
    java 考试系统 在线学习 视频直播 人脸识别 springboot框架 前后分离 PC和手机端
    集成 nacos注册中心配置使用
    “感恩节 ”怼记
    仓颉编程语言的一点期望
    关于System.out.println()与System.out.print("\n")的区别
  • 原文地址:https://www.cnblogs.com/woshimrf/p/docker-china-source.html
Copyright © 2011-2022 走看看