Compose: Missing secrets file creates a directory?

Created on 15 Nov 2017  ·  3Comments  ·  Source: docker/compose

When docker-compose up with the config below, if the file mypass.txt is missing, docker-compose creates an empty directory mypass.txt. Is that expected behaviour?

version: '3.1'

services:
  app:
    image: alpine
    secrets:
      - mypass

secrets:
  mypass:
    file: ./mypass.txt

macOS 10.13.1
Docker version 17.11.0-ce-rc3, build 5b4af4f
docker-compose version 1.17.0, build ac53b73

aresecrets kincleanup kinquestion

Most helpful comment

It's a somewhat unfortunate side-effect of the way we emulate secrets in docker-compose. Incidentally, it will be fixed by #5363, which will error out instead if the specified file is missing.

All 3 comments

It's a somewhat unfortunate side-effect of the way we emulate secrets in docker-compose. Incidentally, it will be fixed by #5363, which will error out instead if the specified file is missing.

5363 was never merged, which means this may never have been fixed. Consider re-opening?

It was fixed by #5415

Was this page helpful?
0 / 5 - 0 ratings