Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-buildimage] sync timezone to docker, so the docker has the cor… #1434

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dockers/docker-basic_router/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-dhcp-relay/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

# Remove stale rsyslog PID file if it exists
rm -f /var/run/rsyslogd.pid

Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-fpm-frr/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid
service rsyslog start
service frr start
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-fpm-gobgp/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

mkdir -p /etc/quagga
sonic-cfggen -d -t /usr/share/sonic/templates/gobgpd.conf.j2 > /etc/gobgp/gobgpd.conf
sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/quagga/zebra.conf
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-fpm-quagga/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

mkdir -p /etc/quagga
sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/bgpd.conf.j2 > /etc/quagga/bgpd.conf

Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-lldp-sv2/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf

mkdir -p /var/sonic
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-orchagent/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

mkdir -p /etc/swss/config.d/

sonic-cfggen -d -t /usr/share/sonic/templates/switch.json.j2 > /etc/swss/config.d/switch.json
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-platform-monitor/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-saiserver-brcm/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

start_bcm()
{
[ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-saiserver-cavm/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-saiserver-mlnx/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

start_mlnx()
{
[ -e /dev/sxdevs/sxcdev ] || ( mkdir -p /dev/sxdevs && mknod /dev/sxdevs/sxcdev c 231 193 )
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-snmp-sv2/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

mkdir -p /etc/ssw
sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 > /etc/ssw/sysDescription

Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-teamd/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

TEAMD_CONF_PATH=/etc/teamd

rm -rf $TEAMD_CONF_PATH
Expand Down
1 change: 1 addition & 0 deletions files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ start() {
--log-opt max-size=2M --log-opt max-file=5 \
{%- endif %}
-v /var/run/redis:/var/run/redis:rw \
-v /etc/timezone:/etc/timezone:rw \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to configure as rw? can you mount as ro? since you want the timezone in docker to be in sync with baseimage, then you do not really want to change the timezone in the baseimage, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried ro, but dpkg-reconfigure -f noninteractive tzdata need write permission, or it will not update ok. this command will not change the file content.

-v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \
{%- if docker_container_name != "database" %}
-v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \
Expand Down
2 changes: 2 additions & 0 deletions platform/broadcom/docker-syncd-brcm/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

PLATFORM_DIR=/usr/share/sonic/platform

rm -f /var/run/rsyslogd.pid
Expand Down
2 changes: 2 additions & 0 deletions platform/cavium/docker-syncd-cavm/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions platform/centec/docker-syncd-centec/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions platform/marvell/docker-syncd-mrvl/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions platform/mellanox/docker-syncd-mlnx/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions platform/nephos/docker-syncd-nephos/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

dpkg-reconfigure -f noninteractive tzdata

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd
Expand Down
2 changes: 2 additions & 0 deletions platform/p4/docker-sonic-p4/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -e

dpkg-reconfigure -f noninteractive tzdata

# generate configuration
[ -d /etc/sonic ] || mkdir -p /etc/sonic

Expand Down
2 changes: 2 additions & 0 deletions platform/vs/docker-sonic-vs/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# generate configuration

dpkg-reconfigure -f noninteractive tzdata

[ -d /etc/sonic ] || mkdir -p /etc/sonic

SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
Expand Down