Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

tar driver does not work on MacOS

未关闭
#276 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
macos
领域
devops, testing-qa

调研方向

从处理 CentOS 镜像的 tar 驱动路径以及 /usr/bin/chfn 的权限更新失败开始。在 macOS 上重现 base-container-test.yml 的情况,然后将其与 Linux tar 驱动和 macOS docker 驱动的运行结果进行比较。在 macOS 上使用 driver="tar" 时,提供的 fileContentTests 和 fileExistenceTests 通过即表示完成。

由索引模型根据 Issue 内容生成。

描述

I am trying to run some basic fileContentTests and fileExistenceTests on MacOS with tar driver

schemaVersion: 2.0.0

fileContentTests:
  - name: "os-version"
    path: "/etc/os-release"
    expectedContents: [
      'NAME="CentOS Linux"',
      'ID="centos"',
      'ID_LIKE="rhel fedora"',
      'VERSION_ID="7"',
      'CPE_NAME="cpe:/o:centos:centos:7"',
      'HOME_URL="https://www.centos.org/"',
      'BUG_REPORT_URL="https://bugs.centos.org/"',
      'CENTOS_MANTISBT_PROJECT="CentOS-7"',
      'CENTOS_MANTISBT_PROJECT_VERSION="7"',
      'REDHAT_SUPPORT_PRODUCT="centos"',
      'REDHAT_SUPPORT_PRODUCT_VERSION="7"',
    ]

With this bazel test setup

container_test(
    name = "base-container-test-tar",
    size = "small",
    configs = ["testdata/base-container-test.yml"],
    driver = "tar",
    image = "@centos-7//image:image",
)

Which resulted in the following error

================================================
====== Test file: base-container-test.yml ======
================================================
time="2021-03-02T22:14:35Z" level=error msg="Error updating file permissions on /var/folders/l2/_dzk7hhs4gd9rpfb7c6hj63cc99qy8/T/..centos-7imageimage.tar@sha256:af9789f8f68cd80ff836d076542f4f22a519c43554c88d2a2710c174f29803a4312023790/usr/bin/chfn"
=== RUN: os-version
--- FAIL
duration: 0s
Error: error creating driver: processing tar image reference: getting filesystem for image: chmod /var/folders/l2/_dzk7hhs4gd9rpfb7c6hj63cc99qy8/T/..centos-7imageimage.tar@sha256:af9789f8f68cd80ff836d076542f4f22a519c43554c88d2a2710c174f29803a4312023790/usr/bin/chfn: operation not permitted

I am using bazel rules_docker on latest HEAD https://github.com/bazelbuild/rules_docker/commit/e15c9ebf203b7fa708e69ff5f1cdcf427d7edf6f

This test passed just fine when run on Linux + tar-driver or MacOS + docker-driver. But not MacOS + tar-driver.

主要语言
Go
星标
2.5k
派生
213
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GoogleContainerTools/container-structure-test 的其他 Issue

查看 GoogleContainerTools/container-structure-test 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。