Handle empty or invalid `$HOME/.docker/config.json` gracefully
See original GitHub issueReference: https://issues.apache.org/jira/browse/INFRA-22697
Apparently testcontainers requires $HOME/.docker/config.json to be a valid JSON file.
touch ~/.docker/config.json
// lauch some test containers tests will now fail
echo '{}' > ~/.docker/config.json
// lauch some test containers tests will now succeeds
rm ~/.docker/config.json
// lauch some test containers tests will now succeeds
The problem is that I have little control on the content of this file as provided on the ASF CI environments. I would like testcontainers to ignore it as missing when its content is missing…
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to fix docker error loading config file - Bobcares
The docker error loading config file triggers due to reasons like an empty config file or permission issue with the configuration file.
Read more >Docker Compose release notes
Fixed invalid handler warning on Windows builds. Fixed config hash to trigger container re-creation on IPC mode updates. Fixed conversion map for placement....
Read more >How to Deploy an NGINX Image with Docker
Option 1 – Maintain the Content and Configuration on the Docker Host ... Now any change made to the files in the local...
Read more >fabric8io/docker-maven-plugin
See Simple Dockerfile build for details of this zero XML configuration mode. Images that are built with this plugin can be pushed to...
Read more >OpenShift CLI developer command reference
Check to see if I can create pods in any namespace oc auth can-i create pods ... pod.json | oc create -f -...
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 Free
Top 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
I wonder if it should not be rather
Handle invalid $HOME/.docker/config.json gracefully
.As this config is apparently only used to discover private registry if invalid we could adopt a lenient beaviour and behave as if there was no such file (maybe with a log)
This is what docker CLI does:
You could see that even if it complains, the invalid file did not prevent the docker CLI from working normally…
I think such a behaviour would be less specific to my use case but benefit the whole community.
Hi @chibenwa, can you still reproduce this if invalid
config.json
file is provided?I have tried to reproduce it locally (testcontainers version 1.17.2) by executing test provided here, but I can’t (not sure if I’m doing something wrong, or if the “issue” is fixed) 🤔