|
17 | 17 | {{ partial "header.html" . }} |
18 | 18 | <main class="flex w-full flex-col items-stretch gap-20 self-center pt-20"> |
19 | 19 | <div class="grid w-full grid-cols-1 items-center gap-20 px-4 lg:grid-cols-2 xl:w-[1200px] self-center"> |
20 | | - <div class="bg-pattern-blue relative overflow-hidden rounded-sm drop-shadow"> |
| 20 | + <div class="bg-pattern-blue relative rounded-sm drop-shadow z-10" |
| 21 | + x-data="{ |
| 22 | + open: false, |
| 23 | + os: 'unknown', |
| 24 | + arch: 'unknown', |
| 25 | + init() { |
| 26 | + const platform = navigator.platform.toLowerCase(); |
| 27 | + const userAgent = navigator.userAgent.toLowerCase(); |
| 28 | +
|
| 29 | + if (platform.includes('mac') || platform.includes('darwin')) { |
| 30 | + this.os = 'mac'; |
| 31 | + // Default to Apple Silicon (arm64) as it's now the standard |
| 32 | + // Modern browsers on Apple Silicon report MacIntel for compatibility |
| 33 | + this.arch = 'arm64'; |
| 34 | + } else if (platform.includes('win')) { |
| 35 | + this.os = 'windows'; |
| 36 | + // Default to x86_64 - Windows ARM is rare and detection is unreliable |
| 37 | + this.arch = 'amd64'; |
| 38 | + } else if (platform.includes('linux')) { |
| 39 | + this.os = 'linux'; |
| 40 | + } |
| 41 | + }, |
| 42 | + getDownloadUrl(os, arch = 'amd64') { |
| 43 | + const baseUtm = 'utm_source=docker&utm_medium=webreferral'; |
| 44 | + const urls = { |
| 45 | + 'mac-arm64': `https://desktop.docker.com/mac/main/arm64/Docker.dmg?${baseUtm}&utm_campaign=docs-driven-download-mac-arm64`, |
| 46 | + 'mac-amd64': `https://desktop.docker.com/mac/main/amd64/Docker.dmg?${baseUtm}&utm_campaign=docs-driven-download-mac-amd64`, |
| 47 | + 'windows-arm64': `https://desktop.docker.com/win/main/arm64/Docker%20Desktop%20Installer.exe?${baseUtm}&utm_campaign=docs-driven-download-win-arm64`, |
| 48 | + 'windows-amd64': `https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?${baseUtm}&utm_campaign=docs-driven-download-win-amd64`, |
| 49 | + 'linux': '/desktop/linux/install/' |
| 50 | + }; |
| 51 | + return urls[os === 'linux' ? 'linux' : `${os}-${arch}`] || '/desktop/setup/install/linux/'; |
| 52 | + }, |
| 53 | + getOsLabel(os, arch = 'amd64') { |
| 54 | + const labels = { |
| 55 | + 'mac-arm64': 'Docker Desktop for Mac (Apple Silicon)', |
| 56 | + 'mac-amd64': 'Docker Desktop for Mac (Intel)', |
| 57 | + 'windows-arm64': 'Docker Desktop for Windows (ARM)', |
| 58 | + 'windows-amd64': 'Docker Desktop for Windows', |
| 59 | + 'linux': 'Docker Desktop for Linux' |
| 60 | + }; |
| 61 | + return labels[os === 'linux' ? 'linux' : `${os}-${arch}`] || 'Docker Desktop'; |
| 62 | + }, |
| 63 | + getPrimaryLabel() { |
| 64 | + if (this.os === 'unknown') return 'Download Docker Desktop'; |
| 65 | + return this.getOsLabel(this.os, this.arch); |
| 66 | + } |
| 67 | + }" |
| 68 | + @click.outside="open = false"> |
21 | 69 | <div class="flex h-full flex-col items-start justify-between gap-4 px-8 py-4"> |
22 | 70 | <div class="flex items-center gap-2"> |
23 | 71 | <span class="icon-svg text-blue dark:text-blue"> |
24 | 72 | {{ partial "icon" "play_circle" }}</span> |
25 | 73 | <h1 class="text-xl">Get Docker</h1> |
26 | 74 | </div> |
27 | 75 | <p> |
28 | | - Learn how to install Docker for Mac, Windows, or Linux and explore |
29 | | - our developer tools. |
| 76 | + Download Docker Desktop for your platform or |
| 77 | + <a href="/get-started/get-docker/" class="text-blue dark:text-blue-400 hover:underline">view getting started guides</a>. |
30 | 78 | </p> |
31 | | - <a href="/get-started/get-docker/" |
32 | | - class="shadow bg-blue mt-20 flex cursor-pointer items-center gap-2 rounded-sm p-2 px-4 text-white transition duration-300 hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400"> |
33 | | - <span class="icon-svg icon-sm">{{ partial "icon" "download" }}</span> |
34 | | - Get Docker |
35 | | - </a> |
36 | | - </div> |
37 | | - <div class="absolute right-0 bottom-0 origin-bottom-right scale-50"> |
38 | | - <img class="dark:hidden" alt="Low-fi desktop app" src="/assets/images/app-wf-light-1.svg" /> |
39 | | - <img class="hidden dark:block" alt="Low-fi desktop app" src="/assets/images/app-wf-dark-1.svg" /> |
| 79 | + <div class="mt-20"> |
| 80 | + <div class="relative inline-block"> |
| 81 | + <div class="flex shadow rounded-sm overflow-hidden"> |
| 82 | + <a :href="getDownloadUrl(os, arch)" |
| 83 | + class="bg-blue flex cursor-pointer items-center gap-2 p-2 px-4 text-white transition duration-300 hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 whitespace-nowrap"> |
| 84 | + <span class="icon-svg icon-sm">{{ partial "icon" "download" }}</span> |
| 85 | + <span x-text="getPrimaryLabel()">Download Docker Desktop</span> |
| 86 | + </a> |
| 87 | + <button @click="open = !open" type="button" |
| 88 | + class="bg-blue flex items-center justify-center px-3 text-white border-l border-blue-400 hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 transition duration-300" |
| 89 | + aria-label="More download options"> |
| 90 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 91 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path> |
| 92 | + </svg> |
| 93 | + </button> |
| 94 | + </div> |
| 95 | + <div x-show="open" x-collapse |
| 96 | + class="absolute top-full left-0 mt-1 min-w-full bg-white dark:bg-gray-800 rounded-sm shadow-lg overflow-hidden z-50"> |
| 97 | + <a href="https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-arm64" |
| 98 | + class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap"> |
| 99 | + Docker Desktop for Mac (Apple Silicon) |
| 100 | + </a> |
| 101 | + <a href="https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-mac-amd64" |
| 102 | + class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap"> |
| 103 | + Docker Desktop for Mac (Intel) |
| 104 | + </a> |
| 105 | + <a href="https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-win-amd64" |
| 106 | + class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap"> |
| 107 | + Docker Desktop for Windows |
| 108 | + </a> |
| 109 | + <a href="https://desktop.docker.com/win/main/arm64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-win-arm64" |
| 110 | + class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap"> |
| 111 | + Docker Desktop for Windows (ARM) |
| 112 | + </a> |
| 113 | + <a href="/desktop/linux/install/" |
| 114 | + class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap"> |
| 115 | + Docker Desktop for Linux |
| 116 | + </a> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + </div> |
40 | 120 | </div> |
41 | 121 | </div> |
42 | 122 | <div class="h-full bg-pattern-purple rounded-sm drop-shadow"> |
|
0 commit comments