【问题标题】:Enabling DOCKER_CONTENT_TRUST causes docker & docker-compose commands to fail启用 DOCKER_CONTENT_TRUST 会导致 docker & docker-compose 命令失败
【发布时间】:2021-06-15 14:19:21
【问题描述】:

一个。在终端中运行以下导出命令:

export DOCKER_CONTENT_TRUST=1

b.运行:

docker-compose up --build -d

失败:

ERRO[0000] Can't close tar writer: io: read/write on closed pipe
error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.41/build?buildargs=%7B%22EIS_VERSION%22%3A%222.4%22%2C%22GO_VERSION%22%3A%221.12%22%2C%22HOST_TIME_ZONE%22%3A%22Asia%2FKolkata%22%2C%22HTTPS_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22HTTP_PROXY%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22NO_PROXY%22%3A%22127.0.0.1%2Clocalhost%22%2C%22UBUNTU_IMAGE_VERSION%22%3A%2218.04%22%2C%22http_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22https_proxy%22%3A%22http%3A%2F%2Fproxy-xyz.com%3A911%22%2C%22no_proxy%22%3A%22127.0.0.1%2Clocalhost%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfiles%2FDockerfile.eisbase&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=ia_eisbase%3A2.4&target=&ulimits=null&version=1: invalid reference format
Sending build context to Docker daemon  12.55kB

我认为 DOCKER_CONTENT_TRUST 锁定了一些文件 wrt 导致此错误的 docker。

【问题讨论】:

标签: bash docker shell docker-compose


【解决方案1】:

docker-compose 不支持镜像签名或镜像签名验证。

——https://github.com/sse-secure-systems/trusted-compose

您需要为 docker-compose 实现一个包装器或使用现有的包装器,以便使用内容信任和 docker-compose。

我不使用personnalytrusted-compose,但它看起来是一个很好的解决方案:https://github.com/sse-secure-systems/trusted-compose

其他资源:

【讨论】:

  • 特别是对于构建命令,我不相信这是真的了。您可以设置COMPOSE_DOCKER_CLI_BUILD=1,这应该是现在使用 docker 本身进行构建的默认值。
猜你喜欢
  • 1970-01-01
  • 2020-11-02
  • 1970-01-01
  • 2022-01-16
  • 1970-01-01
  • 2017-07-22
  • 1970-01-01
  • 2019-04-28
  • 1970-01-01
相关资源
最近更新 更多