Docker Community Forums

Share and learn in the Docker community.

Docker and Templates


(Slopez01) #1

Thanks in advance for any help.

Issue:

I am trying to use templates as discussed in the linux academy training for docker. However, I don’t get the same results they do.

I execute the following command:

docker service create --name myweb --hostname="{{.Node.ID}}-{{.Service.Name}}" --detach=false httpd

I then execute the command:

docker inspect myweb | grep Hostname

I get the following results:

“Hostname”: “{{.Node.ID}}-{{.Service.Name}}”,

Is this occurring because I am using enterprise edition 2.0 which is an older release then the community edition, or am I missing something?

Docker Version:

Client: Docker Enterprise Edition (EE) 2.0
Version: 17.06.2-ee-10
API version: 1.30
Go version: go1.8.7
Git commit: 66261a0
Built: Fri Apr 27 00:38:41 2018
OS/Arch: linux/amd64

Server: Docker Enterprise Edition (EE) 2.0
Engine:
Version: 17.06.2-ee-10
API version: 1.30 (minimum version 1.12)
Go version: go1.8.7
Git commit: 66261a0
Built: Fri Apr 27 00:40:03 2018
OS/Arch: linux/amd64
Experimental: false