diff --git a/CHANGELOG.md b/CHANGELOG.md index 1369d1c3b..34f0f83df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ BUG FIXES: - core: Fix cases where sometimes SSH connection would hang. - providers/docker: Create args works. [GH-4526] + - providers/docker: Nicer error if package is called. [GH-4595] - providers/virtualbox: Show a human-friendly error if VirtualBox didn't clean up an existing VM. [GH-4681] - provisioners/docker: Search for docker binary in multiple places. [GH-4580] diff --git a/plugins/providers/docker/action.rb b/plugins/providers/docker/action.rb index 3189d6bec..f8b316f80 100644 --- a/plugins/providers/docker/action.rb +++ b/plugins/providers/docker/action.rb @@ -45,6 +45,12 @@ module VagrantPlugins end end + def self.action_package + lambda do |env| + raise Errors::PackageNotSupported + end + end + # This action just runs the provisioners on the machine. def self.action_provision Vagrant::Action::Builder.new.tap do |b| diff --git a/plugins/providers/docker/errors.rb b/plugins/providers/docker/errors.rb index 79e5a9767..64a8543ad 100644 --- a/plugins/providers/docker/errors.rb +++ b/plugins/providers/docker/errors.rb @@ -25,6 +25,10 @@ module VagrantPlugins error_key(:docker_provider_nfs_without_privileged) end + class PackageNotSupported < DockerError + error_key(:package_not_supported) + end + class StateNotRunning < DockerError error_key(:state_not_running) end diff --git a/templates/locales/providers_docker.yml b/templates/locales/providers_docker.yml index ca128a7cc..5a208ffc7 100644 --- a/templates/locales/providers_docker.yml +++ b/templates/locales/providers_docker.yml @@ -151,6 +151,11 @@ en: is functional and properly configured. Host VM ID: %{id} + package_not_supported: |- + The "package" command is not supported with the Docker provider. + If you'd like to commit or push your Docker container, please SSH + into the host VM (if there is one), and run `docker commit` and + so on manually. state_not_running: |- The container never entered the "running" state, or entered it briefly but reverted back to another state. Please verify that