gpt4 book ai didi

docker - GitHub Action Ansible 检查 ubuntu :focal hangs on setting up tzdata without dialog

转载 作者:行者123 更新时间:2023-12-04 18:54:22 27 4
gpt4 key购买 nike

我正在使用这个 GitHub 操作:https://github.com/roles-ansible/check-ansible-ubuntu-focal-action

name: Ansible check ubuntu:focal
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:focal
uses: roles-ansible/check-ansible-ubuntu-focal-action@master
with:
targets: "local.yml"
group: "workstations"
hosts: "localhost"
它挂起,当我取消作业时,我在日志中看到:
  Setting up tzdata (2021a-0ubuntu0.20.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Error: The operation was canceled.
这是一个 docker 容器等待交互式输入来配置 tzdata 的情况。 .
如何在我自己的代码中解决这个问题?到目前为止我能想到的唯一解决方案是 fork GitHub Action 的上游 repo,并将这一行添加到 DockerfileRUN apt-get 之前命令:
ARG DEBIAN_FRONTEND=noninteractive
但如果我能自己解决,我想避免为上游做出贡献。
有任何想法吗?
作为引用,这是当前的 Dockerfile GitHub Action 的上游仓库: https://github.com/roles-ansible/check-ansible-ubuntu-focal-action/blob/master/Dockerfile
FROM ubuntu:focal

LABEL "maintainer"="L3D <l3d@c3woc.de>"
LABEL "repository"="https://github.com/roles-ansible/check-ansible-ubuntu-focal-action.git"
LABEL "homepage"="https://github.com/roles-ansible/check-ansible-ubuntu-focal-action"

LABEL "com.github.actions.name"="check-ansible-ubuntu-focal"
LABEL "com.github.actions.description"="Check ansible role or playbook with Ubuntu focal"
LABEL "com.github.actions.icon"="aperture"
LABEL "com.github.actions.color"="green"

RUN apt-get update -y && apt-get install -y \
software-properties-common \
build-essential \
libffi-dev \
libssl-dev \
python3-dev \
python3-pip \
git \
systemd

RUN pip3 install setuptools && pip3 install ansible

RUN ansible --version

ADD ansible-docker.sh /ansible-docker.sh
ENTRYPOINT ["/ansible-docker.sh"]

最佳答案

在我自己的代码中没有办法做到这一点,必须在上游完成更改。
我提出了一个拉取请求:https://github.com/roles-ansible/check-ansible-ubuntu-focal-action/pull/1/files
这是差异:

@@ -9,6 +9,8 @@ LABEL "com.github.actions.description"="Check ansible role or playbook with Ubun
9 9 LABEL "com.github.actions.icon"="aperture"
10 10 LABEL "com.github.actions.color"="green"
11 11
12 + ARG DEBIAN_FRONTEND=noninteractive
13 +
12 14 RUN apt-get update -y && apt-get install -y \
13 15 software-properties-common \
14 16 build-essential \
幸运的是,我的 PR 在 3 分钟内就获得了批准和合并。

关于docker - GitHub Action Ansible 检查 ubuntu :focal hangs on setting up tzdata without dialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69306036/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com