MAC 下 Vagrant 安装 Dokku

2018-05-29  本文已影响0人  思考蛙

MAC 下 Vagrant 安装 Dokku

安装 Vagrant

git clone https://github.com/dokku/dokku.git

Create VM

shell
# Optional ENV arguments:
# - `BOX_NAME`
# - `BOX_URI`
# - `BOX_MEMORY`
# - `DOKKU_DOMAIN`
# - `DOKKU_IP`
# - `FORWARDED_PORT`.
cd path/to/dokku
vagrant up

如果有 IP 冲突的问题,修改 Vagrantfile circle.yml 中对应的 IP 地址

配置 Dokku 容器的 SSHKey

cat ~/.ssh/id_rsa.pub | ssh root@dokku.me "sudo sshcommand acl-add dokku progrium"

执行 dokku-installer

以 root 身份登录进 dokku 容器

ssh root@dokku.me
  1. Ubuntu 官方中国(目前是阿里云)

Ubuntu 14.4

deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

#测试版源
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# 源码
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
##测试版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse


  1. 安装源

    • 备份源
      sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
    • 而后用gedit或其他编辑器打开:
    Ubuntu Logo.png gksu gedit /etc/apt/sources.list
    Kubuntu Logo.png kdesudo kate /etc/apt/sources.list  
    Xubuntu Logo.png gksu mousepad /etc/apt/sources.list
    Xubuntu Logo.png gksu leafpad /etc/apt/sources.list # 12.04
    sudo apt edit-sources # CLI
    
  2. 更新源
    sudo apt-get update

  3. Bash 方式安装 Dokku

 # for debian systems, installs dokku via apt-get
 $ wget https://raw.githubusercontent.com/dokku/dokku/v0.7.1/bootstrap.sh
 $ sudo DOKKU_TAG=v0.7.1 bash bootstrap.sh
 # go to your server's IP and follow the web installer
  1. APT 方式安装 Dokku
 # install docker
 $ wget -nv -O - https://get.docker.com/ | sh
 # setup dokku apt repository
 $ wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
 $ export SOURCE="https://packagecloud.io/dokku/dokku/ubuntu/"
 $ echo "deb $SOURCE trusty main" | tee /etc/apt/sources.list.d/dokku.list
 $ apt-get update
 # install dokku
 $ apt-get install dokku
 $ dokku plugin:install-dependencies --core # run with root!
 # go to your server's IP and follow the web installer

建议配置 Docker 加速器

Daocolud

https://www.daocloud.io/mirror#accelerator-doc

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://ec635062.m.daocloud.io

如果 sudo DOKKU_TAG=v0.7.1 bash bootstrap.sh 执行速度很慢,建议先执行

docker pull gliderlabs/herokuish

Herokuish 源

如果 dokku 安装时提示 IP 冲突,需要修改 dokku/Vagrantfile dokku/circle.yml

并设置 /etc/hosts
例:

192.168.0.2    dokku.me
192.168.0.2    node-js-sample.dokku.me

一些参考

Install Dokku using Vagrant

[Dokku和Docker的完美配合] (https://segmentfault.com/a/1190000002554114)

Playing with Dokku on Vagrant

Vagrant and Dokku on OSX

Dokku on Vagrant and AWS with Postgres

一些有用的资源

Heroku SRC
Dokku SRC
Dokku DOC

Docker-machine

Docker-machine-SRC

Using Vagrant and Docker Machine Together

CNPM

tutum-mysql

登录 dokku

/Users/bison/__task/workspace/__lessons/__dokku/dokku
ssh root@dokku.me

git remote add dokku dokku@dokku.me:ruby-rails-sample
git push dokku master

dokku config:set nodejs-sample BUILDPACK_URL=https://git.coding.net/baisheng/local-buildpack-nodejs.git

上一篇 下一篇

猜你喜欢

热点阅读