"docker exec" requires at least 2 arguments. see 'docker exec --help'. usage: docker exec [options] container command [arg...] run a command in a running container
时间: 2023-06-05 19:06:31 浏览: 210
"docker exec" 命令至少需要两个参数。请查看 'docker exec --help' 获取使用方法:docker exec [选项] 容器名称 命令 [参数...] 在正在运行的容器中运行命令。
相关问题
docker exec -it redis "docker exec" requires at least 2 arguments. See 'docker exec --help'. Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] Run a command in a running container
It seems like you are trying to execute a command inside a Redis container using the "docker exec" command, but you are missing some arguments.
The correct syntax for the "docker exec" command is:
```
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
```
Where "OPTIONS" are optional flags that you can use to customize the behavior of the command, "CONTAINER" is the name or ID of the container you want to execute the command in, "COMMAND" is the command you want to execute inside the container, and "ARG..." are optional arguments for the command.
For example, if you want to execute the "redis-cli" command inside a Redis container named "my-redis", you can use the following command:
```
docker exec -it my-redis redis-cli
```
This will start an interactive session inside the "my-redis" container, running the "redis-cli" command.
"docker start" requires at least 1 argument. See 'docker start --help'. Usage: docker start [OPTIONS] CONTAINER [CONTAINER...] Start one or more stopped containers
这个错误提示是因为您在执行 `docker start` 命令时没有指定要启动的容器名称或 ID。正确的 `docker start` 命令的语法为:
```
docker start [OPTIONS] CONTAINER [CONTAINER...]
```
其中,`OPTIONS` 是可选参数,`CONTAINER` 是要启动的容器名称或 ID。您需要将 `CONTAINER` 替换为您要启动的容器的名称或 ID。如果您想同时启动多个容器,可以将它们的名称或 ID 以空格分隔的方式一起指定。
例如,要启动名为 `my_container` 的容器,可以执行以下命令:
```
docker start my_container
```
如果您不知道要启动的容器的名称或 ID,可以使用 `docker ps -a` 命令查看所有的容器,并查找您要启动的容器的名称或 ID。