[What] The docker file for build a container to provide network time synchronization service for virtual and physical machines.
Signed-off-by: Wang Chenglong 18509160991@163.com --- container/ntp-server/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 container/ntp-server/Dockerfile
diff --git a/container/ntp-server/Dockerfile b/container/ntp-server/Dockerfile new file mode 100644 index 0000000..76f2a0e --- /dev/null +++ b/container/ntp-server/Dockerfile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +FROM centos:7 +MAINTAINER Wang Chenglong 18509160991@163.com + +RUN yum repolist +RUN yum -y install ntp && \ + yum clean all +RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +COPY ntp.conf /etc/ntp.conf +COPY start-server.sh / + +EXPOSE 123 + +ENTRYPOINT ["/start-server.sh"] +CMD ["sh"]
On Thu, Oct 29, 2020 at 05:31:56PM +0800, Wang Chenglong wrote:
[What] The docker file for build a container to provide network time synchronization service for virtual and physical machines.
[what] ntp-server is used to synchronize time between physical machine and virtual machine.
+FROM centos:7 +MAINTAINER Wang Chenglong 18509160991@163.com
+RUN yum repolist +RUN yum -y install ntp && \
- yum clean all
+RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum repolist and yum clean all is necessary?
Thanks, Yinsi
On Thu, Oct 29, 2020 at 05:48:48PM +0800, Liu Yinsi wrote:
On Thu, Oct 29, 2020 at 05:31:56PM +0800, Wang Chenglong wrote:
[What] The docker file for build a container to provide network time synchronization service for virtual and physical machines.
[what] ntp-server is used to synchronize time between physical machine and virtual machine.
+FROM centos:7 +MAINTAINER Wang Chenglong 18509160991@163.com
+RUN yum repolist +RUN yum -y install ntp && \
- yum clean all
+RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum repolist and yum clean all is necessary?
it would be better if there were.
Thanks, Yinsi
On Thu, Oct 29, 2020 at 05:48:48PM +0800, Liu Yinsi wrote:
On Thu, Oct 29, 2020 at 05:31:56PM +0800, Wang Chenglong wrote:
[What] The docker file for build a container to provide network time synchronization service for virtual and physical machines.
[what] ntp-server is used to synchronize time between physical machine and virtual machine.
No, the ntp service is used to provide ntp server to physical machine and virtual machine. Not between physical machine and virtual machine.
+FROM centos:7 +MAINTAINER Wang Chenglong 18509160991@163.com
+RUN yum repolist +RUN yum -y install ntp && \
- yum clean all
+RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum repolist and yum clean all is necessary?
Thanks, Yinsi
On Thu, Oct 29, 2020 at 05:31:56PM +0800, Wang Chenglong wrote:
[What] The docker file for build a container to provide network time synchronization service for virtual and physical machines.
Signed-off-by: Wang Chenglong 18509160991@163.com
container/ntp-server/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 container/ntp-server/Dockerfile
diff --git a/container/ntp-server/Dockerfile b/container/ntp-server/Dockerfile new file mode 100644 index 0000000..76f2a0e --- /dev/null +++ b/container/ntp-server/Dockerfile @@ -0,0 +1,18 @@
+RUN yum repolist
No need add this.
Thanks, Wang Yong