Problem
PR #3684 added Docker context detection but only extracts the host URL. Docker contexts can also store TLS certificates for secure remote connections, which are currently ignored.
When a context is configured with TLS:
docker context create remote
--docker "host=tcp://remote.example.com:2376"
The Docker CLI works fine, but func fails to connect because it doesn't load the TLS certificates from the context.
Proposed Solution
Extend getDockerContextHost() to also read TLS configuration from the context's meta.json and tls/ directory:
~/.docker/contexts/meta//
├── meta.json
└── tls/
├── ca.pem
├── cert.pem
└── key.pem
Then configure the Docker client with these certificates when connecting to remote daemons (tcp://, ssh://).
Benefits
Remote Docker setups work automatically
Consistent with Docker CLI behavior
No manual environment variables needed
Proper TLS support for secure connections
Related
Issue #2226
PR #3684
Problem
PR #3684 added Docker context detection but only extracts the host URL. Docker contexts can also store TLS certificates for secure remote connections, which are currently ignored.
When a context is configured with TLS:
docker context create remote
--docker "host=tcp://remote.example.com:2376"
The Docker CLI works fine, but func fails to connect because it doesn't load the TLS certificates from the context.
Proposed Solution
Extend getDockerContextHost() to also read TLS configuration from the context's meta.json and tls/ directory:
~/.docker/contexts/meta//
├── meta.json
└── tls/
├── ca.pem
├── cert.pem
└── key.pem
Then configure the Docker client with these certificates when connecting to remote daemons (tcp://, ssh://).
Benefits
Remote Docker setups work automatically
Consistent with Docker CLI behavior
No manual environment variables needed
Proper TLS support for secure connections
Related
Issue #2226
PR #3684