gpt4 book ai didi

docker - 使用 habitus 构建 docker 镜像的问题

转载 作者:行者123 更新时间:2023-12-02 21:26:02 25 4
gpt4 key购买 nike

我正在尝试使用 Habitus 构建 Docker 镜像,以便我可以安全地将构建时间 secret (github ssh key )传递给 docker。

我的习惯构建文件:

build:
version: 2016-03-14
steps:
builder:
name: search/poirot
dockerfile: Dockerfile
secrets:
id_rsa:
type: file
value: _env(HOME)/.ssh/id_rsa
cleanup:
commands:
- rm -rf /root/.ssh/

我的机器上安装了最新的 Docker for Mac。我正在运行这个命令来构建:

sudo ./habitus --certs=$HOME/.docker/machine/certs/ --host=192.168.99.100:59124



我正在使用“~/.docker/machine/machines/default/config.json”中的 IP 和端口
Content:
"Driver": {
"IPAddress": "192.168.99.100",
"MachineName": "default",
"SSHUser": "docker",
"SSHPort": 59124,
"SSHKeyPath": "/Users/shiladityamandal/.docker/machine/machines/default/id_rsa",
"StorePath": "/Users/shiladityamandal/.docker/machine",
"SwarmMaster": false,
"SwarmHost": "tcp://0.0.0.0:3376",
"SwarmDiscovery": "",
"VBoxManager": {},
"HostInterfaces": {},
"CPU": 1,
"Memory": 2048,
"DiskSize": 20000,
"NatNicType": "82540EM",
"Boot2DockerURL": "",
"Boot2DockerImportVM": "",
"HostDNSResolver": false,
"HostOnlyCIDR": "192.168.99.1/24",
"HostOnlyNicType": "82540EM",
"HostOnlyPromiscMode": "deny",
"NoShare": false,
"DNSProxy": true,
"NoVTXCheck": false
},

我在构建过程中不断收到以下错误:

Build for step test/test failed due to Post https://192.168.99.100:59124/build?dockerfile=Dockerfile.generated&rm=1&t=search%2Fservice: dial tcp 192.168.99.100:59124: i/o timeout



我究竟做错了什么?

我正在关注这个过程- https://dzone.com/articles/using-ssh-private-keys-securely-in-docker-build

最佳答案

自己解决了。必须连接到 192.168.99.100:2376

关于docker - 使用 habitus 构建 docker 镜像的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38070972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com