Running Docker without Docker Desktop

Currently trying to run Docker without Docker Desktop. Following this info: Running Docker on WSL2 without Docker Desktop (the right way) - DEV Community and running into an SSL issue:

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 99.84.192.50 443]
Reading package lists… Done
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/jammy/InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 99.84.192.50 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Anyone have experience with this?

1 Like

If you followed the instructions to install the Docker Engine (docker-ce) on Install Docker Engine on Ubuntu, it should work. In your case, it looks like step 2. and 3. of the installation instructions might not be done properly.

The tutorial you followed is high likely outdated (I haven’t read it, just saw it is from 2021) If you want docker-ce on WSL2, then you will want to enable systemd support in Ubuntu (see: Systemd support is now available in WSL! - Windows Command Line).

If enabling systemd causes problems → update your wsl installation to the latest version (wsl --update).

1 Like

Thank you! I checked out the installation instructions. They look a bit different from what I did initially. However, when I follow them, I end up with:
Self-signed certificate encountered.
To connect to download.docker.com insecurely, use `–no-check-certificate’.

Did you install ca-certificates too?

1 Like

ca-certificates is already the newest version (20211016ubuntu0.22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.

I did and received ^

This shouldn’t be necessary. The domain uses a certificate from a well known CA (Amazon Root CA 1) and is included in every recent browser and ca truststore there is.

Please share the output of this command:

curl -iv  https://download.docker.com/linux/ubuntu/

Note: the repo is exposed through CloudFront, which will resolve to the closest aws edge location. The curl command from aboves helps us to see the response from your edge location.

Sharing the outcome:

  • Connected to download.docker.com (18.154.144.71) 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 (OUT), TLS header, Unknown (21):
  • TLSv1.3 (OUT), TLS alert, unknown CA (560):
  • SSL certificate problem: self-signed certificate in certificate chain
  • Closing connection 0
    curl: (60) SSL certificate problem: self-signed certificate in certificate chain
    More details here: curl - SSL CA Certificates

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Thanks for your help!

Now I am currious about two things:

  1. what’s the output of openssl s_client -connect download.docker.com:443 </dev/null 2>/dev/null | openssl x509 -inform pem -text
  2. if the issuer from 1. output is listed in the output of awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
1 Like

hhhhmm ok I think this could be because I’m typically on my VPN to the Germany office & currently in the US office :melting_face:

So no output to share?

If your company enforces TLS/SSL-Inspection, the security context of https-requests will be terminated in a security appliance, which will establish a new security context between the appliance and the target. Your client needs to be able to validate the certificate the security appliance creates on the fly.

You will need to import the ca-certificate used by the appliance to create the on-the-fly certificates in your WSL distribution. Your it-department should be able to tell you which certificate needs to imported.

Another issue could be that the vpn connections potentially alters required routes. Depending on the configuration it could affect all traffic or just the traffic to the WSL ip range.