docker-compose build task fails with [could not read CA certificate "/vsts/agent/_work/_temp/DockerConfig_1506458440225/ca.pem"]
See original GitHub issueI’m running a docker-compose build task to build service images. The task used to work with version 0.4.0 but the latest version, 0.4.4, fails with a “cannot find ca.pem” error:
2017-09-26T20:40:41.6744880Z Step 5/5 : ADD ./target/myshuttledev.war /usr/local/tomcat/webapps/myshuttledev.war
2017-09-26T20:40:45.3554830Z ---> 281155bf4628
2017-09-26T20:40:45.4178900Z Removing intermediate container 3464841f32b7
2017-09-26T20:40:45.4194200Z Successfully built 281155bf4628
2017-09-26T20:40:45.4495870Z Successfully tagged cdmochjavaacr.azurecr.io/web:latest
2017-09-26T20:40:45.8352160Z [command]/usr/local/bin/docker tag cdmochjavaacr.azurecr.io/db cdmochjavaacr.azurecr.io/db:20170926.4
2017-09-26T20:40:45.8417690Z could not read CA certificate "/vsts/agent/_work/_temp/DockerConfig_1506458440225/ca.pem": open /vsts/agent/_work/_temp/DockerConfig_1506458440225/ca.pem: no such file or directory
2017-09-26T20:40:45.8542230Z ##[error]could not read CA certificate "/vsts/agent/_work/_temp/DockerConfig_1506458440225/ca.pem": open /vsts/agent/_work/_temp/DockerConfig_1506458440225/ca.pem: no such file or directory
2017-09-26T20:40:45.8617290Z ##[error]/usr/local/bin/docker failed with return code: 1
2017-09-26T20:40:45.8980030Z ##[section]Finishing: Build services
There are 2 images in the docker-compose file: both image builds succesfully and it appears the tagging command actually worked. However, the task is not completing because of the file not found error.
I’m connecting to an Azure Container Registry, so I use those settings. I tried to create a “plain” container registry endpoint to the same ACR, but got the same failure.
Full source code and instructions I’m following are found here: https://almvm.azurewebsites.net/labs/java/builddocker.html
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Docker: could not read CA certificate - Stack Overflow
I am not able to see this error " 'appdata\local\docker\vm-config\ca-certificates.crt' is denied" Now, I can run Linux containers on Windows 10.
Read more >2022201 – Docker build fails due to ca-certificates
Now the `fix-info-dir` script does not expect the existence of the `/dev/null` file, and avoids the possibility of an infinite loop. Clone Of:...
Read more >Quickstart with docker-compose - django-ca's documentation!
This guide provides instructions for running your own certificate authority using docker-compose. This is the quickest and easiest way to run django-ca, ...
Read more >Solution build fails with docker compose error (in VS 15.3)
I am experiencing the same issue (also have an nginx container) - if I remove the extra container from my project it works...
Read more >Verify repository client with certificates - Docker Documentation
crt extension, the Docker daemon logs the following error message: Missing key KEY_NAME for client certificate CERT_NAME. CA certificates should use the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Turns out this was an issue with the build container we were running (base off
microsoft/vstsagent
with some of our own customizations). TheDOCKER_HOST
andDOCKER_TLS_VERIFY
environment variables were set, butDOCKER_CERT_PATH
had not been set. Setting that resolved the issue!@colindembovsky you are setting env variables in the DockerFile and in this PR you are validating execution env variable values. If you specify env variable inside Dockerfile, these variables are only available inside container and there is no way we can validate in task if the variables are properly set for executing container. Another way to specify Docker Host is through using Docker host endpoint, where we have appropriate check and we create proper command to set docker host. Therefore this change will not warn user if env variables are set inside container.