在 docker 上运行的打包机,亚马逊/谷歌构建器不工作
我的打包器配置非常基本。
source "amazon-ebs" "autogenerated_1" {
ami_name = "bharat-1"
instance_type = "t2.micro"
region = "us-west-2"
source_ami = "ami-b63ae0ce"
ssh_username = "centos"
}
build {
description = "AWS image"
sources = ["source.amazon-ebs.autogenerated_1"]
从我的计算机(CentOS 7.9 x86)运行时工作正常。
(venv) [bmukheja@devserver-bkumar-2 database_ami_project]$ packer build packer_config_4.pkr.hcl
googlecompute.autogenerated_1: output will be in this color.
==> googlecompute.autogenerated_1: Checking image does not exist...
==> googlecompute.autogenerated_1: Creating temporary RSA SSH key for instance...
==> googlecompute.autogenerated_1: Using image: centos-7-v20220126
==> googlecompute.autogenerated_1: Creating instance...
googlecompute.autogenerated_1: Loading zone: us-west2-a
googlecompute.autogenerated_1: Loading machine type: n1-standard-1
googlecompute.autogenerated_1: Requesting instance creation...
googlecompute.autogenerated_1: Waiting for creation operation to complete...
googlecompute.autogenerated_1: Instance has been created!
==> googlecompute.autogenerated_1: Waiting for the instance to become running...
googlecompute.autogenerated_1: IP: 34.94.120.61
==> googlecompute.autogenerated_1: Using SSH communicator to connect: 34.94.120.61
==> googlecompute.autogenerated_1: Waiting for SSH to become available...
但我的要求是在同一台计算机上运行的基于 Centos 7.9 的 docker 容器内运行它,packer 无法正常运行,如下所示。
packer build packer_config_4.pkr.hcl
0 0
我无法理解这里的问题。此外,当我尝试通过传递 PACKER_LOG=1
来调试加壳器时,STDERR 上没有显示任何内容。 有谁知道我哪里出错了?
My packer configuration is pretty basic.
source "amazon-ebs" "autogenerated_1" {
ami_name = "bharat-1"
instance_type = "t2.micro"
region = "us-west-2"
source_ami = "ami-b63ae0ce"
ssh_username = "centos"
}
build {
description = "AWS image"
sources = ["source.amazon-ebs.autogenerated_1"]
This is working fine when run from my computer(CentOS 7.9 x86).
(venv) [bmukheja@devserver-bkumar-2 database_ami_project]$ packer build packer_config_4.pkr.hcl
googlecompute.autogenerated_1: output will be in this color.
==> googlecompute.autogenerated_1: Checking image does not exist...
==> googlecompute.autogenerated_1: Creating temporary RSA SSH key for instance...
==> googlecompute.autogenerated_1: Using image: centos-7-v20220126
==> googlecompute.autogenerated_1: Creating instance...
googlecompute.autogenerated_1: Loading zone: us-west2-a
googlecompute.autogenerated_1: Loading machine type: n1-standard-1
googlecompute.autogenerated_1: Requesting instance creation...
googlecompute.autogenerated_1: Waiting for creation operation to complete...
googlecompute.autogenerated_1: Instance has been created!
==> googlecompute.autogenerated_1: Waiting for the instance to become running...
googlecompute.autogenerated_1: IP: 34.94.120.61
==> googlecompute.autogenerated_1: Using SSH communicator to connect: 34.94.120.61
==> googlecompute.autogenerated_1: Waiting for SSH to become available...
But my requirement is to run it inside a Centos 7.9 based docker container running on the same computer, packer doesn't run properly as below.
packer build packer_config_4.pkr.hcl
0 0
I'm unable to understand the issue here. Moreover, when I try to debug packer by passing PACKER_LOG=1
nothing appears on STDERR.
Does anyone know where I'm going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论