docker - 在 github ci 中进入 docker 容器之前如何在主机中运行命令

标签 docker ubuntu github-actions archlinux

我试图在进入docker容器(arch linux)之前在主机系统上安装一个包,即(ubuntu-latest)
我尝试了很多语法,但我弄错了

on: [push]
jobs:
  update-aur:
    runs-on: ubuntu-latest
    steps:
      - run : sudo apt-get install runc
    container: archlinux
    steps:
      - run: |
          pacman --noconfirm -Syu 
          pacman --noconfirm -S base-devel 
这给出了已经定义的步骤错误

最佳答案

如果运行机器配置对构建很重要,请尝试使用 self-hosted runner .

  • 您可以在某些云提供商(例如 AWS、Azure 等)中创建 VM,并将其注册到 GitHub-CI。
  • 安装 GitHub-CI 服务
  • 安装您需要的所有实用程序
  • 将运行器注册到存储库
  • 更改 run-on 的构建脚本指向自托管运行者

  • 您可以在 GitHub-CI Docs 中找到更多信息

    关于docker - 在 github ci 中进入 docker 容器之前如何在主机中运行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66160057/

    相关文章:

    nginx - 为什么当我尝试挂载卷时 Docker 无法打开 nginx.conf?

    java - 尝试使用 docker 运行 jar 时出现 "Unable to access jarfile"

    docker - 通过Docker在Raspberry Zero上支持dotnet核心

    linux - vim 中 setpos 和 getpos 的奇怪行为

    java - Ubuntu 无法启动另一个 Java 线程

    linux - Docker镜像导入错误: “Base layer cannot have tombstones”

    python - 如何在 ubuntu 上更改 python-setuptools 的 apt-cache 版本?

    github-actions - GitHub 操作将文件简单地分类到输出

    javascript - 如何在Github中自动打开PR列表?

    continuous-integration - 将 GerritHub 与 GitHub Actions 结合使用