简体   繁体   English

当我使用私有容器时,GitHub Actions flutter-action 作业失败

[英]GitHub Actions flutter-action job fails when I use a private container

Container registry setup容器注册表设置

I use the following Dockerfile to create an image that I then push to google cloud container registry as a private image.我使用以下 Dockerfile 创建一个图像,然后将其作为私有图像推送到谷歌云容器注册表。 I want to run my CD workflow in my workflow so that I can fetch deployment credentials that I store within my image.我想在我的工作流程中运行我的 CD 工作流程,以便我可以获取存储在我的映像中的部署凭据。

Side Note: Not sure if this is the safest method to be managing sensitive files such as .jks files I need to deploy my app to play store.旁注:不确定这是否是管理敏感文件(例如.jks文件)的最安全方法,我需要将应用程序部署到 Play 商店。 I'd appreciate it if anyone could shed some light on this as well (Not sure if I should move this side note to a different SO question).如果有人也能对此有所了解,我将不胜感激(不确定我是否应该将此旁注移至另一个 SO 问题)。

FROM ubuntu:latest

COPY Gemfile .
COPY Gemfile.lock .
COPY fastlane/ ./fastlane/

Workflow configuration工作流配置

Following is the contents of my workflow configuration in .github/workflows/main.yml .以下是我在.github/workflows/main.yml中的工作流配置内容。 See here for complete file . 有关完整文件,请参见此处

# This is a basic workflow to help you get started with Actions

# [ ... ]

jobs:
  build:
    runs-on: ubuntu-latest

    container:
      image: gcr.io/positive-affirmations-313800/droid-deploy-env:latest
      credentials:
        username: _json_key
        password: ${{ secrets.GCR_JSON_KEY }}

    steps:
      - uses: actions/checkout@v2
        working-directory: $HOME

      - uses: actions/setup-java@v1
        working-directory: $HOME
        with:
          java-version: '12.x'

      - uses: subosito/flutter-action@v1
        working-directory: $HOME
        with:
          flutter-version: '2.0.5'

      # [ ... ]

Error occured:(发生了错误:(

But I keep getting this error:但我不断收到此错误:

Full logs available here 此处提供完整日志

图片

I found the solution to the problem.我找到了问题的解决方案。

I was just missing xz-utils on my container so I updated my docker image to install it我只是在我的容器上缺少 xz-utils,所以我更新了我的 docker 映像来安装它

Referenced from the related github issue here引用自相关的github 问题here

FROM ubuntu:latest

RUN apt-get update && apt-get install -y \
  xz-utils \
  git \
  android-sdk \
  && rm -rf /var/lib/apt/lists/*

COPY Gemfile .
COPY Gemfile.lock .
COPY fastlane/ ./fastlane/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在私有 docker 容器中运行整个 GitHub 操作工作流作业 - Run entire GitHub Actions workflow job in private docker container 在容器中运行步骤时,Github Actions工作流程失败 - Github Actions workflow fails when running steps in a container 如何在 github 操作中使用私有 docker 图像 - How can I use private docker image in github actions Github 将容器推送到 Github 容器注册表的操作工作流程失败并显示“未经身份验证” - Github Actions workflow for pushing a container to Github Container Registry fails with "unauthenticated" 您如何构建 docker 映像并将其用作 GitHub 操作中下一个作业的容器? - How do you build a docker image and use it as the container for the next job in GitHub actions? GitHub 操作:获取所有作业命令以在 Docker 容器中运行 - GitHub Actions: Get all job commands to run in a Docker container 在操作中通过 github 操作中的主机名访问容器 - Access a container by hostname in github actions from within an action 部署到 DigitalOcean 时,GitHub 操作失败 - GitHub action fails when deploying to DigitalOcean 将 docker 图像推送到 ECR 时,Github 操作失败 - Github actions fails when pushing docker image to ECR 有没有办法将 action.yml 与容器存储库的 GitHub 操作一起使用 - Is there a way to use action.yml with container repository's GitHub action
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM