Open bartolone opened 5 years ago
Makes sense, though error message maybe could be error while creating container: <error>
I like that, since it makes explicit that what the user typed is the container creation function, when they meant to create a network (or something else).
Description
When trying the (incorrect) command
docker create network ...
the user receives a potentially unhelpful error message:Unable to find image 'network:latest' locally
(this also applies to config, container, plugin, secret, service, and volume in addition to network). This error message is unintuitive if the user is attempting to create a network and does not redirect them to the correct syntax.This incorrect pattern seems to be relatively common (see the following examples): https://github.com/jupyterhub/jupyterhub/pull/2632 https://github.com/jwilder/nginx-proxy/issues/502#issuecomment-241283579 *https://github.com/fluencelabs/fluence/blob/master/bootstrap/private_ethereum.md
I propose a new error message to redirect users to the correct pattern as it is much more likely their intent to create a network than to create a container named 'network'. This would likely also necessitate precluding users from naming their containers any one of config, container, network, plugin, secret, service, or volume, but use of those names should probably be discouraged anyway.
I would be happy to take a stab at a PR, but I am not familiar enough with the codebase to be sure of all of the files that would need updating. If someone is willing to help me identify those, I will go ahead and take a shot at it. Also happy to defer if anyone else wants to tackle this, but wanted to get feedback first on if this idea would be supported.
Steps to reproduce the issue:
docker create network
or substitute any of config, container, plugin, secret, service, and volume in place of networkDescribe the results you received: Unable to find image 'network:latest' locally Error response from daemon: pull access denied for network, repository does not exist or may require 'docker login'
Describe the results you expected: Error: cannot create a container named 'network' If you were trying to create a network, see 'docker network create --help'
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
: