-
Notifications
You must be signed in to change notification settings - Fork 950
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vagrant support for pouch (#2168)
* Add vagrant support for pouch * Move Vagrantfile to top dir. Signed-off-by: Mark Liu <[email protected]>
- Loading branch information
Showing
6 changed files
with
86 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Vagrant support for pouch | ||
|
||
You can using Vagrant to quickly experience pouch or cross compile on non-linux. | ||
|
||
## Requirements | ||
|
||
* Vagrant 1.9.x or newer | ||
* VirtuaBox | ||
|
||
## Get started | ||
|
||
```bash | ||
vagrant up | ||
vagrant ssh -c "sudo -i" | ||
|
||
# Start a nginx container with 80 | ||
pouch run -d --name nginx -p 80:80 nginx | ||
curl http://localhost | ||
``` | ||
|
||
## Build pouch with vagrant | ||
|
||
```bash | ||
|
||
# On MacOS or Linux | ||
export POUCH_BUILD=true | ||
vagrant up | ||
|
||
# On Windows | ||
set POUCH_BUILD=true | ||
vagrant up | ||
|
||
# Install compiled pouch binarys for pouch service. | ||
vagrant ssh -c "sudo -i" | ||
cd ~/go/src/github.com/alibaba/pouch | ||
make DEST_DIR=/usr install | ||
systemctl restart pouch | ||
pouch version | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# All Vagrant configuration is done below. The "2" in Vagrant.configure | ||
# configures the configuration version (we support older styles for | ||
# backwards compatibility). Please don't change it unless you know what | ||
# you're doing. | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
Vagrant.require_version ">= 1.7.4" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.define :pouch do |pouch| | ||
pouch.vm.hostname = "pouch" | ||
pouch.vm.box = "ubuntu/xenial64" | ||
pouch.vm.provision "shell", inline: <<-SHELL | ||
until apt-get update &> /dev/null; do echo "Waiting apt-get for 3 seconds..."; sleep 3; done | ||
apt-get --no-install-recommends install lxcfs | ||
apt-get --no-install-recommends install curl apt-transport-https ca-certificates software-properties-common | ||
curl -fsSL http://mirrors.aliyun.com/opsx/pouch/linux/debian/[email protected] | apt-key add - | ||
add-apt-repository "deb http://mirrors.aliyun.com/opsx/pouch/linux/debian/ pouch stable" | ||
apt-get update | ||
apt-get --no-install-recommends install pouch | ||
systemctl enable pouch | ||
systemctl start pouch | ||
echo "alias docker='pouch'" >> ~/.bashrc | ||
SHELL | ||
|
||
if ENV["POUCH_BUILD"] == "true" | ||
pouch.vm.provision "shell", inline: <<-SHELL | ||
# configring environments for pouch | ||
GO_VERSION=1.9.1 | ||
GOPATH=/root/go | ||
apt-get install -y --no-install-recommends build-essential | ||
wget --progress=bar:force:noscroll https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz -O /tmp/go$GO_VERSION.linux-amd64.tar.gz | ||
tar xf /tmp/go$GO_VERSION.linux-amd64.tar.gz -C /opt/ | ||
echo "export GOROOT=/opt/go" >> ~/.bashrc | ||
echo "export GOPATH=$GOPATH" >> ~/.bashrc | ||
cd /usr/bin && find /opt/go/bin -type f | xargs -n1 ln -f -s | ||
mkdir -p $GOPATH/src/github.com/alibaba | ||
ln -s /vagrant $GOPATH/src/github.com/alibaba/pouch | ||
cd $GOPATH/src/github.com/alibaba/pouch && make install | ||
SHELL | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.