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. StartFP

    1.INODS执行完成时间为13:06:04分, 从日志信息无法知道STARTFP执行到哪一步 从INODS执行完成时间可知道startFp执行时间为13:06:05分开始, 执行StartFP中的e ...

  2. vim的共享系统剪贴板以及缩进相关问题

    http://www.cnblogs.com/end/archive/2012/06/01/2531147.html:reg 可以显示可用的寄存器,其中注意两个特殊的寄存器:"* 和 &qu ...

  3. 关于OPC的研究1]c# opc client源码调试和学习笔记

    c# opc client是一个在网上下载的示例程序,调试的时候还是费了一番周折,服务器端程序来自king view6.55,另文介绍. 1.注册dll 程序中有一个名叫OPCDAAuto.dll的文 ...

  4. PHP用户名用星号处理

    PHP用户名用*号处理: 用户名:英文.中文.中英文混合的.中英文字符混合的 处理为:首字母和末尾保留,中间用*号代替(一个字符直接显示,两个字符:张*,三个以上字符:宋*丹) 首先判断字符中是否包含 ...

  5. Android自定义控件

    开发自定义控件的步骤: 1.了解View的工作原理  2. 编写继承自View的子类 3. 为自定义View类增加属性  4. 绘制控件  5. 响应用户消息  6 .自定义回调函数    一.Vie ...

  6. LINQ to XML 编程基础

    1.LINQ to XML类 以下的代码演示了如何使用LINQ to XML来快速创建一个xml: 隐藏行号 复制代码 ?创建 XML public static void CreateDocumen ...

  7. PTA Strongly Connected Components

    Write a program to find the strongly connected components in a digraph. Format of functions: void St ...

  8. 测试webAPP时图标背景一片黑色

    写了个web小程序,打包成APP后安装到手机里,在魅族手机里显示是正常的,但是在EMUI和MIUI中却显示一片黑色,搞了半天才发现原来是因为EMUI会自动给应用的图标裁剪圆角并加上背景色,背景色是系统 ...

  9. CSS text-transform 属性

    text-transform 属性控制文本的大小写. h1 {text-transform:uppercase} h2 {text-transform:capitalize} p {text-tran ...

  10. hihoCoder 1080 : 更为复杂的买卖房屋姿势 线段树区间更新

    #1080 : 更为复杂的买卖房屋姿势 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho都是游戏迷,“模拟都市”是他们非常喜欢的一个游戏,在这个游戏里面他们 ...