vmware packer build inside docker with http_directory setting

843 views
Skip to first unread message

Dan Tran

unread,
Nov 25, 2016, 4:43:18 AM11/25/16
to Packer

Hi 

Since the build is inside docker, packer dynamic http server used by 'http_directory'  setting is not visible to my ESX.

I wonder if anyone has a solution for this issue?

Very much appreciate any help

Thanks

-Dan

Rickard von Essen

unread,
Nov 25, 2016, 5:42:03 AM11/25/16
to Packer
Could you elaborate a bit, didn't really get your setup.

Dan Tran

unread,
Nov 25, 2016, 1:22:19 PM11/25/16
to Packer

with 'http_directory' setting,  packer spins a http server(with port range) to host my sles12 kickstart file[1] access by ESX during build

since the build is inside docker, its IP address is 172.* and it is not visible outside of my container

-Dan

Rickard von Essen

unread,
Nov 25, 2016, 3:26:47 PM11/25/16
to packe...@googlegroups.com

Ok I interpret it as you run packer inside a docker container.

There is two solutions.

1) put the Kickstart file on a floppy an old it from that

2) fix the http port and expose that from the container. This requires that know the docker hosts IP and portmapping so you can get this into the boot_command.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/baf475cf-758f-4396-9884-24ed4bad4da6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Tran

unread,
Nov 25, 2016, 8:27:40 PM11/25/16
to Packer

solution 1 sounds self-contained, but we had a hard time with the floppy device before.  it intermittently failed very often and http_directory is a bless

solution 2: sounds very hard. I can discover the docker host, lock the http port inside docker,  how do i push  it to boot_command?

-Dan

Rickard von Essen

unread,
Nov 26, 2016, 3:07:31 AM11/26/16
to packe...@googlegroups.com

You can use a user variable and interpolate it in boot_command instead of HTTPIP.

If you are building within CI maybe you can reference the Kickstart files directly from the workspace over http.

There have been some work done lately with floppy_files and floppy_dirs so it might be worth testing it again if you haven't tried it in a recent version.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Nov 26, 2016, 3:24:22 AM11/26/16
to packe...@googlegroups.com
you can put the ks outside packer in a known ip and use that in the boot line.

Or you can use a custom iso and put the ks inside the iso.

or you can use %pre and parse the command line and grab the info from there

or you can use floppy

I have been using floppy in 0.11 and 0.12 and no problems for windows or linux / virtualbox or vmware

Alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
Nov 26, 2016, 3:59:46 AM11/26/16
to packe...@googlegroups.com

And of course you can run the container with --network=host


Dan Tran

unread,
Nov 27, 2016, 4:14:06 AM11/27/16
to Packer

Bingo!!!  Acceptable for me for this use case

Very appreciate for all the helps

-Dan

Ram Maram

unread,
Apr 27, 2017, 5:38:04 PM4/27/17
to Packer
Hi Dan,

We are trying to build vmware packer images inside container, we have created a docker image with vmware workstation, vmware Vix and packer. But the packer builds are failing with cannot start vm error. Would you be able to share how you guys set it up to build the images?

Rickard von Essen

unread,
Apr 28, 2017, 2:30:16 AM4/28/17
to packe...@googlegroups.com
Ram, Dan is building on a remote vmware ESXi only running packer inside a container, not vmware. 

On Apr 27, 2017 23:38, "Ram Maram" <ram.m...@gmail.com> wrote:
Hi Dan,

We are trying to build vmware packer images inside container, we have created a docker image with vmware workstation, vmware Vix and packer. But the packer builds are failing with cannot start vm error. Would you be able to share how you guys set it up to build the images?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages