Error during pull
Problem
This error occurs during docker compose pull with --context argument Steps to reproduce the issue: 1. docker --context mycontext compose -f docker-compose.letsencrypt.yml pull 2. error during connect: Get "http://docker.example.com/v1.41/images/mongo-express/json": command [ssh -l root -- pharma-bio.hr docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=kex_exchange_identification: Connection closed by remote host Describe the results you received: error during connect: Get "http://docker.example.com/v1.41/images/mongo-express/json": command [ssh -l root -- pharma-bio.hr docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=kex_exchange_identification: Connection closed by remote host Describe the results you expected: Normal pull of all images, both from my docker hub and public ones Additional information you deem important (e.g. issue happens only occasionally): Output of `docker compose version`: [code block] Output of `docker info`: [code block] Additional environment details: I'm using Ubuntu 20.04 WSL on client side, and deploying to Ubuntu server 20.04 (both sides fully patched).
Error Output
error occurs during docker compose pull with --context argument
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix Docker SSH Connection Issue During Pull
The error occurs because the SSH connection to the remote Docker host is being closed prematurely, likely due to misconfiguration in SSH settings or firewall rules. The exit status 255 indicates a failure in establishing a connection, which can be caused by incorrect SSH keys, host key verification issues, or the remote Docker daemon not being accessible.
Awaiting Verification
Be the first to verify this fix
- 1
Verify SSH Configuration
Check the SSH configuration on the client side to ensure that the correct keys are being used and that the remote host is reachable.
bashssh -l root pharma-bio.hr - 2
Check Docker Daemon Status
Ensure that the Docker daemon is running on the remote host. You can do this by SSH-ing into the remote server and running the command below.
bashsudo systemctl status docker - 3
Update SSH Host Key Verification
If the SSH host key has changed, you may need to remove the old key from the known_hosts file. This can be done with the command below. Replace 'pharma-bio.hr' with your remote host.
bashssh-keygen -R pharma-bio.hr - 4
Adjust Firewall Rules
Ensure that the firewall on the remote host allows incoming connections on the Docker port (usually 2375 for unsecured or 2376 for secured). Adjust the firewall settings if necessary.
bashsudo ufw allow 2376 - 5
Test Docker Connection
After making the above changes, test the Docker connection again using the docker-compose pull command.
bashdocker --context mycontext compose -f docker-compose.letsencrypt.yml pull
Validation
Confirm that the pull command executes successfully without any connection errors. You should see the images being pulled without any exit status 255 errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep