我正在尝试使用Habitus构建Docker镜像,以便我可以安全地将构建时间机密(github ssh密钥)传递给docker。
我的Habitus构建文件:
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
},
我在构建过程中遇到以下错误:
由于Post,步骤测试/测试的构建失败 https://192.168.99.100:59124/build?dockerfile=Dockerfile.generated&rm=1&t=search%2Fservice: 拨打tcp 192.168.99.100:59124:i / o timeout
我做错了什么?
我正在关注此流程 - https://dzone.com/articles/using-ssh-private-keys-securely-in-docker-build
答案 0 :(得分:2)
自己解决了。不得不连接到192.168.99.100:2376