docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 116 forks source link

install command is not working as expected #7302

Closed kenchan0130 closed 3 weeks ago

kenchan0130 commented 3 months ago

Description

After running the install command, Docker.app will be removed from the directory.

$ sudo /Applications/Docker.app/Contents/MacOS/install
$ ls -d /Applications/Docker.app
ls: /Applications/Docker.app: No such file or directory

Reproduce

  1. Attach Docker.dmg
  2. Move Docker.app to /Applications directory
  3. Run /Applications/Docker.app/Contents/MacOS/install

Expected behavior

/Applications/Docker.app/Contents/MacOS/install command does not delete Docker.app and install some tools (or plugins).

docker version

Docker.app is deleted before installation, so the docker command does not exist.

docker info

Docker.app is deleted before installation, so the docker command does not exist.

Diagnostics ID

Docker.app is deleted before installation, so the docker command does not exist.

Additional Info

The file contents of the /Applications/Docker.app/Contents/Info.plist following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>BuildMachineOSBuild</key>
    <string>22A400</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>Docker</string>
    <key>CFBundleExecutable</key>
    <string>com.docker.backend</string>
    <key>CFBundleIconFile</key>
    <string>AppIcon</string>
    <key>CFBundleIconName</key>
    <string>AppIcon</string>
    <key>CFBundleIdentifier</key>
    <string>com.docker.docker</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Docker</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>4.30.0</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
      <string>MacOSX</string>
    </array>
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>docker-desktop</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>docker-desktop</string>
        </array>
      </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>149282</string>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>DTPlatformBuild</key>
    <string>14B47b</string>
    <key>DTPlatformName</key>
    <string>macosx</string>
    <key>DTPlatformVersion</key>
    <string>13.0</string>
    <key>DTSDKBuild</key>
    <string>22A372</string>
    <key>DTSDKName</key>
    <string>macosx13.0</string>
    <key>DTXcode</key>
    <string>1410</string>
    <key>DTXcodeBuild</key>
    <string>14B47b</string>
    <key>GitCommit</key>
    <string>802d5dab7e63e0deec0f71bee0c53a3981af4c28</string>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.developer-tools</string>
    <key>LSMinimumSystemVersion</key>
    <string>11.0</string>
    <key>LSMultipleInstancesProhibited</key>
    <false/>
    <key>LSUIElement</key>
    <true/>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2015-2024 Docker Inc.All Rights Reserved.</string>
    <key>SMPrivilegedExecutables</key>
    <dict>
      <key>com.docker.vmnetd</key>
      <string>identifier &#34;com.docker.vmnetd&#34; and anchor apple generic and certificate leaf[subject.CN] = &#34;Developer ID Application: Docker Inc (9BNSXJN65R)&#34;</string>
    </dict>
    <key>SUPublicEDKey</key>
    <string>xPiMc+MatfYLz6ZfZPNpCsd9vnxDuIdnHAT7mw4A+jE=</string>
    <key>VmnetdVersion</key>
    <string>67</string>
    <key>channelID</key>
    <string>main</string>
  </dict>
</plist>
built2order commented 2 months ago

Is there a use case to run the command line installer if you've manually copied the app bundle to the Applications directory?

The installation steps documented at Manuals / Docker Desktop / Install / Mac / Install Docker Desktop on Mac suggest running the install command from the volume mount.

sudo /Volumes/Docker/Docker.app/Contents/MacOS/install

kenchan0130 commented 2 months ago

@built2order In CI, Docker.app is a large file size and I wanted to cache it without mounting it, so I saved it in a separate directory. The directory does not have to be /Applications, but I think there are use cases where it can be copied to any directory.

seanchristians commented 2 months ago

I've experienced this error in my environment as well. My use case is deploying Docker Desktop for non-admin users at my organization. I install Docker via Installomator, which places the .app in the /Applications folder. Then I run install with the --user flag to allow the non-admin user to start the app without having to manually configure settings.

The error I'm seeing from my MDM is as follows: Error: installing docker cli plugins: reading the cli plugins folder: open /Applications/Docker.app/Contents/Resources/cli-plugins: no such file or directory. The Docker.app is also deleted from /Applications, I assume due to the install script.

kenchan0130 commented 2 months ago

@seanchristians If only with respect to Installomator, you can refer to the relevant amended https://github.com/Installomator/Installomator/pull/1679.

neonima commented 2 months ago

This is a known bug, thanks for reporting! We're planning to get a fix ready in 4.32

As a workaround, you can run the install binary directly from the mounted dmg (or a separate directory that is not /Applications) 👍