More explicit logging and 'dockerfile' option support

This commit is contained in:
Oleksiy Protas 2016-10-17 01:05:05 +03:00 committed by Brian Cain
parent cbc69f5158
commit 166fe374b6
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 22 additions and 5 deletions

View File

@ -43,14 +43,27 @@ module VagrantPlugins
args = machine.provider_config.build_args.clone
if machine.provider_config.dockerfile
dockerfile = machine.provider_config.dockerfile
dockerfile_path = File.join(build_dir, dockerfile)
dockerfile_path = build_dir ? File.join(build_dir, dockerfile) : dockerfile
args.push("--file").push(dockerfile_path)
machine.ui.output(
I18n.t("docker_provider.building_named_dockerfile",
file: machine.provider_config.dockerfile))
if build_dir
machine.ui.output(
I18n.t("docker_provider.building_named_dockerfile",
file: machine.provider_config.dockerfile))
else
machine.ui.output(
I18n.t("docker_provider.building_git_repo_named_dockerfile",
file: machine.provider_config.dockerfile,
repo: git_repo))
end
else
machine.ui.output(I18n.t("docker_provider.building"))
if build_dir
machine.ui.output(I18n.t("docker_provider.building"))
else
machine.ui.output(
I18n.t("docker_provider.building_git_repo",
repo: git_repo))
end
end
image = machine.provider.driver.build(

View File

@ -12,8 +12,12 @@ en:
Build image no longer exists. Rebuilding...
building: |-
Building the container from a Dockerfile...
building_git_repo: |-
Building the container from the git repository: %{repo}...
building_named_dockerfile: |-
Building the container from the named Dockerfile: %{file}...
building_git_repo_named_dockerfile: |-
Building the container from the named Dockerfile: %{file} in the git repository: %{repo}...
creating: |-
Creating the container...
created: |-