Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose - secrets Additional property secrets is not allowed

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.

like image 787
Ronan Cunningham Avatar asked Feb 15 '17 15:02

Ronan Cunningham


1 Answers

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

like image 107
Arman Avatar answered Sep 21 '22 14:09

Arman