大厅设置容器时区

发布于 2025-02-06 09:09:53 字数 76 浏览 2 评论 0原文

在我的大厅码头容器中,我希望时区是一个特定的时区(例如,美国/蒙特利尔)。

有没有办法在我的管道的YAML中声明集装箱时区?

In my concourse docker container I want the timezone to be a particular timezone (let's say america/montreal).

Is there a way to declare container timezone in my pipeline's yaml ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁许谁一生繁华 2025-02-13 09:09:53

必须满足要在容器2的条件中设置的时区:

  • 大厅任务所使用的图像必须是时区,即,如果ubuntu映像,则必须具有tzdata软件包>软件包安装了
  • > TZ必须设置ENV变量,例如tz = America/Montreal

这是用于示例TZ-WAIR图像的Docker文件:

# oozie/montreal
FROM ubuntu
ENV TZ=America/Montreal
RUN apt update && apt install -y tzdata

以下管道中包含嵌入的任务的管道会导致它导致时空的输出,可以用TZ变量覆盖单个命令:

jobs:
  - name: timezoned-task
    plan:
    - task: tz-aware
      config:
        platform: linux
        image_resource:
          type: docker-image
          source:
            repository: oozie/montreal
        run:
          path: /bin/bash
          args:
          - -c
          - |
            date
            TZ=UTC date

“

For timezone to be set in a container 2 conditions must be met:

  • the image used by the concourse task must be timezone-aware, i.e. in case of Ubuntu images it must have tzdata package installed
  • The TZ env variable has to be set, e.g. TZ=America/Montreal

This is a docker file for a sample TZ-aware image:

# oozie/montreal
FROM ubuntu
ENV TZ=America/Montreal
RUN apt update && apt install -y tzdata

The following pipeline with a task embedded in it results in a timezoned output, which can be overriden with a TZ variable for individual commands:

jobs:
  - name: timezoned-task
    plan:
    - task: tz-aware
      config:
        platform: linux
        image_resource:
          type: docker-image
          source:
            repository: oozie/montreal
        run:
          path: /bin/bash
          args:
          - -c
          - |
            date
            TZ=UTC date

timezoned task

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文