-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command-line Arguments for /Applications/Docker.app/Contents/MacOS/Docker #2359
Comments
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
I just learned about the
|
/remove-lifecycle stale |
/lifecycle frozen |
For the basic question of "How to install docker-for-mac from the command line" this currently works:
|
Unfortunately, this ceases working in Docker Desktop for Mac 2.1.0.0 (docker v19.03.1). Now you get the error message:
Which breaks our CI :( For now, I can download earlier version, but Docker folk... please tell us how to do an unattended installation! |
/remove-lifecycle frozen |
/iifecycle frozen |
Any plans to get this addressed? I'm still being hit with this in CI |
Fixing this would be extremely helpful for our CI workflow too. Currently I'm using this workaround from @rfay as a temporary fix: |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecycle stale |
/lifecycle frozen |
Thanks for fixing that @cweagans - Would love to hear from the docker team on this simple issue, thanks! https://twitter.com/randyfay/status/1230757005792432128 |
I wrote about setting up docker headless in this post, it may be of help: |
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? |
I think a lot of people need this in order to get their CI test suites to pass. The use case is for when you need to run a docker that exposes a service (such as a local S3 server) to the test code. @satrapu seems to have also gone through similar issues with docker+mac+azure. Some useful info: https://crossprogramming.com/2019/12/27/use-docker-when-running-integration-tests-with-azure-pipelines.html#self-managed-docker-containers |
@myitcv Use Anyone know where that 61 comes from? - <string>59</string>
+ <string>61</string> |
It looks like you can get the vmnetd version number from
|
Docker has been doing all that is possible to prevent installing Docker Desktop without user interaction, thus, we can't run `sentry devservices up`. See docker/for-mac#2359 (comment) for details. This PR removes all code that at times had managed to automate the process on Mac. We will rely on Ubuntu to test the `make bootstrap` path. We also add caching for Brew.
oh well, we already disabled our macos pipelines due to unbearable slowlyness. Probably it is time to remove them completely and just forget about them |
Docker has been doing all that is possible to prevent installing Docker Desktop without user interaction, thus, we can't run `sentry devservices up`. See docker/for-mac#2359 (comment) for details. This PR removes all code that at times had managed to automate the process on Github runners. As a side feature, we add caching for Brew.
The following script seems to work on a brew install --cask docker
sudo /Applications/Docker.app/Contents/MacOS/Docker --unattended --install-privileged-components
open -a /Applications/Docker.app --args --unattended --accept-license
while ! /Applications/Docker.app/Contents/Resources/bin/docker info &>/dev/null; do sleep 1; done No manual copying of Docker's resources or plist hackery needed; Homebrew even takes care of the quarantine xattr automatically now. As far as I can tell, (Note: The Docker version installed by Homebrew was |
I've verified that @gwynne 's fix works on Github's macos-11 runners. |
@gwynne's work around is awesome and we can confirm it is working for us on macOS note: after a system reboot, the license accept didn't "stick" and the re-launched |
@gwynne's solution did work for me as well, although indeed it took 9m49s to run 😭 Every independent developer needs to do this on Github Actions, which is a bit ridiculous... |
I filed it here in case you want to up-vote it. |
@armenzg , that's a wrong place to request it as it's blocked on Docker side by their EULA: |
Thanks @MaceWindu ! |
the above comment worked great, but I happened to have #!/usr/bin/env bash
brew install --cask docker
docker_app_path=$(brew list --cask docker | grep '==> App' -A1 | tail -n 1 | awk '{ print $1 }')
docker_app_path="${docker_app_path/#\~/$HOME}"
sudo "$docker_app_path"/Contents/MacOS/Docker --unattended --install-privileged-components
open -a "$docker_app_path" --args --unattended --accept-license
while ! "$docker_app_path"/Contents/Resources/bin/docker info &>/dev/null; do sleep 1; done |
This is mostly fixed in Docker Desktop 4.7.0. Let's move the discussion to docker/roadmap#80. |
@stephen-turner installation is fixed. I don't see anything in the docs about how to start Docker Desktop from the command line. Am I just missing something? This issue is largely about being able to start/stop Docker Desktop. DDEV's tests would be far more stable if I could stop and start Docker Desktop before every test run. |
You're right, we don't have that part yet, that's docker/roadmap#172. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Docker for Mac 18.09.* [edit 2019-02-03]
Could you please let me know the allowed command-line arguments for /Applications/Docker.app/Contents/MacOS/Docker? I know that these sort-of work:
but only because I happened to find a reference to them in #882 (comment)
Currently I can sudo run /Applications/Docker.app/Contents/MacOS/Docker --unattended
in a headless environment, but only with sudo, and really want to know how to do it to set up docker for a normal user. (For testing on CircleCI)
Actual behavior
Information
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: