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. 关于使用READ TABLE语句的几点注意事项

    原文地址   http://www.dlsap.com/thread-34-1-1.html 1.  如果使用READ TABLE语句来读取内部表数据,而不是简单看返回值判断是否存在,那么在使用REA ...

  2. 史航416第11次作业&总结

    作业1:冒泡排序 #include <stdio.h> ],int n); int main() { ],n,i; printf("输入一个整数n:"); scanf( ...

  3. 在filter中使用spring的service bean

    http://blog.csdn.net/godha/article/details/13025099

  4. linux 搭建svn

    1          安装SVN 官网下载:http://subversion.apache.org/packages.html SVN客户端:TortoiseSVN,官网下载:http://tort ...

  5. 关于SharpZipLib压缩分散的文件及整理文件夹的方法

    今天为了解决压缩分散的文件时,发现想通过压缩对象直接进行文件夹整理很麻烦,因为SharpZipLib没有提供压缩进某个指定文件夹的功能,在反复分析了SharpZipLib提供的各个接口方法后,终于找到 ...

  6. [转] AIX lv 4k偏移量

    转自:http://www.aixchina.net/Question/29969 前几天在客户数据库做巡检的时候,在警告日志中发现有如下警告:引用WARNING: You are creating ...

  7. Valid Parentheses 使用递归的解法

    class Solution { public: bool isValid(string s) { ||s.size()%!=)return false; unordered_map<char, ...

  8. windows下远程桌面连接centos

    最近,由于项目需要,必须要在centos下进行操作.习惯了图形界面的我,通过黑框框来远程操作服务器,着实让人难受.但是,windows自带的远程桌面工具貌似不能直接连centos.所以,只能借助其他工 ...

  9. flask-admin章节三:数据库迁移工具 alembic初步使用

    1. 概述 基于flask框架构建web,一般会使用sqlchemy(在flask中使用sqlchemy可以参考这里)作为数据库引擎. 这样业务的逻辑就可以做到不跟具体的数据库类型相耦合,具体后端业务 ...

  10. boot from volume

    nova boot --flavor 1 --block-device source=image,id=<image_id>,dest=volume,size=5,shutdown=pre ...