Sign inSign up

lecvalg/ntp

By lecvalg

•Updated over 2 years ago

Debian based container that setups the system date based on an ntp.conf file.

Image
0

110

lecvalg/ntp repository overview

⁠Overview

This debian based container uses the ntp package to setup the system date based on the /etc/ntpsec/ntp.conf file. The setup is performed when the container starts. However, any write action to the /etc/ntpsec/ntp.conf file after the startup setup will re-trigger the system date update.

In order to be able to setup the system date, the container needs the --privileged flag.

⁠Docker run command

docker run --detach --name ntp -v ~/ntp:/etc/ntpsec --privileged --restart=unless-stopped lecvalg/ntp:0.0.2

⁠Docker-compose

version: "3.9"
services:
  ntp:
    image: lecvalg/ntp:0.0.2
    container_name: ntp
    volumes:
      - "~/ntp:/etc/ntpsec"
    privileged: true
    restart: unless-stopped

⁠Known issues

None.

⁠Release notes

⁠0.0.2

⁠Fixes
  • First checks that the /etc/ntpsec/ntp.conf file exists, and if not creates it.
  • First checks that the /etc/ntpsec/ntp.conf file is not empty, and if it is fills it whith default content.

⁠0.0.1

First release.

⁠Known issues
  • A non-existent or empty /etc/ntpsec/ntp.conf file will prevent the container from working properly. Before running it, make sure the container /etc/ntpsec folder is bind mounted to a folder that contains a non-empty ntp.conf. Here is an example of a minimalistic ntp.conf file:
server pool.ntp.org

Tag summary

Content type

Image

Digest

sha256:9345ecc1d…

Size

73.3 MB

Last updated

over 2 years ago

docker pull lecvalg/ntp:0.0.2