3

我为公证人设置了以下基础设施:

  1. 公证服务器
  2. 公证人
  3. 使用 docker-compose 的“公证服务器”和“公证签名者”的 mariadb 数据库。

我想使用我的私有 docker 注册表(nexus),它部署在不同的机器上,并带有我已经启动并运行的公证基础设施。

你能告诉我一步一步的过程吗?

我正在扩展我的发现:

我正在尝试使用此链接https://github.com/theupdateframework/notary中提供的说明设置我自己的公证服务

我做了什么:

git clone https://github.com/theupdateframework/notary.git
cd notary
3 )$ docker-compose build
$ docker-compose up -d

执行上述步骤后,我在我的 docker 主机上启动并运行了 3 个容器(在本地笔记本电脑上运行 -Ubuntu16.04)

  1. 公证服务器
  2. notary_signer
  3. 玛丽亚数据库:10.1.28

现在,为了将我的本地公证服务与私有注册表关联(作为容器托管在其他机器上)一起使用,我已经完成了以下步骤:

/etc/hosts entry
127.0.0.1 notary-server
mkdir -p ~/.notary && cp cmd/notary/config.json cmd/notary/root-ca.crt ~/.notary

在此之后,我使用以下命令测试了连接并成功。

openssl s_client -connect :4443 -CAfile fixtures/root-ca.crt -no_ssl3 -no_ssl2

现在为了签署图像并将其推送到私有注册表,我设置了以下环境变量。

DOCKER_CONTENT_TRUST_SERVER=https://notary-server:4443
DOCKER_CONTENT_TRUST=1

问题:当我发出如下所示的 docker push 命令时

sudo docker push nexus.xyz.com:5000/nginx:latest (我之前做过适当的标记)

它不经过签名,它直接将图像推送到私有注册表

但是当我使用

sudo docker push --disable-content-trust=false nexus.xyz.com:5000/nginx:latest

它签署了图像并推送,但在我使用时不显示任何受信任的内容

notary list nexus.xyz.com:5000/nginx:latest

问题:我需要做任何其他配置才能使用我自己的公证服务吗?

任何帮助将非常感激。

4

2 回答 2

1
sudo docker push --disable-content-trust=false nexus.xyz.com:5000/nginx:latest

以 root 用户身份运行,因此主目录发生了变化。

您应该尝试将 .docker 和 .notary 复制到根目录的主目录。或者将当前用户添加到 docker 组并运行不带 sudo 的 docker 命令。

于 2018-10-13T00:36:52.690 回答
0

正如你所描述的,我能够得到这个工作。虽然,当我推动时:

docker push localhost:5000/uname/nginx:latest

*注意我有自己的私人注册表在本地运行

此外,这使您不必编辑 /etc/hosts:

公证人 -s https://localhost:4443列出 localhost:5000/gt3389b/myfirstimage

于 2018-09-15T10:45:07.210 回答