Reputation: 201
docker-compose --version docker-compose version 1.11.1, build 7c5d5e4
I have secret 'my_secret_data' added to my swarm cluster:
The start of my compose file looks like:
version: "3.1"
secrets:
my_secret_data:
external: true
services:
master:
image: jenkins-master
secrets:
- my_secret_data
ports:
- "8080:8080"
- "50000:50000"
'docker stack deploy' continually gives the error:
secrets Additional property secrets is not allowed
I have followed how do you manage secret values with docker-compose v3.1? to the letter as far as I can tell and have the correct versions installed but keep getting the above error. Any help greatly appreciated.
Upvotes: 20
Views: 19916
Reputation: 21
In my case, Service: had an extra tab prior. Moment I removed tab prior to it, it worked.
Upvotes: 2
Reputation: 1481
The "Additional property secrets is not allowed" error can be caused either by:
If you are experiencing this problem confirm that both are correct.
This also applies to other Docker interfaces and tools.
For examples, in Portainer, yml with secrets lines pasted into the Create Stack dialog should begin with the line version: '3.1'
or you will encounter the same error -- even with an up-to-date Docker Engine 1.13.1+.
Upvotes: 6
Reputation: 1059
Change compose file version to latest version.
In short, version '3' is not resolved to the latest '3.x' version. Find what the latest version is here https://docs.docker.com/compose/compose-file/#compose-and-docker-compatibility-matrix
Upvotes: 15