Thanks for the tip!

Here's my full template 
- https://gist.github.com/sirocode/909f9f90bb7756cf3594d1ea3505d645 
("device_type" has been added)


I just want to do really simple thing (as a first step with Packer and 
amazon-chroot builder) - to get CoreOS of required version with a docker 
image downloaded locally.

"source_ami" mentioned in the template was done the following way:

1. Run my own ebs-backed instance (with default setting) using public HVM 
image of the latest release of CoreOS
2. Stopped the instance and took AMI image from the stopped instance
3. Started the instance, logged in, sudo to root, configured 
~/.aws/credentials
4. Run the packer build


# ./packer build coreos-1122.2.0-hvm-aws-chroot.json
build-aws-hmv-ebs output will be in this color.

==> build-aws-hmv-ebs: Prevalidating AMI Name...
==> build-aws-hmv-ebs: Gathering information about this EC2 instance...
==> build-aws-hmv-ebs: Inspecting the source AMI...
==> build-aws-hmv-ebs: Checking the root device on source AMI...
==> build-aws-hmv-ebs: Creating the root volume...
==> build-aws-hmv-ebs: Attaching the root volume to /dev/sdg
==> build-aws-hmv-ebs: Mounting the root device...
==> build-aws-hmv-ebs: Mounting additional paths within the chroot...
    build-aws-hmv-ebs: Mounting: /proc
    build-aws-hmv-ebs: Mounting: /sys
    build-aws-hmv-ebs: Mounting: /dev
    build-aws-hmv-ebs: Mounting: /dev/pts
    build-aws-hmv-ebs: Mounting: /proc/sys/fs/binfmt_misc
==> build-aws-hmv-ebs: Copying files from host to chroot...
    build-aws-hmv-ebs: /etc/resolv.conf
==> build-aws-hmv-ebs: Error copying file: exit status 1
==> build-aws-hmv-ebs: nStderr: cp: cannot create regular file 
'/mnt/packer-amazon-chroot-volumes/xvdg/etc/resolv.conf': No such file or 
directory
==> build-aws-hmv-ebs:
==> build-aws-hmv-ebs: Unmounting the root device...
==> build-aws-hmv-ebs: Detaching EBS volume...
==> build-aws-hmv-ebs: Deleting the created EBS volume...
Build 'build-aws-hmv-ebs' errored: Error copying file: exit status 1
nStderr: cp: cannot create regular file 
'/mnt/packer-amazon-chroot-volumes/xvdg/etc/resolv.conf': No such file or 
directory


==> Some builds didn't complete successfully and had errors:
--> build-aws-hmv-ebs: Error copying file: exit status 1
nStderr: cp: cannot create regular file 
'/mnt/packer-amazon-chroot-volumes/xvdg/etc/resolv.conf': No such file or 
directory


==> Builds finished but no artifacts were created.


What I am missing?



пятница, 16 сентября 2016 г., 13:50:21 UTC+3 пользователь Rickard von Essen 
написал:
>
> If the directory doesn't exist you must create it, see 
> https://www.packer.io/docs/provisioners/file.html#destination
>
> If attach your full template plus scripts I can probably point out what is 
> wrong. 
>
> If you need fast builds I recommend that you add both amazon-ebs and 
> amazon-chroot to your template and run with packer build -only=amazon-ebs 
> template.json after you have a build that works in the way you expect you 
> switch to -only=amazon-chroot. 
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/6b1a729d-a4ac-4caa-8c81-bd828d02bc47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to