成功最有效的方法就是向有经验的人学习!

常用docker镜像配置加速、中文、时区

Debian容器配置加速及中文

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
RUN echo 'deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib \n\
  deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib \n\
  deb http://mirrors.aliyun.com/debian-security stretch/updates main \n\
  deb-src http://mirrors.aliyun.com/debian-security stretch/updates main \n\
  deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \n\
  deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \n\
  deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \n\
  deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib' \
> /etc/apt/sources.list

RUN apt-get update && apt-get install locales locales-all -y

ENV LANG=en_US.UTF-8 \
    LANGUAGE=en_US:en \
    LC_ALL=en_US.UTF-8

Alpine容器配置加速及时区

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk update && apk add --no-cache tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && apk del tzdata
赞(0) 打赏
未经允许不得转载:陈桂林博客 » 常用docker镜像配置加速、中文、时区
分享到

大佬们的评论 抢沙发

全新“一站式”建站,高质量、高售后的一条龙服务

微信 抖音 支付宝 百度 头条 快手全平台打通信息流

橙子建站.极速智能建站8折购买虚拟主机

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册