标志-a的值“zookeeper”无效:有效流是STDIN,STDOUT和STDERR

时间:2015-09-03 15:40:05

标签: solr docker solrcloud

我正在尝试关注此博客,以使用docker设置solr云:

https://lucidworks.com/blog/solrcloud-on-docker/

我能够成功创建zookeeper图像。 docker images命令也列出了图像。

但是,当我尝试使用以下命令创建并运行zookeeper容器时,它会输出错误:

docker run -name zookeeper -p 2181 -p 2888 -p 3888 myusername/zookeeper:3.4.6

错误:

Warning: '-n' is deprecated, it will be removed soon. See usage.
invalid value "zookeeper" for flag -a: valid streams are STDIN, STDOUT and STDERR
See 'docker run --help'.
flag provided but not defined: -name
See 'docker run --help'.

我在这里缺少什么?

1 个答案:

答案 0 :(得分:1)

请改用--name

Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

  -a, --attach=[]               Attach to STDIN, STDOUT or STDERR
  --add-host=[]                 Add a custom host-to-IP mapping (host:ip)
  --blkio-weight=0              Block IO weight (relative weight)
  -c, --cpu-shares=0            CPU shares (relative weight)
  --cap-add=[]                  Add Linux capabilities
  --cap-drop=[]                 Drop Linux capabilities
  --cgroup-parent=""            Optional parent cgroup for the container
  --cidfile=""                  Write the container ID to the file
  --cpu-period=0                Limit CPU CFS (Completely Fair Scheduler) period
  --cpu-quota=0                 Limit CPU CFS (Completely Fair Scheduler) quota
  --cpuset-cpus=""              CPUs in which to allow execution (0-3, 0,1)
  --cpuset-mems=""              Memory nodes (MEMs) in which to allow execution (0-3, 0,1)
  -d, --detach=false            Run container in background and print container ID
  --device=[]                   Add a host device to the container
  --dns=[]                      Set custom DNS servers
  --dns-search=[]               Set custom DNS search domains
  -e, --env=[]                  Set environment variables
  --entrypoint=""               Overwrite the default ENTRYPOINT of the image
  --env-file=[]                 Read in a file of environment variables
  --expose=[]                   Expose a port or a range of ports
  --group-add=[]                Add additional groups to run as
  -h, --hostname=""             Container host name
  --help=false                  Print usage
  -i, --interactive=false       Keep STDIN open even if not attached
  --ipc=""                      IPC namespace to use
  -l, --label=[]                Set metadata on the container (e.g., --label=com.example.key=value)
  --label-file=[]               Read in a file of labels (EOL delimited)
  --link=[]                     Add link to another container
  --log-driver=""               Logging driver for container
  --log-opt=[]                  Log driver specific options
  --lxc-conf=[]                 Add custom lxc options
  -m, --memory=""               Memory limit
  --mac-address=""              Container MAC address (e.g. 92:d0:c6:0a:29:33)
  --memory-swap=""              Total memory (memory + swap), '-1' to disable swap
  --memory-swappiness=""        Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
  --name=""                     Assign a name to the container
  --net="bridge"                Set the Network mode for the container
  --oom-kill-disable=false      Whether to disable OOM Killer for the container or not
  -P, --publish-all=false       Publish all exposed ports to random ports
  -p, --publish=[]              Publish a container's port(s) to the host
  --pid=""                      PID namespace to use
  --privileged=false            Give extended privileges to this container
  --read-only=false             Mount the container's root filesystem as read only
  --restart="no"                Restart policy (no, on-failure[:max-retry], always)
  --rm=false                    Automatically remove the container when it exits
  --security-opt=[]             Security Options
  --sig-proxy=true              Proxy received signals to the process
  -t, --tty=false               Allocate a pseudo-TTY
  -u, --user=""                 Username or UID (format: <name|uid>[:<group|gid>])
  --ulimit=[]                   Ulimit options
  --disable-content-trust=true  Skip image verification
  --uts=""                      UTS namespace to use
  -v, --volume=[]               Bind mount a volume
  --volumes-from=[]             Mount volumes from the specified container(s)
  -w, --workdir=""              Working directory inside the container