Praveen,

In order to use the Docker Packer container, you need to give it a mount
point during startup so that the container knows about your local file
system and can easily reference it. The mount point can be built into the
docker run command like so:

docker run -it --mount
type=bind,source=/absolute/path/to/template.json,target=/mnt/template2.json
hashicorp/packer:latest build /mnt/template2.json

In the --mount option, you should use the full path to your template2.json
file. Then the container will be able to read it from its mount point and
execute the Packer build on the file. If you modify the paths in that
example above and put your own paths in, it should work ok.

On Sun, May 24, 2020 at 3:16 PM Praveen Jaiswal <[email protected]> wrote:

> I am using Hashicorp packer official docker image to validate and create a
> custom AMI. Below is the command I am using to validate the template2.json
> file which has the code to create custom AMI. I am using octopus deploy
> worker pool to execute this command.
>
>      docker run -i ee26c209af37 validate template2.json
>
>
> but it's not able to detect the template2.json file and is giving "No such
> file or directory". Can you please advise if you guys have faced this kind
> of scenario.I have tried giving full path before template2.json also but
> same error.
>
> --
> 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/hashicorp/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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/b01258ef-e58d-49f0-b688-f56b60d935c0%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/b01258ef-e58d-49f0-b688-f56b60d935c0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
JP Toto   |   [email protected]   |   http://jptoto.jp   |   @jptoto
<http://twitter.com/jptoto>

-- 
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/hashicorp/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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAAYNrX8yakhFNB6sRMgHh9vMErZX_a9_-k%2B5RrY2C_Ds111hng%40mail.gmail.com.

Reply via email to