tôi thấy rằng Docker Toolbox là có sẵn thông qua brew/thùng
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Cask
brew install caskroom/cask/brew-cask
# Install docker toolbox
brew cask install docker-toolbox
Khi Docker Toolbox được cài đặt, bạn có thể thiết lập môi trường Docker của bạn bằng cách sử dụng hướng dẫn Get started with Docker Machine.
# create the docker machine
docker-machine create --driver "virtualbox" myBoxName
# start the docker machine
docker-machine start myBoxName
# this command allows the docker commands to be used in the terminal
eval "$(docker-machine env myBoxName)"
# at this point can run any "docker" or "docker-compose" commands you want
docker-compose up
Vào cuối của quá trình này, thêm eval "$(docker-machine env myBoxName)"
để bạn .bash_profile
hoặc bạn sẽ nhận được lỗi sau khi bạn mở một shell mới hoặc thiết bị đầu cuối.
"Cannot connect to the Docker daemon. Is the docker daemon running on this host?"
Nếu bạn bắt đầu container Docker sau khi mở các thiết bị đầu cuối, bạn có thể chạy eval "$(docker-machine env myBoxName)"
bằng tay, hoặc nạp lại hồ sơ bash của bạn (source ~/.bash_profile
).
Nguồn
2015-09-24 20:35:36
Lưu ý rằng [Docker cho Mac] (https://docs.docker.com/docker-for-mac /) hiện tồn tại, thay thế cho Docker Toolbox. Bạn có thể lấy nó qua [thùng homebrew] (https://github.com/caskroom/homebrew-cask/blob/master/Casks/docker.rb): 'brew cask install docker' – Dennis