docker-archive / toolbox

The Docker Toolbox
https://docker.com/toolbox
3.22k stars 1.23k forks source link

Cannot create secret with file #804

Open eSPiYa opened 6 years ago

eSPiYa commented 6 years ago

I'm running Docker with the latest version on Windows 10 for development purposes. I used to use external secrets with the older version of Docker, but it looks like I have to use secrets with files on swam mode which is the default settings of the latest version if I have to use docker-compose.

I tried using this command from the example: docker secret create my_secret ./secret.json

But I receive this error message:

Error reading content from "./secret.json": open ./secret.json: The system cannot find the file specified.

So I created the file in the directory. However, I got a different error message:

Error response from daemon: rpc error: code = InvalidArgument desc = secret data must be larger than 0 and less than 512000 bytes

Tried to revise it like this:

echo "mysecret" | docker secret create my_secret ./secret.json

But still receive the same error message.

shaneficorilli commented 5 years ago

Hi eSPiYa,

Did you ever find a solution to this issue? I encountered the same error upon doing a docker stack deploy and my certs ended up not being in the correct location. I would double check that.

Good luck!

-Shane