$go_regexp = /FROM golang:(\S*).*?/ $go_version = File.readlines("build/Dockerfile").first { |line| line.match($go_regexp) }.match($go_regexp).captures.first if $go_version.nil? raise ArgumentError.new("Failed to read Go version from Dockerfile.") end $go_path = "/usr/local/go/bin" def install_packages(vm, pkgs) vm.provision :shell, :inline => <