./share/scripts/toolchain in docker-utils-0.1.27 vs ./share/scripts/toolchain in docker-utils-0.1.29
- old
+ new
@@ -59,18 +59,12 @@
guest_repo_root = Pathname.new('/src')
guest_cwd = guest_repo_root + rel_cwd
toolchain_docker_args.concat([
'-v', "#{host_repo_root}:#{guest_repo_root}",
- '-w', '/build'
+ '-w', guest_repo_root.to_s
])
-
- data_container_name = host_repo_root.basename.to_s + "-build"
-
- toolchain_docker_args.concat([
- "--volumes-from=#{data_container_name}"
- ])
end
# interactivity options
if $stdin.tty? and $stdout.tty?
toolchain_docker_args.concat(['-i', '-t'])
@@ -80,11 +74,15 @@
exposed_env_keys = ENV.keys - EXPUNGE_ENV_KEYS
container_env_keys = `docker inspect -f '{{.Config.Env}}' #{toolchain_image}`.chomp[1..-2].split(' ').map{ |pair| pair.split('=').first }
toolchain_docker_args.concat((exposed_env_keys - container_env_keys).map{ |k| ['-e', k] }.flatten)
toolchain_docker_args.concat([
- '-v', "#{ENV['HOME']}/.ssh:/root/.ssh"
+ '-v', '/run:/run/host',
+ '-v', "#{ENV['HOME']}/.dockercfg:/root/.dockercfg",
+
+ '-v', "#{ENV['HOME']}/.ssh:/root/.ssh",
+ '-v', "#{ENV['HOME']}/.gnupg:/root/.gnupg",
])
# network options
if options[:bind_net]
toolchain_docker_args.push '--net=host'
@@ -97,31 +95,7 @@
Kernel.system docker_bin_path, 'run', '--rm',
*toolchain_docker_args,
toolchain_image,
*subcommand
end
-
-if data_container_name
- data_container_image = 'tianon/true:latest'
- data_container_image_available = system docker_bin_path, 'inspect', '-f', '{{.Id}}', data_container_image, out: '/dev/null', err: '/dev/null'
- unless data_container_image_available or system(docker_bin_path, 'pull', data_container_image)
- $stderr.puts "could not locate data-container image '#{data_container_image}'; aborting"
- Kernel.exit 1
- end
-
- data_container_exists = system docker_bin_path, 'inspect', '-f', '{{.Id}}', data_container_name, out: '/dev/null', err: '/dev/null'
-
- #toolchain.call 'find', '/build', '-mindepth', '1', '-maxdepth', '1', '-type', 'l', '-exec', 'rm', '{}', ';'
- unless data_container_exists
- Kernel.system(
- docker_bin_path, 'run',
- "--name=#{data_container_name}",
- '-v', '/build',
- data_container_image
- )
-
- toolchain.call 'find', '/src', '-mindepth', '1', '-maxdepth', '1', '-exec', 'ln', '-sF', '{}', ';'
- end
-end
-
toolchain.call *toolchain_subcommand_args