I figured I was missing something like that.
That said, I get:
> docker inspect --format '{{ .ContainerConfig.Labels }}' 06a7e57ba554
> map[]
>
Here's the full output. Labels is null:
> docker inspect 06a7
> [
> {
> "Id":
> "sha256:06a7e57ba5549e6c2bd1bdbbd7ad6369bb471ee180b41e636cd2b60fc82f0f8f",
> "RepoTags": [],
> "RepoDigests": [],
> "Parent": "",
> "Comment": "Imported from -",
> "Created": "2019-03-18T18:19:25.921251641Z",
> "Container": "",
> "ContainerConfig": {
> "Hostname": "",
> "Domainname": "",
> "User": "",
> "AttachStdin": false,
> "AttachStdout": false,
> "AttachStderr": false,
> "Tty": false,
> "OpenStdin": false,
> "StdinOnce": false,
> "Env": null,
> "Cmd": null,
> "Image": "",
> "Volumes": null,
> "WorkingDir": "",
> "Entrypoint": null,
> "OnBuild": null,
> *"Labels": null*
> },
> "DockerVersion": "18.09.3",
> "Author": "",
> "Config": {
> "Hostname": "",
> "Domainname": "",
> "User": "",
> "AttachStdin": false,
> "AttachStdout": false,
> "AttachStderr": false,
> "Tty": false,
> "OpenStdin": false,
> "StdinOnce": false,
> "Env": null,
> "Cmd": null,
> "Image": "",
> "Volumes": null,
> "WorkingDir": "",
> "Entrypoint": null,
> "OnBuild": null,
> *"Labels": null*
> },
> "Architecture": "amd64",
> "Os": "linux",
> "Size": 571834611,
> "VirtualSize": 571834611,
> "GraphDriver": {
> "Data": {
> "MergedDir":
> "/var/lib/docker/overlay2/7a747e66900365c1a537cc8d11f9b226304211c22a13fea5be57a698cd5aea1a/merged",
> "UpperDir":
> "/var/lib/docker/overlay2/7a747e66900365c1a537cc8d11f9b226304211c22a13fea5be57a698cd5aea1a/diff",
> "WorkDir":
> "/var/lib/docker/overlay2/7a747e66900365c1a537cc8d11f9b226304211c22a13fea5be57a698cd5aea1a/work"
> },
> "Name": "overlay2"
> },
> "RootFS": {
> "Type": "layers",
> "Layers": [
>
> "sha256:ce86195a57b0d70635318da7f6123303ab8687b688cb458a55cd24be0fc8402d"
> ]
> },
> "Metadata": {
> "LastTagTime": "0001-01-01T00:00:00Z"
> }
> }
> ]
>
On Tue, Mar 19, 2019 at 12:54 AM Rickard von Essen <
[email protected]> wrote:
> docker ps shows the running Docker *containers*
>
> You should use:
> docker inspect <image> --format "{{ .ContainerConfig.Labels }}"
>
> Images labels doesn't propagate from a *image *to a *container* started
> from it.
>
> On Mon, Mar 18, 2019 at 7:22 PM 'Nicholas Bayle' via Packer <
> [email protected]> wrote:
>
>> I'm new to docker, so maybe this is just my ignorance, but does adding
>> docker labels actually work with packer?
>>
>> 9 "builders": [{
>>> 10 "type": "docker",
>>> 11 "image": "ubuntu:18.04",
>>> 12 "export_path": "output-docker/akm-{{user `akm_version`}}-u{{user
>>> `u_version`}}-{{user `build_stamp`}}.tar",
>>> 13 "changes": [
>>> 14 "USER admin",
>>> 15 "EXPOSE 6000 6001 6002 6003 5696",
>>> 16 "LABEL com.townsend.version=1.0"
>>> 17 ]
>>> 18 }],
>>>
>>
>> The resulting image has no labels.
>>
>> docker ps --format "table {{.ID}}\t{{.Labels}}"
>>> CONTAINER ID LABELS
>>> 11b32092d884
>>>
>>
>> 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%3D4w4um12GXPUbYiT%2BtUDMCkYBTNY%2B-VHpxMmoN%3D5QFjYQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/packer-tool/CAGzi4%3D4w4um12GXPUbYiT%2BtUDMCkYBTNY%2B-VHpxMmoN%3D5QFjYQ%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/CALz9Rt9ybUaQ5V6A3Vto76kjB_%3DhXTGLNSq0SQA2rZTqG6hJdA%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt9ybUaQ5V6A3Vto76kjB_%3DhXTGLNSq0SQA2rZTqG6hJdA%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%3D6PUYHmOP%3DxLnsU2HB4CyNLk1FPUMO33vMedTNe6U7j%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.