Do not use two methods of syncing time at the same time

Method 1:

      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

Mount these inside container so that host and container time are in sync

Method 2:

Pass the TZ environment variable and run the following inside container

$ ln -snf /usr/share/zoneinfo/Europe/Berlin /etc/localtime && echo Europe/Berlin > /etc/timezone
This commit is contained in:
herlesupreeth
2020-09-25 08:37:47 +02:00
parent 27fad29530
commit cc2c596987
14 changed files with 15 additions and 15 deletions

View File

@@ -48,4 +48,4 @@ sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' /etc/bind/named.conf
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/bind/named.conf sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/bind/named.conf
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -58,7 +58,7 @@ then
fi fi
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
cp /mnt/fhoss/hss.sh / cp /mnt/fhoss/hss.sh /
cd / && ./hss.sh cd / && ./hss.sh

View File

@@ -40,4 +40,4 @@ sed -i 's|MONGO_IP|'$MONGO_IP'|g' install/etc/open5gs/hss.yaml
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/open5gs/hss.yaml sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/open5gs/hss.yaml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -65,4 +65,4 @@ sed -i 's|ICSCF_IP|'$ICSCF_IP'|g' /etc/kamailio_icscf/icscf.xml
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_icscf/icscf.xml sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_icscf/icscf.xml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -42,4 +42,4 @@ sed -i 's|PGW_IP|'$PGW_IP'|g' install/etc/open5gs/mme.yaml
sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/open5gs/mme.yaml sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/open5gs/mme.yaml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -27,6 +27,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
mongod --smallfiles --dbpath /var/lib/mongodb --logpath /var/log/mongodb/mongodb.log --bind_ip 0.0.0.0 mongod --smallfiles --dbpath /var/lib/mongodb --logpath /var/log/mongodb/mongodb.log --bind_ip 0.0.0.0

View File

@@ -38,7 +38,7 @@ while true; do
done done
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Grant privileges and set max connections # Grant privileges and set max connections
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by 'ims' WITH GRANT OPTION;" mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by 'ims' WITH GRANT OPTION;"

View File

@@ -41,4 +41,4 @@ sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' install/etc/open5gs/pcrf.yaml
sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/pcrf.yaml sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/pcrf.yaml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -74,7 +74,7 @@ sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' /etc/kamailio_pcscf/pcscf.xml
sed -i 's|RTPENGINE_IP|'$RTPENGINE_IP'|g' /etc/kamailio_pcscf/kamailio_pcscf.cfg sed -i 's|RTPENGINE_IP|'$RTPENGINE_IP'|g' /etc/kamailio_pcscf/kamailio_pcscf.cfg
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Add static route to route traffic back to UE as there is not NATing # Add static route to route traffic back to UE as there is not NATing
ip r add 192.168.101.0/24 via ${PGW_IP} ip r add 192.168.101.0/24 via ${PGW_IP}

View File

@@ -44,4 +44,4 @@ sed -i 's|EPC_DOMAIN|'$EPC_DOMAIN'|g' install/etc/open5gs/pgw.yaml
sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/pgw.yaml sed -i 's|PCSCF_IP|'$PCSCF_IP'|g' install/etc/open5gs/pgw.yaml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -55,7 +55,7 @@ if test "$NO_FALLBACK" = "yes" ; then
fi fi
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
set +e set +e
if [ -e /proc/rtpengine/control ]; then if [ -e /proc/rtpengine/control ]; then

View File

@@ -69,4 +69,4 @@ sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.xml
sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.xml sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.xml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -33,4 +33,4 @@ sed -i 's|SGW_IF|'$IF_NAME'|g' install/etc/open5gs/sgw.yaml
sed -i 's|DOCKER_HOST_IP|'$DOCKER_HOST_IP'|g' install/etc/open5gs/sgw.yaml sed -i 's|DOCKER_HOST_IP|'$DOCKER_HOST_IP'|g' install/etc/open5gs/sgw.yaml
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@@ -42,4 +42,4 @@ sed -i 's|MME_IP|'$MME_IP'|g' /etc/srslte/enb.conf
sed -i 's|ENB_IP|'$ENB_IP'|g' /etc/srslte/enb.conf sed -i 's|ENB_IP|'$ENB_IP'|g' /etc/srslte/enb.conf
# Sync docker time # Sync docker time
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone #ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone