【问题标题】:How to make docker-credential-pass be accessible by another user on the system?如何使系统上的其他用户可以访问 docker-credential-pass?
【发布时间】:2021-11-14 10:56:54
【问题描述】:

我已经安装了 gitlab-runner,它默认在系统上创建用户 gitlab-runner 并将其添加到 docker 组。我决定尝试从 gitlab-runner shell 帐户中的 docker login 来调查我在管道上登录时出错的原因。我注意到,当尝试通过 GUI 从整个系统中注销我的默认用户 freshuser 并使用 gitlab-runner 用户登录时,它可以工作,它会提示我写一个密码但是当我使用默认系统用户 freshuser 时,我没有收到 docker-credential-pass 助手的密码提示。所以我尝试登录并存储了密码。同样,当我想使用 GnuPG 创建用于存储 docker 登录凭据的密钥时,密码提示不会仅在我使用 gitlab-runner 登录时出现。请注意,在推送到容器注册表时也会发生这种情况。谁能告诉我这是怎么回事?

我不断收到此错误:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/docker/credentials/store.py", line 79, in _execute
    output = subprocess.check_output(
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/docker-credential-pass', 'get']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
    data = store.get(registry)
  File "/usr/lib/python3.9/site-packages/docker/credentials/store.py", line 35, in get
    data = self._execute('get', server)
  File "/usr/lib/python3.9/site-packages/docker/credentials/store.py", line 93, in _execute
    raise errors.process_store_error(e, self.program)
docker.credentials.errors.StoreError: Credentials store docker-credential-pass exited with "exit status 2: gpg: decryption failed: No secret key".
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3.9/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3.9/site-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3.9/site-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/compose/cli/main.py", line 862, in push
    self.project.push(
  File "/usr/lib/python3.9/site-packages/compose/project.py", line 828, in push
    service.push(ignore_push_failures)
  File "/usr/lib/python3.9/site-packages/compose/service.py", line 1260, in push
    output = self.client.push(repo, tag=tag, stream=True)
  File "/usr/lib/python3.9/site-packages/docker/api/image.py", line 480, in push
    header = auth.get_config_header(self, registry)
  File "/usr/lib/python3.9/site-packages/docker/auth.py", line 47, in get_config_header
    authcfg = resolve_authconfig(
  File "/usr/lib/python3.9/site-packages/docker/auth.py", line 324, in resolve_authconfig
    return authconfig.resolve
_authconfig(registry)
  File "/usr/lib/python3.9/site-packages/docker/auth.py", line 235, in resolve_authconfig
    cfg = self._resolve_authconfig_credstore(registry, store_name)
  File "/usr/lib/python3.9/site-packages/docker/auth.py", line 280, in _resolve_authconfig_credstore
    raise errors.DockerException(
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-pass exited with "exit status 2: gpg: decryption failed: No secret key".')

更新:我尝试将用户 gitlab-runner 添加到默认系统用户组,但仍然没有成功。

系统从 gitlab-runner 帐户登录时收到的密码提示:

【问题讨论】:

    标签: linux docker docker-compose gitlab


    【解决方案1】:

    我刚刚从这里找到答案,我必须将 gitlab-runner 添加到控制列表才能使用显示:

    https://askubuntu.com/questions/654966/enable-x-display-access-for-local-user

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 2018-09-21
      • 2018-07-07
      • 1970-01-01
      • 2020-12-12
      • 1970-01-01
      相关资源
      最近更新 更多