From 9a1543caec75a7b02dd2ec9a1111756bb1716454 Mon Sep 17 00:00:00 2001 From: Ashley Cui Date: Tue, 30 Jun 2020 17:21:52 -0400 Subject: Add --tz flag to create, run --tz flag sets timezone inside container Can be set to IANA timezone as well as `local` to match host machine Signed-off-by: Ashley Cui --- libpod/container.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libpod/container.go') diff --git a/libpod/container.go b/libpod/container.go index 20688e3ee..8ea25d6a0 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -424,6 +424,10 @@ type ContainerConfig struct { // to 0, 1, 2) that will be passed to the executed process. The total FDs // passed will be 3 + PreserveFDs. PreserveFDs uint `json:"preserveFds,omitempty"` + + // Timezone is the timezone inside the container. + // Local means it has the same timezone as the host machine + Timezone string `json:"timezone,omitempty"` } // ContainerNamedVolume is a named volume that will be mounted into the @@ -1248,3 +1252,8 @@ func (c *Container) AutoRemove() bool { } return c.Spec().Annotations[define.InspectAnnotationAutoremove] == define.InspectResponseTrue } + +func (c *Container) Timezone() string { + return c.config.Timezone + +} -- cgit v1.2.3-54-g00ecf