vagrant-lxc 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.vimrc +1 -1
- data/CHANGELOG.md +22 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +10 -9
- data/README.md +43 -29
- data/boxes/quantal64/download-ubuntu +21 -20
- data/boxes/quantal64/lxc-template +11 -11
- data/boxes/quantal64/metadata.json +1 -1
- data/development/Vagrantfile +8 -4
- data/example/Vagrantfile +3 -15
- data/lib/vagrant-lxc.rb +0 -2
- data/lib/vagrant-lxc/action.rb +1 -14
- data/lib/vagrant-lxc/action/boot.rb +8 -9
- data/lib/vagrant-lxc/action/check_created.rb +6 -2
- data/lib/vagrant-lxc/action/check_running.rb +6 -2
- data/lib/vagrant-lxc/action/compress_rootfs.rb +1 -1
- data/lib/vagrant-lxc/action/create.rb +15 -7
- data/lib/vagrant-lxc/action/created.rb +6 -2
- data/lib/vagrant-lxc/action/destroy.rb +6 -2
- data/lib/vagrant-lxc/action/disconnect.rb +5 -1
- data/lib/vagrant-lxc/action/forced_halt.rb +3 -3
- data/lib/vagrant-lxc/action/forward_ports.rb +2 -2
- data/lib/vagrant-lxc/action/handle_box_metadata.rb +38 -27
- data/lib/vagrant-lxc/action/is_running.rb +6 -2
- data/lib/vagrant-lxc/action/share_folders.rb +8 -8
- data/lib/vagrant-lxc/config.rb +20 -10
- data/lib/vagrant-lxc/driver.rb +162 -0
- data/lib/vagrant-lxc/driver/builder.rb +21 -0
- data/lib/vagrant-lxc/{container → driver}/cli.rb +16 -11
- data/lib/vagrant-lxc/driver/fetch_ip_from_dnsmasq.rb +41 -0
- data/lib/vagrant-lxc/driver/fetch_ip_with_attach.rb +29 -0
- data/lib/vagrant-lxc/errors.rb +10 -0
- data/lib/vagrant-lxc/plugin.rb +4 -0
- data/lib/vagrant-lxc/provider.rb +14 -11
- data/lib/vagrant-lxc/version.rb +1 -1
- data/spec/fixtures/sample-ip-addr-output +2 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/unit/action/compress_rootfs_spec.rb +4 -4
- data/spec/unit/action/forward_ports_spec.rb +3 -3
- data/spec/unit/action/handle_box_metadata_spec.rb +52 -26
- data/spec/unit/{container → driver}/cli_spec.rb +17 -19
- data/spec/unit/driver_spec.rb +173 -0
- data/tasks/boxes.rake +3 -3
- metadata +13 -15
- data/lib/vagrant-lxc/action/base_action.rb +0 -11
- data/lib/vagrant-lxc/action/network.rb +0 -21
- data/lib/vagrant-lxc/container.rb +0 -141
- data/lib/vagrant-lxc/machine_state.rb +0 -25
- data/spec/fixtures/sample-ifconfig-output +0 -18
- data/spec/unit/container_spec.rb +0 -147
- data/spec/unit/machine_state_spec.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9e378441e40002c34e265155c4066485bf4e00
|
4
|
+
data.tar.gz: 26cfdc7e029ba157e961944c2346fa1e3d3b5135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20495f21d5311e8397de76cfab8d01cb40247dca891a5051382b16e5b4ba6a948f4708addcafc691384a6f82aca1dc64b7318ea03b98a65c3ca3bb64bcd43010
|
7
|
+
data.tar.gz: d9b10838087a6d919a83c28430e8c657bd2fddf0223f9cd910d64f6051591a912cf7308ece39f5535ea4c24b02dcdb2124af5d5633b14680b73e09ad9d986b2c
|
data/.gitignore
CHANGED
data/.vimrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
set wildignore+=*/
|
1
|
+
set wildignore+=*/boxes/quantal64/rootfs/*,*/boxes/quantal64/partial/*
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## [0.3.0](https://github.com/fgrehm/vagrant-lxc/compare/v0.2.0...v0.3.0)
|
2
|
+
|
3
|
+
BACKWARDS INCOMPATIBILITIES:
|
4
|
+
|
5
|
+
- Boxes `lxc-template` should support a `--tarball` parameter
|
6
|
+
- `start_opts` config was renamed to `customize`, please check the README for the expected parameters
|
7
|
+
- V1 boxes are no longer supported
|
8
|
+
- `target_rootfs_path` is no longer supported, just symlink `/var/lib/lxc` to the desired folder in case you want to point it to another partition
|
9
|
+
|
10
|
+
IMPROVEMENTS:
|
11
|
+
|
12
|
+
- lxc templates are removed from lxc template dir after container is created
|
13
|
+
- Treat NFS shared folders as a normal shared folder instead of ignoring it so we can share the same Vagrantfile with VBox environments
|
14
|
+
- Support for lxc 0.7.5 (tested on Ubuntu 12.04) [#49](https://github.com/fgrehm/vagrant-lxc/issues/49)
|
15
|
+
- Remove `/tmp` files when packaging quantal64 base box [#48](https://github.com/fgrehm/vagrant-lxc/issues/48)
|
16
|
+
- Avoid picking the best mirror on quantal64 base box [#38](https://github.com/fgrehm/vagrant-lxc/issues/38)
|
17
|
+
|
18
|
+
BUG FIXES:
|
19
|
+
|
20
|
+
- Redirect `redir`'s stderr output to `/dev/null` [#51](https://github.com/fgrehm/vagrant-lxc/issues/51)
|
21
|
+
- Switch from `ifconfig` to `ip` to grab container's IP to avoid localization issues [#50](https://github.com/fgrehm/vagrant-lxc/issues/50)
|
22
|
+
|
1
23
|
## [0.2.0](https://github.com/fgrehm/vagrant-lxc/compare/v0.1.1...v0.2.0)
|
2
24
|
|
3
25
|
- Experimental box packaging (only tested with Ubuntu 64 base box)
|
data/Gemfile
CHANGED
@@ -6,7 +6,7 @@ group :development do
|
|
6
6
|
# We depend on Vagrant for development, but we don't add it as a
|
7
7
|
# gem dependency because we expect to be installed within the
|
8
8
|
# Vagrant environment itself using `vagrant plugin`.
|
9
|
-
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
|
9
|
+
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v1.1.5'
|
10
10
|
gem 'guard'
|
11
11
|
gem 'guard-rspec'
|
12
12
|
gem 'guard-bundler'
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/mitchellh/vagrant.git
|
3
|
-
revision:
|
3
|
+
revision: 64e360814c3ad960d810456add977fd4c7d47ce6
|
4
|
+
tag: v1.1.5
|
4
5
|
specs:
|
5
|
-
vagrant (1.1.
|
6
|
+
vagrant (1.1.5)
|
6
7
|
childprocess (~> 0.3.7)
|
7
8
|
erubis (~> 2.7.0)
|
8
9
|
i18n (~> 0.6.0)
|
@@ -14,7 +15,7 @@ GIT
|
|
14
15
|
PATH
|
15
16
|
remote: .
|
16
17
|
specs:
|
17
|
-
vagrant-lxc (0.
|
18
|
+
vagrant-lxc (0.3.0)
|
18
19
|
|
19
20
|
GEM
|
20
21
|
remote: https://rubygems.org/
|
@@ -22,21 +23,22 @@ GEM
|
|
22
23
|
childprocess (0.3.9)
|
23
24
|
ffi (~> 1.0, >= 1.0.11)
|
24
25
|
coderay (1.0.9)
|
25
|
-
diff-lcs (1.2.
|
26
|
+
diff-lcs (1.2.2)
|
26
27
|
erubis (2.7.0)
|
27
28
|
ffi (1.6.0)
|
28
|
-
|
29
|
+
formatador (0.2.4)
|
30
|
+
guard (1.7.0)
|
31
|
+
formatador (>= 0.2.4)
|
29
32
|
listen (>= 0.6.0)
|
30
33
|
lumberjack (>= 1.0.2)
|
31
34
|
pry (>= 0.9.10)
|
32
|
-
terminal-table (>= 1.4.3)
|
33
35
|
thor (>= 0.14.6)
|
34
36
|
guard-bundler (1.0.0)
|
35
37
|
bundler (~> 1.0)
|
36
38
|
guard (~> 1.1)
|
37
39
|
guard-ctags-bundler (0.1.6)
|
38
40
|
guard (>= 1.1)
|
39
|
-
guard-rspec (2.5.
|
41
|
+
guard-rspec (2.5.2)
|
40
42
|
guard (>= 1.1)
|
41
43
|
rspec (~> 2.11)
|
42
44
|
i18n (0.6.4)
|
@@ -73,8 +75,7 @@ GEM
|
|
73
75
|
simplecov-html (~> 0.7.1)
|
74
76
|
simplecov-html (0.7.1)
|
75
77
|
slop (3.4.4)
|
76
|
-
|
77
|
-
thor (0.18.0)
|
78
|
+
thor (0.18.1)
|
78
79
|
|
79
80
|
PLATFORMS
|
80
81
|
ruby
|
data/README.md
CHANGED
@@ -1,22 +1,27 @@
|
|
1
1
|
# vagrant-lxc [](https://travis-ci.org/fgrehm/vagrant-lxc) [](http://badge.fury.io/rb/vagrant-lxc) [](https://codeclimate.com/github/fgrehm/vagrant-lxc)
|
2
2
|
|
3
|
-
|
3
|
+
Linux Containers support for Vagrant 1.1+
|
4
4
|
|
5
5
|
|
6
6
|
## Dependencies
|
7
7
|
|
8
|
-
Vagrant 1.1+ (1.1.
|
9
|
-
|
8
|
+
* Vagrant 1.1+ (1.1.3+ recommended)
|
9
|
+
* lxc 0.7.5+ (0.8.0-rc1+ recommended)
|
10
|
+
* redir
|
11
|
+
* A Kernel [higher than 3.5.0-17.28](#help-im-unable-to-restart-containers)
|
12
|
+
|
13
|
+
On a clean Ubuntu 12.10 machine it means something like:
|
10
14
|
|
11
15
|
```
|
12
16
|
sudo apt-get update && sudo apt-get dist-upgrade
|
13
17
|
sudo apt-get install lxc redir
|
14
|
-
|
18
|
+
# Downloads and install Vagrant 1.1.5
|
19
|
+
wget "http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_`uname -m`.deb" -O /tmp/vagrant.deb
|
15
20
|
sudo dpkg -i /tmp/vagrant.deb
|
16
21
|
```
|
17
22
|
|
18
23
|
|
19
|
-
## What is currently supported? (v0.
|
24
|
+
## What is currently supported? (v0.3.0)
|
20
25
|
|
21
26
|
Pretty much everything you need from Vagrant:
|
22
27
|
|
@@ -27,13 +32,13 @@ Pretty much everything you need from Vagrant:
|
|
27
32
|
* Port forwarding
|
28
33
|
|
29
34
|
*Please refer to the [closed issues](https://github.com/fgrehm/vagrant-lxc/issues?labels=&milestone=&page=1&state=closed)
|
30
|
-
|
35
|
+
and the [changelog](CHANGELOG.md) for most up to date information.*
|
31
36
|
|
32
37
|
|
33
38
|
## Current limitations
|
34
39
|
|
35
40
|
* Does not detect forwarded ports collision, right now you are responsible for taking care of that
|
36
|
-
* A hell lot of `sudo`s
|
41
|
+
* A hell lot of `sudo`s (this will probably be like this until [user namespaces](http://s3hh.wordpress.com/2013/02/12/user-namespaces-lxc-meeting/) are supported)
|
37
42
|
* Only a [single ubuntu box supported](boxes)
|
38
43
|
* "[works on my machine](https://github.com/fgrehm/vagrant-lxc/issues/20)" (TM)
|
39
44
|
* [Does not tell you if dependencies are not met](https://github.com/fgrehm/vagrant-lxc/issues/11)
|
@@ -42,42 +47,52 @@ for the most up to date list.*
|
|
42
47
|
and some known [bugs](https://github.com/fgrehm/vagrant-lxc/issues?labels=bug&page=1&state=open)
|
43
48
|
|
44
49
|
|
50
|
+
## Installation
|
51
|
+
|
52
|
+
```
|
53
|
+
vagrant plugin install vagrant-lxc
|
54
|
+
```
|
55
|
+
|
45
56
|
## Usage
|
46
57
|
|
47
|
-
|
58
|
+
After installing, add the quantal64 base box using any name you want:
|
48
59
|
|
49
60
|
```
|
50
|
-
vagrant
|
61
|
+
vagrant box add lxc-quantal64 http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-04-10.box
|
51
62
|
```
|
52
63
|
|
53
|
-
|
64
|
+
Make a Vagrantfile that looks like the following, filling in your information where necessary:
|
54
65
|
|
55
66
|
```ruby
|
56
67
|
Vagrant.configure("2") do |config|
|
57
|
-
config.vm.box
|
58
|
-
config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-31.box'
|
59
|
-
|
60
|
-
# Share an additional folder to the guest Container. The first argument
|
61
|
-
# is the path on the host to the actual folder. The second argument is
|
62
|
-
# the path on the guest to mount the folder. And the optional third
|
63
|
-
# argument is a set of non-required options.
|
64
|
-
config.vm.synced_folder "/tmp", "/host_tmp"
|
68
|
+
config.vm.box = "lxc-quantal64"
|
65
69
|
|
70
|
+
# You can omit this block if you don't need to override any container setting
|
66
71
|
config.vm.provider :lxc do |lxc|
|
67
|
-
#
|
68
|
-
lxc.
|
69
|
-
#
|
70
|
-
lxc.
|
71
|
-
# Limits swap size
|
72
|
-
lxc.start_opts << 'lxc.cgroup.memory.memsw.limit_in_bytes=500M'
|
72
|
+
# OPTIONAL: Same effect as as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
|
73
|
+
lxc.customize 'cgroup.memory.limit_in_bytes', '1024M'
|
74
|
+
# OPTIONAL: Limits swap size
|
75
|
+
lxc.customize 'cgroup.memory.memsw.limit_in_bytes', '512M'
|
73
76
|
end
|
74
|
-
|
75
|
-
# ... your puppet / chef / shell provisioner configs here ...
|
76
77
|
end
|
77
78
|
```
|
78
79
|
|
80
|
+
And finally run `vagrant up --provider=lxc`.
|
81
|
+
|
79
82
|
If you are on a mac or window host and still want to try this plugin out, you
|
80
|
-
can use the [same Vagrant VirtualBox machine I use for development](#using-virtualbox-
|
83
|
+
can use the [same Vagrant VirtualBox machine I use for development](#using-virtualbox-for-development).
|
84
|
+
|
85
|
+
### Storing container's rootfs on a separate partition
|
86
|
+
|
87
|
+
Before the 0.3.0 version of this plugin, there used to be a support for specifying
|
88
|
+
the container's rootfs path from the `Vagrantfile`, on 0.3.0 this was removed as you
|
89
|
+
can achieve the same effect by symlinking or mounting `/var/lib/lxc` on a separate
|
90
|
+
partition.
|
91
|
+
|
92
|
+
### NFS shared folders
|
93
|
+
|
94
|
+
NFS shared folders are not supported and will behave as a "normal" shared folder
|
95
|
+
so we can share the same Vagrantfile with VBox environments.
|
81
96
|
|
82
97
|
|
83
98
|
## Development
|
@@ -85,7 +100,7 @@ can use the [same Vagrant VirtualBox machine I use for development](#using-virtu
|
|
85
100
|
If want to develop from your physical machine, just sing that same old song:
|
86
101
|
|
87
102
|
```
|
88
|
-
git clone git://github.com/fgrehm/vagrant-lxc.git
|
103
|
+
git clone git://github.com/fgrehm/vagrant-lxc.git
|
89
104
|
cd vagrant-lxc
|
90
105
|
bundle install
|
91
106
|
bundle exec rake # to run all specs
|
@@ -98,7 +113,6 @@ bundle exec rake boxes:quantal64:build
|
|
98
113
|
vagrant box add quantal64 boxes/output/lxc-quantal64.box
|
99
114
|
```
|
100
115
|
|
101
|
-
|
102
116
|
### Using `vagrant-lxc` to develop itself
|
103
117
|
|
104
118
|
Yes! The gem has been [bootstrapped](http://en.wikipedia.org/wiki/Bootstrapping_(compilers)
|
@@ -15,16 +15,15 @@ suggest_flush()
|
|
15
15
|
|
16
16
|
cleanup()
|
17
17
|
{
|
18
|
-
rm -rf $cache/partial
|
19
|
-
rm -rf $cache/rootfs
|
18
|
+
rm -rf $cache/partial
|
19
|
+
rm -rf $cache/rootfs
|
20
20
|
}
|
21
21
|
|
22
22
|
write_sourceslist()
|
23
23
|
{
|
24
24
|
# $1 => path to the rootfs
|
25
25
|
|
26
|
-
|
27
|
-
MIRROR=${MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}
|
26
|
+
MIRROR=${MIRROR:-http://archive.ubuntu.com/ubuntu}
|
28
27
|
SECURITY_MIRROR=${SECURITY_MIRROR:-http://security.ubuntu.com/ubuntu}
|
29
28
|
|
30
29
|
cat >> "$1/etc/apt/sources.list" << EOF
|
@@ -41,18 +40,18 @@ download_ubuntu()
|
|
41
40
|
|
42
41
|
trap cleanup EXIT SIGHUP SIGINT SIGTERM
|
43
42
|
# check the mini ubuntu was not already downloaded
|
44
|
-
mkdir -p "$cache/partial
|
43
|
+
mkdir -p "$cache/partial"
|
45
44
|
if [ $? -ne 0 ]; then
|
46
|
-
echo "Failed to create '$cache/partial
|
45
|
+
echo "Failed to create '$cache/partial' directory"
|
47
46
|
return 1
|
48
47
|
fi
|
49
48
|
|
50
49
|
# download a mini ubuntu into a cache
|
51
50
|
echo "Downloading ubuntu $release minimal ..."
|
52
51
|
if [ -n "$(which qemu-debootstrap)" ]; then
|
53
|
-
qemu-debootstrap --verbose --components=main,universe --arch=$arch --include=$packages $release $cache/partial
|
52
|
+
qemu-debootstrap --verbose --components=main,universe --arch=$arch --include=$packages $release $cache/partial $MIRROR
|
54
53
|
else
|
55
|
-
debootstrap --verbose --components=main,universe --arch=$arch --include=$packages $release $cache/partial
|
54
|
+
debootstrap --verbose --components=main,universe --arch=$arch --include=$packages $release $cache/partial $MIRROR
|
56
55
|
fi
|
57
56
|
|
58
57
|
if [ $? -ne 0 ]; then
|
@@ -63,27 +62,27 @@ download_ubuntu()
|
|
63
62
|
# Serge isn't sure whether we should avoid doing this when
|
64
63
|
# $release == `distro-info -d`
|
65
64
|
echo "Installing updates"
|
66
|
-
> $cache/partial
|
67
|
-
write_sourceslist $cache/partial
|
65
|
+
> $cache/partial/etc/apt/sources.list
|
66
|
+
write_sourceslist $cache/partial/ $arch
|
68
67
|
|
69
|
-
chroot "$1/partial
|
68
|
+
chroot "$1/partial" apt-get update
|
70
69
|
if [ $? -ne 0 ]; then
|
71
70
|
echo "Failed to update the apt cache"
|
72
71
|
return 1
|
73
72
|
fi
|
74
|
-
cat > "$1/partial
|
73
|
+
cat > "$1/partial"/usr/sbin/policy-rc.d << EOF
|
75
74
|
#!/bin/sh
|
76
75
|
exit 101
|
77
76
|
EOF
|
78
|
-
chmod +x "$1/partial
|
77
|
+
chmod +x "$1/partial"/usr/sbin/policy-rc.d
|
79
78
|
|
80
|
-
lxc-unshare -s MOUNT -- chroot "$1/partial
|
79
|
+
lxc-unshare -s MOUNT -- chroot "$1/partial" apt-get dist-upgrade -y || { suggest_flush; false; }
|
81
80
|
|
82
|
-
rm -f "$1/partial
|
81
|
+
rm -f "$1/partial"/usr/sbin/policy-rc.d
|
83
82
|
|
84
|
-
chroot "$1/partial
|
83
|
+
chroot "$1/partial" apt-get clean
|
85
84
|
|
86
|
-
mv "$1/partial
|
85
|
+
mv "$1/partial" "$1/rootfs"
|
87
86
|
trap EXIT
|
88
87
|
trap SIGINT
|
89
88
|
trap SIGTERM
|
@@ -96,14 +95,14 @@ declare cache=`readlink -f .` \
|
|
96
95
|
arch=amd64 \
|
97
96
|
release=quantal
|
98
97
|
|
99
|
-
if [ -d "${cache}/rootfs
|
100
|
-
echo 'The rootfs cache has been
|
98
|
+
if [ -d "${cache}/rootfs" ]; then
|
99
|
+
echo 'The rootfs cache has been built already, please remove it if you want to update'
|
101
100
|
exit 1
|
102
101
|
fi
|
103
102
|
|
104
103
|
download_ubuntu $cache $arch $release
|
105
104
|
|
106
|
-
rootfs="${cache}/rootfs
|
105
|
+
rootfs="${cache}/rootfs"
|
107
106
|
|
108
107
|
echo "installing puppet"
|
109
108
|
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb -O "${rootfs}/tmp/puppetlabs-release-${release}.deb"
|
@@ -118,3 +117,5 @@ curl -L https://www.opscode.com/chef/install.sh -k | sudo bash
|
|
118
117
|
EOF
|
119
118
|
chmod +x $rootfs/tmp/install-chef.sh
|
120
119
|
chroot $rootfs /tmp/install-chef.sh
|
120
|
+
|
121
|
+
rm -rf $rootfs/tmp/*
|
@@ -155,16 +155,17 @@ EOF
|
|
155
155
|
fi
|
156
156
|
}
|
157
157
|
|
158
|
-
|
158
|
+
extract_rootfs()
|
159
159
|
{
|
160
|
-
|
160
|
+
tarball=$1
|
161
161
|
arch=$2
|
162
162
|
rootfs=$3
|
163
163
|
|
164
|
-
|
165
|
-
echo "Copying rootfs to $rootfs ..."
|
164
|
+
echo "Extracting $tarball ..."
|
166
165
|
mkdir -p $(dirname $rootfs)
|
167
|
-
|
166
|
+
# Make sure the rootfs does not exist before extracting
|
167
|
+
rm -rf $rootfs
|
168
|
+
(cd `dirname $rootfs` && tar xfz $tarball)
|
168
169
|
return 0
|
169
170
|
}
|
170
171
|
|
@@ -172,7 +173,7 @@ install_ubuntu()
|
|
172
173
|
{
|
173
174
|
rootfs=$1
|
174
175
|
release=$2
|
175
|
-
|
176
|
+
tarball=$3
|
176
177
|
mkdir -p /var/lock/subsys/
|
177
178
|
|
178
179
|
(
|
@@ -182,8 +183,7 @@ install_ubuntu()
|
|
182
183
|
return 1
|
183
184
|
fi
|
184
185
|
|
185
|
-
|
186
|
-
copy_ubuntu $cache $arch $rootfs
|
186
|
+
extract_rootfs $tarball $arch $rootfs
|
187
187
|
if [ $? -ne 0 ]; then
|
188
188
|
echo "Failed to copy rootfs"
|
189
189
|
return 1
|
@@ -454,7 +454,7 @@ EOF
|
|
454
454
|
return 0
|
455
455
|
}
|
456
456
|
|
457
|
-
options=$(getopt -o a:b:hp:r:xn:FS:d:C -l arch:,help,path:,release:,trim,name:,flush-cache,auth-key:,debug:,
|
457
|
+
options=$(getopt -o a:b:hp:r:xn:FS:d:C -l arch:,help,path:,release:,trim,name:,flush-cache,auth-key:,debug:,tarball: -- "$@")
|
458
458
|
if [ $? -ne 0 ]; then
|
459
459
|
usage $(basename $0)
|
460
460
|
exit 1
|
@@ -496,7 +496,7 @@ do
|
|
496
496
|
-h|--help) usage $0 && exit 0;;
|
497
497
|
-p|--path) path=$2; shift 2;;
|
498
498
|
-n|--name) name=$2; shift 2;;
|
499
|
-
-
|
499
|
+
-T|--tarball) tarball=$2; shift 2;;
|
500
500
|
-r|--release) release=$2; shift 2;;
|
501
501
|
-a|--arch) arch=$2; shift 2;;
|
502
502
|
-x|--trim) trim_container=1; shift 1;;
|
@@ -539,7 +539,7 @@ else
|
|
539
539
|
rootfs=$path/rootfs
|
540
540
|
fi
|
541
541
|
|
542
|
-
install_ubuntu $rootfs $release $
|
542
|
+
install_ubuntu $rootfs $release $tarball
|
543
543
|
if [ $? -ne 0 ]; then
|
544
544
|
echo "failed to install ubuntu $release"
|
545
545
|
exit 1
|
data/development/Vagrantfile
CHANGED
@@ -49,17 +49,21 @@ Vagrant.configure("2") do |config|
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
config.vm.define :precise do |precise|
|
53
|
+
precise.vm.box = 'precise64'
|
54
|
+
precise.vm.hostname = 'vbox'
|
55
|
+
precise.vm.box_url = 'http://files.vagrantup.com/precise64.box'
|
56
|
+
end
|
57
|
+
|
52
58
|
config.vm.define :lxc do |lxc_config|
|
53
59
|
lxc_config.vm.hostname = 'lxc-dev-box'
|
54
|
-
lxc_config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-
|
60
|
+
lxc_config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-04-10.box'
|
55
61
|
# Uncomment to test boxes built locally:
|
56
62
|
# lxc_config.vm.box_url = '../boxes/output/lxc-quantal64.box'
|
57
63
|
|
58
64
|
lxc_config.vm.provider :lxc do |lxc|
|
59
65
|
# Required to boot nested containers
|
60
|
-
lxc.
|
61
|
-
# Change this to override the path where the rootfs gets stored
|
62
|
-
# lxc.target_rootfs_path = '/path/to/vagrant-lxc-dev-box-rootfs'
|
66
|
+
lxc.customize 'aa_profile', 'unconfined'
|
63
67
|
end
|
64
68
|
end
|
65
69
|
|