Docker push stalls, retries and times out

It’s a nightmare. Each time I try, it goes very slowly, retries a few times and times out. Here is the log:

paul@desktop:~/work/arc/code$ docker push pauljurczak/arc:latest
The push refers to repository [docker.io/pauljurczak/arc]
33ebec15ca0c: Retrying in 1 second 
78d6083dacfd: Retrying in 1 second 
5e750f8ea814: Pushing [=================>                                 ]  96.65MB/269.5MB
90b67d9b54ef: Retrying in 20 seconds 
e48e28e58a61: Retrying in 1 second 
ae2753f3e551: Waiting 
ec3c4788435a: Waiting 
8a70d251b653: Waiting 
dialing registry-1.docker.io:443 no proxy configured: resolving host registry-1.docker.io: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:54841->127.0.0.53:53: i/o timeout

I’m on Ubuntu 22.04.1, Docker version 20.10.22, build 3a2c30b. Here is more info in case it may be relevant:

paul@desktop:~/work/arc/code$ curl -v https://index.docker.io:443
*   Trying 18.210.197.188:443...
* Connected to index.docker.io (18.210.197.188) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.docker.com
*  start date: Oct 31 00:00:00 2022 GMT
*  expire date: Nov 30 23:59:59 2023 GMT
*  subjectAltName: host "index.docker.io" matched cert's "*.docker.io"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET / HTTP/1.1
> Host: index.docker.io
> User-Agent: curl/7.81.0
> Accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< date: Thu, 22 Dec 2022 23:20:48 GMT
< content-type: text/html; charset=utf-8
< content-length: 2391
< x-powered-by: Express
< etag: W/"957-mTx6rVQmyElNlaNFUX8QJhs0L6k"
< vary: Accept-Encoding
< server: nginx
< x-frame-options: deny
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< strict-transport-security: max-age=31536000
< 
<!DOCTYPE html>
<html lang="en">
<head>
<title>Docker</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<link
href="https://fonts.googleapis.com/css?family=Comfortaa:300,400,400i,600,600i,700"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css?family=Poppins:400,500,600,700"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<meta
name="google-site-verification"
content="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
/>
<meta name="fragment" content="!" />
<script
defer
src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"
type="text/javascript"
charset="UTF-8"
data-domain-script="65425fb0-7b36-4317-9f10-7b3e08039af0"
></script>
<script
defer
src="data:text/javascript;base64,ZnVuY3Rpb24gT3B0YW5vbldyYXBwZXIoKSB7fQ%3D%3D"
></script>

<script type="text/javascript">
window.ASSET_PATH = 'https://d36jcksde1wxzq.cloudfront.net/';
</script>
<script type="text/javascript">
window.analyticsQueue = window.analyticsQueue || [];
</script>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.defer=true;j.type="text/javascript";
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WL2QLG5');
</script>
<link rel="stylesheet" href="https://d36jcksde1wxzq.cloudfront.net/main.920c688b2d983bd06601.css" />
</head>
<body>
<div id="app"></div>
<script>
window.dockerVars = {"recaptchaSiteKey":"6LfFmz8UAAAAAAfwSofn9g9n2GSf_aplw2zjHtsZ","bugsnagApiKey":"aebb7f3442de072b3209127919cf37c0","environment":"production","appVersion":"2114.0.0","auth0Info":{"appDomain":"login.docker.com","audience":"https://hub.docker.com","clientId":"lve9GGl8JtSUrneQ1EVuC0lbjHdi9nb9"}};
window.recaptchaOptions = { useRecaptchaNet: true };
</script>
<script src="https://d36jcksde1wxzq.cloudfront.net/bugsnag.4a9b44cb3429049757fb.js"></script>
<script src="https://d36jcksde1wxzq.cloudfront.net/main.fee1dd25774be2a4d1b8.js"></script>
</body>
* Connection #0 to host index.docker.io left intact

I did a bit of research, but couldn’t find a similar problem. Is there a way to for push to upload only one chunk at a time instead of several parallel processes? Perhaps adjusting the timeout would help. My network provides only about 240KiB/s upload speed.

I assume it is Docker Desktop for Windows, am I right? At least that is where people report network issues usually. I have no idea why. I used to think it is some VPN or proxy on the host, but it is not always the case.

I made a mistake installing Docker Desktop on Ubuntu 22.04.1. I removed it already. It was causing a different kind of problems, see: command - "sudo docker push" fails with a seemingly bogus error message - Stack Overflow. These issues still persist after Docker Desktop removal.

Then how do you run Docker now? There are multiple ways to install Docker so it is important to know how exactly you installed it.

I followed the instructions from Install Docker Engine on Ubuntu | Docker Documentation followed by Docker Engine post-installation steps | Docker Documentation to the letter. Everything local and pull works fine. Push doesn’t. BTW, it is not showstopper for me at this time. The recipient of my Docker image prefers file transfer other than DockerHub.