Sure.
{
"variables": {
"home": "{{env `HOME`}}",
"build_stamp": "{{env `DATE_STAMP`}}",
"packer_stamp": "{{env `PACKER_DATE_STAMP`}}",
"akm_version": "4.6.1",
"u_version": "18.04"
},
"builders": [
{
"type": "docker",
"image": "ubuntu:18.04",
"commit": true,
"changes": [
"USER admin",
"EXPOSE 22 6000 6001 6002 6003 5696",
"LABEL com.townsend.name=akm",
"LABEL com.townsend.build-date={{user `packer_stamp`}}",
"LABEL com.townsend.vendor='Hooray'",
"LABEL com.townsend.description='Blah'",
"LABEL com.townsend.url='https://google.com'",
"LABEL com.townsend.schema-version=1.0",
"LABEL com.townsend.version={{user `akm_version`}}-u{{user
`u_version`}}-{{user `build_stamp`}}"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": ["apt-get update; apt-get --yes install sudo curl wget"]
},
{
"type": "chef-solo",
"cookbook_paths": ["cookbooks"],
"run_list": ["akm::docker"]
},
{
"type": "shell",
"inline": ["echo 'vagrant' | sudo apt-get --yes --purge autoremove
chef"]
},
{
"type": "shell",
"inline": ["dpkg-query -f '${Package} ${Version}\n' -W >
/tmp/manifest; sleep 2"]
},
{
"type": "file",
"source": "/tmp/manifest",
"destination": "manifest",
"direction": "download"
},
{
"type": "shell",
"inline": ["rm /tmp/manifest"]
}
],
"post-processors": [
{
"type": "shell-local",
"inline": ["mv manifest manifests/manifest-akm-{{user
`akm_version`}}-u{{user `u_version`}}-{{user `build_stamp`}}-docker.txt"]
},
{
"type": "docker-tag",
"repository": "townsend/akm",
"tag": "{{user `akm_version`}}-u{{user `u_version`}}-{{user
`build_stamp`}}"
},
{
"type": "docker-save",
"path": "output-docker/akm-{{user `akm_version`}}-u{{user
`u_version`}}-{{user `build_stamp`}}.tar"
}
]
}
On Mon, May 6, 2019 at 8:35 AM Rickard von Essen <
[email protected]> wrote:
> Can you show the packer template you used first?
>
> On Mon, May 6, 2019 at 5:30 PM 'Nicholas Bayle' via Packer <
> [email protected]> wrote:
>
>> Should I open a feature request, or is there more to try?
>>
>> Thank you,
>> Nick
>>
>> On Wed, May 1, 2019 at 10:41 AM Nicholas Bayle <
>> [email protected]> wrote:
>>
>>> Yes:
>>>
>>> 2019/05/01 10:34:30 /usr/local/bin/packer: plugin process exited
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker image ls
>>> REPOSITORY TAG IMAGE ID
>>> CREATED SIZE
>>> townsend/akm *4.6.1-u18.04-201905011031* 34ee2413333d 2
>>> minutes ago 602MB
>>> ubuntu 18.04 d131e0fa2585 4
>>> days ago 102MB
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker save -o pickles.tar 34
>>> townsend/akm
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker image rm 34
>>> Untagged: townsend/akm:4.6.1-u18.04-201905011031
>>> Deleted:
>>> sha256:34ee2413333d8269c9425fdf41136b046d2851b29e1b454c7f2b851bd516097a
>>> Deleted:
>>> sha256:e61945fdf42b6ab49cef82486054eec7a280152a4fec5a0afca48913e63e68e7
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker image ls
>>> REPOSITORY TAG IMAGE ID
>>> CREATED SIZE
>>> ubuntu 18.04 d131e0fa2585 4 days
>>> ago 102MB
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker load -i pickles.tar
>>> 650c8878d56d: Loading layer 511.4MB/511.4MB
>>> Loaded image: townsend/akm:4.6.1-u18.04-201905011031
>>>
>>> nicholas@pickle:~/dev/chef-akm (master)$ docker image ls
>>> REPOSITORY TAG IMAGE ID
>>> CREATED SIZE
>>> townsend/akm *4.6.1-u18.04-201905011031* 34ee2413333d 3
>>> minutes ago 602MB
>>> ubuntu 18.04 d131e0fa2585 4
>>> days ago 102MB
>>>
>>>
>>> Thank you,
>>> Nick
>>>
>>> On Wed, May 1, 2019 at 1:10 AM Rickard von Essen <
>>> [email protected]> wrote:
>>>
>>>> Does it work as you expect if you do it manually with the docker cli?
>>>>
>>>> On Tue, Apr 30, 2019, 17:31 'Nicholas Bayle' via Packer <
>>>> [email protected]> wrote:
>>>>
>>>>> Indeed it is after docker-tag and the tags are empty when imported
>>>>> with: docker load -i blah.tar
>>>>>
>>>>> On Tue, Apr 30, 2019 at 12:58 AM Rickard von Essen <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> You should do this with the docker-tag post-processor and ensure the
>>>>>> it is in a sequence after docker-tag.
>>>>>>
>>>>>> On Mon, Apr 29, 2019, 23:46 'Nicholas Bayle' via Packer <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hello, when using docker save in general, you can specify tags. See:
>>>>>>>
>>>>>>> https://docs.docker.com/engine/reference/commandline/#cherry-pick-particular-tags
>>>>>>>
>>>>>>> However, with the docker-save post-processor, there doesn't appear
>>>>>>> to be a way to tag the exported image.
>>>>>>>
>>>>>>> I looked at the docker-tag post-processor, but this leaves the image
>>>>>>> in the repo, not exported to tar.
>>>>>>>
>>>>>>> Is there a way to accomplish this, or can this be a feature request?
>>>>>>>
>>>>>>> Nick
>>>>>>>
>>>>>>> --
>>>>>>> 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 [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D6VcTV9xX%3Drmkpzh5yVLpTu4fXjo5ArdUUH9wut04md9g%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D6VcTV9xX%3Drmkpzh5yVLpTu4fXjo5ArdUUH9wut04md9g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>> --
>>>>>> 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 [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-w1mxobF03dpg8aNJRRuY1dE-QOZLcZ_-B6%2BqYjCMrXg%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-w1mxobF03dpg8aNJRRuY1dE-QOZLcZ_-B6%2BqYjCMrXg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D67K6BAEv0i4NtLnZDCjqfEitOXQbniJM8Y9117xgifyA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D67K6BAEv0i4NtLnZDCjqfEitOXQbniJM8Y9117xgifyA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>>> 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 [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt_%3DzkkV%3Du7LQ1LUGCyRn7ZiEO4p0b4mcTR5N13-Z%2BkGbw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt_%3DzkkV%3Du7LQ1LUGCyRn7ZiEO4p0b4mcTR5N13-Z%2BkGbw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D4cLqwsGwdK%2B7aj9BResJU-5iCWX7bYULWCvT_KQd3sDA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D4cLqwsGwdK%2B7aj9BResJU-5iCWX7bYULWCvT_KQd3sDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-aHv%2BRkpyRC4VVPF%3DMw3nZ9HbwAdZ%2BK9TkPHXfKDGJBg%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-aHv%2BRkpyRC4VVPF%3DMw3nZ9HbwAdZ%2BK9TkPHXfKDGJBg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D4LqeKWHgruSDMSJmQ-zw87ZfiDG-7RKkiKGytWzJ1FKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.