页面“每天一命令之echo”与“Alpine 修改docker的时区及安装telnet”之间的差异
(页面间的差异)
跳到导航
跳到搜索
第1行: | 第1行: | ||
− | + | [[category:Container]] | |
− | = | + | =修改为cst 中国标准时间= |
<pre> | <pre> | ||
− | |||
− | + | #修改源 | |
+ | cat /etc/apk/repositories | ||
− | + | http://mirrors.aliyun.com/alpine/v3.12/main | |
− | + | http://mirrors.aliyun.com/alpine/v3.12/community | |
− | + | ||
− | + | apk add --update nodejs npm | |
− | + | ||
− | + | #RUN 表明 这是在容器里面的 | |
− | + | RUN apk add -U tzdata | |
− | + | ||
− | + | #设置时区 | |
− | + | RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | |
+ | && echo 'Asia/Shanghai' >/etc/timezone | ||
</pre> | </pre> | ||
− | + | =安装telnet= | |
− | + | <pre> | |
− | + | #Alpine镜像中的telnet在3.7版本后被转移至busybox-extras包中 | |
− | + | apk update | |
+ | apk add busybox-extras | ||
+ | telnet smtp.163.com 25 | ||
+ | </pre> |
2020年9月28日 (一) 09:17的版本
修改为cst 中国标准时间
#修改源 cat /etc/apk/repositories http://mirrors.aliyun.com/alpine/v3.12/main http://mirrors.aliyun.com/alpine/v3.12/community apk add --update nodejs npm #RUN 表明 这是在容器里面的 RUN apk add -U tzdata #设置时区 RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && echo 'Asia/Shanghai' >/etc/timezone
安装telnet
#Alpine镜像中的telnet在3.7版本后被转移至busybox-extras包中 apk update apk add busybox-extras telnet smtp.163.com 25