时区问题
Dockerfile中
RUN cp /etc/localtime /etc/localtime
如果需要指定时区
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
也可以运行时挂载进去
docker run -d --name nginx -v /etc/localtime:/etc/localtime:ro nginx
apk repositories修改
Dockerfile中
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
修改dns解析顺序
nsswitch.conf
hosts: files dns
Dockerfile中
COPY nsswitch.conf /etc/
网友评论