Skip to content

Instantly share code, notes, and snippets.

@aih
Last active October 24, 2021 17:55
Show Gist options
  • Save aih/eb0a692542f3068d27ec36f859821a31 to your computer and use it in GitHub Desktop.
Save aih/eb0a692542f3068d27ec36f859821a31 to your computer and use it in GitHub Desktop.
Restart docker on mac
$ docker-machine restart default
Restarting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for SSH to be available...
Detecting the provisioner...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ docker-machine env default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="..."
export DOCKER_CERT_PATH="..."
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env default)

$ eval $(docker-machine env default)

To make a port available on VirtualBox on MacOs, open the virtual machine in the Virtualbox UI, go to Networking ⇒ Advanced ⇒ Port forwarding and set the port forwarding. See https://www.jhipster.tech/tips/020_tip_using_docker_containers_as_localhost_on_mac_and_windows.html

After updating VirtualBox, it may be necessary to remove and re-create the default docker machine. This is to fix an issue with failed TLS and error messages relating to the certs for the docker machine:

$ docker-machine rm default
$ docker-machine create default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment