After building a Dockerfile, I run it. I figure out that there is something wrong with local time.

So I start to install ntpdate but it doesn't work at all. The clock of docker must be asyncronized with

host clock, it can not be changed by itself. The file /etc/localtime is used for setting the system clock

and once it is changed, the time in system will be changed immediately.

Actually, /etc/localtime is a symlink to /usr/share/zoneinfo/localtime in some Linux/Unix systems.

We can can change /etc/lcoaltime into any one of these timezones as following:

root@ubuntu:/usr/share/zoneinfo# ls
Africa Canada EST GMT0 Iran MET Poland ROK WET
America CET EST5EDT GMT-0 iso3166.tab Mexico Portugal Singapore W-SU
Antarctica Chile Etc GMT+0 Israel MST posix SystemV zone.tab
Arctic CST6CDT Europe Greenwich Jamaica MST7MDT posixrules Turkey Zulu
Asia Cuba Factory Hongkong Japan Navajo PRC UCT
Atlantic EET GB HST Kwajalein NZ PST8PDT Universal
Australia Egypt GB-Eire Iceland Libya NZ-CHAT right US
Brazil Eire GMT Indian localtime Pacific ROC UTC

Solution:

root@6fc515dfb754:~# ntpdate us.pool.ntp.org
3 Nov 09:30:06 ntpdate[966]: Can't adjust the time of day: Operation not permitted cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Docker ntpdate Permition error的更多相关文章

  1. docker 错误:Error response from daemon: cannot stop container: connect: connection refused": unknown

    docker 错误:Error response from daemon: cannot stop container: 795e4102b2de: Cannot kill container 795 ...

  2. Docker 报错 error during connect: Get pipe/docker_engine: The system cannot find the file specified. - 摘要: 本文讲的是Docker 报错 error during connect: Get pipe/dock

    error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/version: open //./pipe/docker_ ...

  3. 解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver

    CentOS 7.5 x64下 sudo yum install docker -y systemctl enable docker systemctl start docker 发现启动失败 jou ...

  4. Docker 启动遇到 Error starting daemon: Error initializing network controller 错误

    docker 版本 1.10.3 一台装有 docker 的机器重启后,没法启动,/var/log/messages 展示如下错误信息: May 17 11:11:14 gziba-hc03 syst ...

  5. 私有Docker仓库login Error response from daemon: Get https://x.x.x.x/v2/: dial tcp x.x.x.x:443: connect: connection refused

    一.登陆私有仓库错误: docker login --username=evan 192.168.0.203 Error response from daemon: Get https://192.1 ...

  6. 解决docker启动错误 error creating overlay mount to /var/lib/docker/overlay2

    原文 最近在centos7.1使用docker运行redis镜像,出现下面的错误: /usr/bin/docker-current: Error response from daemon: error ...

  7. 解决docker pull出现 error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net······: net/http: TLS handshake timeout的问题

    [root@MyCentos7 var]# docker pull javaUsing default tag: latestTrying to pull repository docker.io/l ...

  8. docker 报错 Error response from daemon: driver failed programming external connectivity on endpoint mynginx

    Error response from daemon: driver failed programming external connectivity on endpoint mynginx (7d1 ...

  9. docker build提示error checking context:can't stat xxx

    现象描述 使用docker build一个镜像的时候,提示下面的错误: ➜ docker build -t image_name -f xxx.dockerfile . error checking ...

随机推荐

  1. 常见绘图框架-(Charts)

    swift 出来后有很多优秀的第三方绘图.动画框架,最近项目需要使用了 Charts Github: https://github.com/danielgindi/Charts 因为是在Object- ...

  2. 01 Apache Solr:提升检索体验 为什么是Solr

    背景:      最近开发一个大型的仓储管理平台项目,项目的前身是无数个版本的历史悠久的基于CS模式的Windows桌面程序.然后对于每一个客户,我们可能需要为之定制比较个性化的特殊功能.于是,有一个 ...

  3. 实现type函数用于识别标准类型和内置对象类型

    function type(obj){ return Object.prototype.toString.call(obj).slice(8,-1); } var t=type(new Number( ...

  4. HR开发 SuccessFactors与HCM数据映射

    SuccessFactors Employee Central ----->> HCM 增强点 ES_PAOCF_EC_TOOLS HCM ----->> SuccessFac ...

  5. 去除inline-block元素间间距,比较靠谱的两种办法

    1.使用注释符号 <div><span class="1">1</span></div><!-- --><div& ...

  6. 关于《rsyslog+mysql+loganalyzer搭建日志服务器<个人笔记>》的反思

    关于<rsyslog+mysql+loganalyzer搭建日志服务器<个人笔记>>的反思--链接--http://www.cnblogs.com/drgcaosheng/p/ ...

  7. SQLYog快捷键大全

    Ctrl+M   创建一个新的连接 Ctrl+N   使用当前设置新建连接 Ctrl+F4   断开当前连接 对象浏览器 F5   刷新对象浏览器(默认) Ctrl+B   设置焦点于对象浏览器 SQ ...

  8. ASP.NET中的XML和JSON

    一.DOM简介 1.XML 定义:XML是一种跨语言.跨平台的数据储存格式 2.什么是DOM DOM(document object model)文档对象模型:是一种允许程序或脚本动态的访问更新文档内 ...

  9. iOS开发-automaticallyAdjustsScrollViewInsets属性

    iOS开发-automaticallyAdjustsScrollViewInsets属性 Available in iOS 7.0 and later. 简单点说就是automaticallyAdju ...

  10. MMS源码中异步处理简析

    1,信息数据的查询,删除使用AsycnQueryHandler处理 AsycnQueryHandler继承了Handler public abstract class AsyncQueryHandle ...