c***@gmail.com
2014-11-13 16:06:36 UTC
Hello, all
I have an Arch-Linux-based container image containing systemd, the SSH
server plus my application bits.
In order to run systemd, I need to include '--add-cap=ALL' in the
options for 'docker run'.
As far as I can see, vagrant's docker provider does not let me
specify such options, so 'vagrant up' always fails.
My questions:
1. have I missed something
2. is such a feature planned in an upcoming release of vagrant
3. Am I just 'Out Of Luck'
Some more details, in case they might be useful:
Docker version: 1.3.1
Vagrant version: 1.6.3
systemd version: 217
---------------------------------------------------
A shell command that works:
docker run -t --rm \
-e "container=docker" \
--cap-add=ALL \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-p 2222:22 \
localhost:5000/dafs/archlinux:stage2 \
/sbin/init
----------------------------------------------------
A Vagrantfile that fails
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.image = "localhost:5000/dafs/archlinux:stage2"
d.env = { "container" => "docker" }
d.volumes = [
"/sys/fs/cgroup:/sys/fs/cgroup:ro"
]
d.cmd = [ "/sbin/init" ]
d.remains_running = true
d.has_ssh = true
end
config.ssh.username="vagrant"
config.ssh.private_key_path="~/.vagrant.d/insecure_private_key"
end
----------------------------------------------------
The failure messages:
VAGRANT_DEFAULT_PROVIDER=docker vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Creating the container...
default: Name: dafs_default_1415886892
default: Image: localhost:5000/dafs/archlinux:stage2
default: Cmd: /sbin/init
default: Volume: /sys/fs/cgroup:/sys/fs/cgroup:ro
default: Volume: /var/cache/pacman/pkg:/var/cache/pacman/pkg
default: Volume: /mnt/repo/projects/dafs:/vagrant
default:
default: Container created: 7b1ce187354d9884
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.17.0.13:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
(some time later ...)
default: Warning: Connection refused. Retrying...
^C==> default: Waiting for cleanup before exiting...
Vagrant exited after cleanup due to external interrupt.
I have an Arch-Linux-based container image containing systemd, the SSH
server plus my application bits.
In order to run systemd, I need to include '--add-cap=ALL' in the
options for 'docker run'.
As far as I can see, vagrant's docker provider does not let me
specify such options, so 'vagrant up' always fails.
My questions:
1. have I missed something
2. is such a feature planned in an upcoming release of vagrant
3. Am I just 'Out Of Luck'
Some more details, in case they might be useful:
Docker version: 1.3.1
Vagrant version: 1.6.3
systemd version: 217
---------------------------------------------------
A shell command that works:
docker run -t --rm \
-e "container=docker" \
--cap-add=ALL \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-p 2222:22 \
localhost:5000/dafs/archlinux:stage2 \
/sbin/init
----------------------------------------------------
A Vagrantfile that fails
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.image = "localhost:5000/dafs/archlinux:stage2"
d.env = { "container" => "docker" }
d.volumes = [
"/sys/fs/cgroup:/sys/fs/cgroup:ro"
]
d.cmd = [ "/sbin/init" ]
d.remains_running = true
d.has_ssh = true
end
config.ssh.username="vagrant"
config.ssh.private_key_path="~/.vagrant.d/insecure_private_key"
end
----------------------------------------------------
The failure messages:
VAGRANT_DEFAULT_PROVIDER=docker vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Creating the container...
default: Name: dafs_default_1415886892
default: Image: localhost:5000/dafs/archlinux:stage2
default: Cmd: /sbin/init
default: Volume: /sys/fs/cgroup:/sys/fs/cgroup:ro
default: Volume: /var/cache/pacman/pkg:/var/cache/pacman/pkg
default: Volume: /mnt/repo/projects/dafs:/vagrant
default:
default: Container created: 7b1ce187354d9884
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.17.0.13:22
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
(some time later ...)
default: Warning: Connection refused. Retrying...
^C==> default: Waiting for cleanup before exiting...
Vagrant exited after cleanup due to external interrupt.
--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.