Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile does not support TLS connections #30

Open
jnovack opened this issue Jun 20, 2020 · 2 comments
Open

Dockerfile does not support TLS connections #30

jnovack opened this issue Jun 20, 2020 · 2 comments

Comments

@jnovack
Copy link

jnovack commented Jun 20, 2020

FROM scratch does not include any ca-certificates, so it will fail to connect to any TLS-enabled MQTT broker.

❯ docker pull sapcc/mosquitto-exporter:0.6.0
0.6.0: Pulling from sapcc/mosquitto-exporter
257963aec3e6: Pull complete 
Digest: sha256:109e3fbbf99943eacc66a57a6e535ea43878fc63c328d1e27a928e6e69c72ddb
Status: Downloaded newer image for sapcc/mosquitto-exporter:0.6.0
docker.io/sapcc/mosquitto-exporter:0.6.0
❯ docker run -e BROKER_ENDPOINT=tls://test.mosquitto.org:8883 -p 9234:9234 sapcc/mosquitto-exporter:0.6.0 
2020/06/20 19:06:52 Starting mosquitto_broker 0.6.0 (0ac92b5), go1.12.3
2020/06/20 19:06:52 Error: Failed to connect to broker: Network Error : x509: certificate signed by unknown authority
@jnovack
Copy link
Author

jnovack commented Jun 20, 2020

Needs the following in the Dockerfile.

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

@tvojacek
Copy link

certs are secrets should not be part of image.
mount certificate files using docker volume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants