【发布时间】:2020-06-19 13:35:57
【问题描述】:
我正在尝试运行
$ apk add pkg
在未启动的基于 alpine linux 的容器中。
谁能说出以下命令有什么问题。
$ docker run --rm --entrypoint myimage:mytag 'apk add wget curl vim lynx'
docker: invalid reference format.
See 'docker run --help'.
$ docker run --rm myimage:mytag --entrypoint 'apk add wget curl vim lynx'
container_linux.go:262: starting container process caused "exec: \"--entrypoint\": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "exec: \"--entrypoint\": executable file not found in $PATH".
$ docker run --rm myimage:mytag --entrypoint '/sbin/apk add wget curl vim lynx'
container_linux.go:262: starting container process caused "exec: \"--entrypoint\": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "exec: \"--entrypoint\": executable file not found in $PATH".
$ docker run --rm --entrypoint "apk" myimage:mytag 'add wget curl vim lynx'
apk-tools 2.7.5, compiled for x86_64.
usage: apk COMMAND [-h|--help] [-p|--root DIR]
[-X|--repository REPO] [-q|--quiet]
【问题讨论】: