作者:神秘雯泽芳子 | 来源:互联网 | 2023-08-25 16:12
昨天使用boot2docker作为docker的daemon,今天试试dvm,dvm其实基于boot2docker的镜像,使用vagrant来管理。使用boot2docker,什么
昨天使用boot2docker作为docker的daemon,今天试试dvm,dvm其实基于boot2docker的镜像,使用vagrant来管理。
使用boot2docker,什么都不干,需要占用560M左右的内存(进程名: VBoxHeadless),之后的开启的docker占用的内存则看具体的应用。
boot2docker使用发现,docker实例都结束之后,虚拟机的内存不释放,从500到到1G多一直不释放。
dvmhttps://github.com/fnichol/dvm
#安装cask来管理软件包
brew tap phinze/cask
brew install brew-cask
#安装vagrant
brew cask install vagrant --appdir=/Applications
# Install Docker Mac binary,之前装过则忽略
brew install docker
# Install dvm
brew tap fnichol/dvm
brew install dvm
# Bring up your Vagrant/Docker VM
dvm up
#设置环境变量,同boot2docker
# Set a DOCKER_HOST environment variable that points to your VM
eval $(dvm env)
# Run plain 'ol Docker commands right from your Mac
docker run cents cat /etc/issue
Quickstart:
dvm up
eval $(dvm env)
docker images
If you will only be using Docker with dvm, consider adding the following
to your ~/.bash_profile or ~/.bashrc to always have DOCKER_HOST properly
set:
eval "$(dvm env)”
$ dvm --help
Usage: dvm [-v|-h] command []
Options
--version, -v - Print the version and exit
--help, -h - Display CLI help (this output)
Commands
check Ensure that required software is installed and present
destroy Stops and deletes all traces of the vagrant machine
env Outputs environment variables for Docker to connect remotely
halt, stop Stops the vagrant machine
reload Restarts vagrant machine, loads new configuration
resume Resume the suspended vagrant machine
ssh Connects to the machine via SSH
status Outputs status of the vagrant machine
suspend, pause Suspends the machine
up, start Starts and provisions the vagrant environment
vagrant Issue subcommands directly to the vagrant CLI
#dvm 升级
brew update
brew upgrade dvm