You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unattended install of Docker Desktop (Windows and macOS) #80
There are many situations, but most especially CI test runners, where Docker Desktop needs to be installed unattended. With current versions, that's either impossible or very, very sketchy.
It used to be possible on macOS using the technique in docker/for-mac#2359, but as explained in docker/for-mac#2359 (comment) it was somewhat randomly blocked by an error check on root installs in 2.1.0.0
Which service(s) is this request for?
Docker Desktop for Mac and Docker Desktop for WIndows. macOS is the place I would immediately use it.
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
As above, in a CI environment Docker Desktop needs to be installed... by a script.
Are you currently working around the issue?
Currently using pre-2.1.0.0 version of Docker Desktop for Mac
Additional context
While I'd prefer a great solution (explicit, supported unattended install technique), I'm modestly sure that you could just remove the blocker error check, "Running Docker Desktop as root is dangerous. Please run it as a regular user"
Reacted by Eric Hripko, Ronan Fitzgerald, Max Klein, Miles Monteleone, Hayden Donnelly, laprogs, Dave Rooney, call, Jesse Kasky, Karim and 3 more
Reacted by Max Klein, Miles Monteleone, Hayden Donnelly and laprogs
changed the title [-]Automated install of Docker Desktop (Windows and macOS)[/-][+]Unattended install of Docker Desktop (Windows and macOS)[/+]on Apr 30, 2020
+1 to this feature request, many times over. The lack of an automated install is a serious pain point for using Docker as part of a CI pipeline. This issue should also be fairly easy for the Docker team to fix, while at the same time being basically impossible to work around in a robust way from the outside. As I said in the older issue thread:
Here's a way to get a working copy of the latest Docker Desktop app for Mac installed from the command line:
#!/usr/bin/env bash# refs:# https://github.com/MicrosoftDocs/vsts-docs/issues/3784# https://forums.docker.com/t/docker-for-mac-unattended-installation/27112
brew cask install docker
# allow the app to run without confirmation
xattr -d -r com.apple.quarantine /Applications/Docker.app
# preemptively do docker.app's setup to avoid any gui prompts
sudo /bin/cp /Applications/Docker.app/Contents/Library/LaunchServices/com.docker.vmnetd /Library/PrivilegedHelperTools
sudo /bin/cp /Applications/Docker.app/Contents/Resources/com.docker.vmnetd.plist /Library/LaunchDaemons/
sudo /bin/chmod 544 /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo /bin/chmod 644 /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo /bin/launchctl load /Library/LaunchDaemons/com.docker.vmnetd.plist
and then you can run the app and wait for it to install/set up with this script:
#!/usr/bin/env bash# refs:# https://stackoverflow.com/a/35979292/425458
[[ $(uname)=='Darwin' ]] || { echo"This function only runs on macOS.">&2;exit 2; }
echo"-- Starting Docker.app, if necessary..."
open -g -a Docker.app ||exit# Wait for the server to start up, if applicable.
i=0
while! docker system info &>/dev/null;do(( i++==0))&&printf %s '-- Waiting for Docker to finish starting up...'||printf'.'
sleep 1
done(( i ))&&printf'\n'echo"-- Docker is ready."
This is what I needed to do in order to get Docker running during my Mac CI tests (on Azure Pipelines).
My install hack above is completely ridiculous, and there should be a better way. The old way with the cute command line arguments:
was so, so much better. Can we please get this back?
Reacted by Hayden Donnelly, call, Bogdan Marian, Sagar Ganiga, Alex Schittko, suvika17, Manuel Vogel-Johnson, Dinara N, Joffrey Bion, filipsworks and 1 more
You now need a slightly updated version of the above filthy hack in order to successfully install the very latest docker desktop for mac: docker/for-mac#2359 (comment)
After updating docker to version 3.4.0, the command open -g -a Docker.app began to request privileged access: Docker Desktop needs privileged access to install its networking components and links to the Docker apps.
@telamonian, did you find a way to get around this?
Any update to this? Being able to default to Windows Containers automatically during install would be appreciated for automated rollouts. Default behavior is that it is spinning up Hyper-V VMs on consumer laptops...
Can you please implement --windows-containers a flag to the installer. I see there is also --settings parameter but I don't know how to use it to switch to windows containers.
Would like to avoid the warning message to install WSL2.
"Can you please implement --windows-containers a flag to the installer. I see there is also --settings parameter but I don't know how to use it to switch to windows containers.
Would like to avoid the warning message to install WSL2."
Can anyone point me to the docker installer code? I assume some of these items are easier to add but it may require some plumbing through to the engine or they just require setting some config file I assume that isn't much work.
+1 for the --windows-containers flag on installation.
I am currently using the SwitchDaemon method after install, but without idempotence this method is unreliable, especially when unattended installation scripts might run more than once
Activity
[-]Automated install of Docker Desktop (Windows and macOS)[/-][+]Unattended install of Docker Desktop (Windows and macOS)[/+]telamonian commentedon May 25, 2020
+1 to this feature request, many times over. The lack of an automated install is a serious pain point for using Docker as part of a CI pipeline. This issue should also be fairly easy for the Docker team to fix, while at the same time being basically impossible to work around in a robust way from the outside. As I said in the older issue thread:
telamonian commentedon Jun 2, 2021
You now need a slightly updated version of the above filthy hack in order to successfully install the very latest docker desktop for mac: docker/for-mac#2359 (comment)
suvika17 commentedon Jun 16, 2021
After updating docker to version 3.4.0, the command
open -g -a Docker.appbegan to request privileged access: Docker Desktop needs privileged access to install its networking components and links to the Docker apps.@telamonian, did you find a way to get around this?
Disable builds on macOS-based agents
Disable builds on macOS-based Azure DevOps agents due to Docker Deskt…
rdvansloten commentedon Sep 25, 2021
Any update to this? Being able to default to Windows Containers automatically during install would be appreciated for automated rollouts. Default behavior is that it is spinning up Hyper-V VMs on consumer laptops...
laprogs commentedon Dec 13, 2021
Good morning. Is there any ETA for implementing what I described in #187 ?
CodeCyclone commentedon Jan 26, 2022
Can you please implement --windows-containers a flag to the installer. I see there is also --settings parameter but I don't know how to use it to switch to windows containers.
Would like to avoid the warning message to install WSL2.
nbdinara commentedon Jan 27, 2022
+1
"Can you please implement --windows-containers a flag to the installer. I see there is also --settings parameter but I don't know how to use it to switch to windows containers.
Would like to avoid the warning message to install WSL2."
CodeCyclone commentedon Mar 30, 2022
Having a switch for accepting license agreement is also needed for this
CodeCyclone commentedon Mar 30, 2022
Can anyone point me to the docker installer code? I assume some of these items are easier to add but it may require some plumbing through to the engine or they just require setting some config file I assume that isn't much work.
rfay commentedon Mar 30, 2022
Colima works with macOS CI and you don't have this problem (and there are not license problems). https://github.com/abiosoft/colima
rfay commentedon Apr 8, 2022
This seems to have been addressed in docker for mac 4.7.0, https://docs.docker.com/desktop/mac/install/#install-from-the-command-line
Also Windows: https://docs.docker.com/desktop/windows/install/#install-from-the-command-line
stephen-turner commentedon Apr 8, 2022
As @rfay says, this is mostly fixed in 4.7.0. We don't have a switch for Windows containers yet.
darxtorm commentedon Mar 31, 2023
+1 for the
--windows-containersflag on installation.I am currently using the
SwitchDaemonmethod after install, but without idempotence this method is unreliable, especially when unattended installation scripts might run more than once