Debian container9/13/2023 The script above is run with a docker exec (with or without -privilege doesn't make a difference). So, despite trying to set the time manually with ntpd (ntpdate is deprecated as per ), and do getting that I'm 14 seconds behind, the container doesn't get the time set. Sed 's/pool /#pool /g' /etc/ntp.conf > /tmp/Įcho "server 0." > /tmp/Įcho "server 1." > /tmp/Įcho "server 2." > /tmp/Įcho "server 3." > /tmp/Įcho "Date on ws container: `date` - correct: `(curl ?iso)2>/dev/null`" I would assume it's better to get NTP to work so that if drifts occur they are correct automatically, instead of setting by hand once the clock from my host system. Remote refid st t when poll reach delay offset jitter # vi /etc/ntp.conf # commented pools and added these servers However, before trying this, I simply tried to install ntp on the docker and set it up: # apt-get install ntp I noticed that my docker is possibly suffering from this issue, therefore now, each time I run the container, I also run: docker run -it -rm -privileged -pid=host php:7-apache nsenter -t 1 -m -u -n -i date -u $(date -u +%m%d%H%M%Y) To create it I use: docker run -d -p 80:80 -name myname -v "$PWD":/var/www/html php:7-apache I am creating a simple debian-based docker ( php:7-apache).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |