sergeycherepanov/homebrew-docker-virtualbox: Docker workaround for Ryzentosh (AMD based Hackintosh)
2020-09-17 23:02:48 Author: github.com(查看原文) 阅读量:999 收藏

This formulas resolves the Docker issue on AMD based MacOS (Ryzentosh). But can be used on any Mac.

Installation

Install the Virtualbox from the Oracle website or via the homebrew:

brew cask install virtualbox

Install the docker-virtualbox via Homebrew

brew tap sergeycherepanov/docker-virtualbox
brew install docker-virtualbox

Configure the docker-virtualbox requirements

WARNING: Only this commands requires root permissions, all next should be run under your user

Ensure the NFS exports file exists

Allow the staff group to configure NFS shares and ip balancer without password prompt

sudo tee /etc/sudoers.d/docker-machine-nfs  <<SUDOERS
%staff ALL=(ALL) NOPASSWD: /sbin/nfsd
%staff ALL=(ALL) NOPASSWD: /bin/cp /etc/nfs.conf /etc/nfs.conf.bak
%staff ALL=(ALL) NOPASSWD: /usr/bin/tee /etc/exports
%staff ALL=(ALL) NOPASSWD: /usr/bin/tee /etc/nfs.conf
%staff ALL=(ALL) NOPASSWD: $(brew --prefix docker-virtualbox)/bin/gobetween
SUDOERS

Reboot your system to be sure that sudoers applied

Configure the environment

If you didn't install Docker for Mac you can link binaries instead of PATH update

brew link --force --overwrite docker-virtualbox

Otherwise configure the PATH variable

# For the bash
echo "export PATH=\"$(brew --prefix docker-virtualbox)/bin:\$PATH\"" >> ~/.bash_profile
# For the zsh
echo "export PATH=\"$(brew --prefix docker-virtualbox)/bin:\$PATH\"" >> ~/.zshrc

Reload the shell

exec $SHELL

Start the docker-virtualbox service

In the first run according to the permissions policy you need to run it manually and approve permissions.

It should download, create and configure the virtual machine

docker-machine-init initialize

When it will be finished you are ready to enable the service

The log file will be always available in /tmp/docker-virtualbox.log.

brew services start docker-virtualbox 

Verify installation

Test the Docker by running Nginx

docker run -d -p 8989:80 nginx
curl -v localhost:8989

Additional information

SSH connection to the docker-machine

docker-machine ssh docker

To stop the service just run

brew services stop docker-virtualbox 

To setup environment for 3rd party tools (ctop as example)

source /tmp/docker-virtualbox.env

文章来源: https://github.com/sergeycherepanov/homebrew-docker-virtualbox
如有侵权请联系:admin#unsafe.sh