6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/ventriloquist/cap/utils/debian/prepare_container_for_docker.rb', line 6
def self.prepare_container_for_docker(machine)
machine.communicate.tap do |comm|
if ! comm.test('test -f /etc/default/lxc')
comm.sudo '
cat <<STR > /etc/default/lxc
LXC_AUTO="false"
USE_LXC_BRIDGE="false"
STR
apt-get update && \
apt-get install -y --force-yes lxc \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold"'
end
if ! comm.test('$(grep -q "-e lxc" /etc/default/docker)')
comm.sudo '
cat <<STR >> /etc/default/docker
DOCKER_OPTS="-e lxc ${DOCKER_OPTS}"
STR
service docker restart && sleep 5'
end
end
end
|