Skip to content

existence of secret files are checked locally instead of remotely when using remote docker daemon with DOCKER_HOST #7857

Description

@danny-p93

Description of the issue

I'm using an remote docker daemon (DOCKER_HOST is set). In my docker-compose.yml i have specified some secrets for use in my service. These secrets use a file that is only given on the remote system. Every time i use docker-compose on my local system it shows me a warning, that my service uses an undefined file. For my luck it is just a warning and the service starts and indeed uses the given files from the remote daemon.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

Output of docker version

Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:36 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.10
API version: 1.40 (minimum version 1.12)
Go version: go1.13.3
Git commit: 9424aea
Built: Thu Aug 6 02:55:27 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc9
GitCommit: d736ef14f0288d6993a1845745d6756cfc9ddd5a
docker-init:
Version: 0.18.0
GitCommit: fec3683

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

secrets:
my_sec:
file: /path/on/remote/system
services:
my_ser:
container_name: custom
environment:
SOMEENV: foo
image: myimage:latest
ports:
- published: 1234
target: 4321
restart: always
secrets:
- source: my_sec
target: /apps/project/path/in/container
volumes:
- /another/remote/path:/apps/project/path:rw
version: '3.7'

Steps to reproduce the issue

  1. setup an remote docker daemon, that exposes the daemon port correctly
  2. install docker-cli and docker-compose locally
  3. specify DOCKER_HOST to the remote daemon
  4. configure a local docker-compose.yml file, that includes a configuration for a secret, which uses a file, that only exists on the remote system
  5. run the compose file

Observed result

i get a warning for the secret file
definition of remote volume works without warning

Expected result

i get a warning when the file is not present on the remote system and the local system should be ignored

Stacktrace / full error message

WARNING: Service "my_ser" uses an undefined secret file "/path/on/remote/system", the following file should be created "/path/on/remote/system"

Additional information

my remote system is a photon-os, my local system is ubuntu18.04 on WSL1
docker and docker-compose installed as documented

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions