include_recipe "apt"
+docker_platform = if platform?("debian")
+ "debian"
+ else
+ "ubuntu"
+ end
+
+docker_arch = if arm?
+ "arm64"
+ else
+ "amd64"
+ end
+
apt_repository "docker" do
- uri "https://download.docker.com/linux/ubuntu"
- arch "amd64"
+ uri "https://download.docker.com/linux/#{docker_platform}"
+ arch docker_arch
components ["stable"]
- key "https://download.docker.com/linux/ubuntu/gpg"
+ key "https://download.docker.com/linux/#{docker_platform}/gpg"
end