2015-07-12 42 views
0

输出是为什么Docker版本没有-f参数?从</p> <pre><code>sudo docker build --help </code></pre> <p>

--force-rm=false  Always remove intermediate containers, even after unsuccessful builds 
--no-cache=false  Do not use cache when building the image 
-q, --quiet=false Suppress the verbose output generated by the containers 
--rm=true   Remove intermediate containers after a successful build 
-t, --tag=""   Repository name (and optionally a tag) to be applied to the resulting image in case of success 

有在线文档https://docs.docker.com/reference/commandline/build/

基本上更多的参数,例如参数-f指定Dockerfile

的文件名

回答

2

你应该检查你的码头版本,你需要升级它。据码头工人的changelogdocker build-f参数version 1.5.0

实现此外,我做了一个测试我自己的机器上搬运工1.6.2版

$docker --version 
Docker version 1.6.2, build 7c8fca2 

$docker build --help 

Usage: docker build [OPTIONS] PATH | URL | - 

Build a new image from the source code at PATH 

    -c, --cpu-shares=0 CPU shares (relative weight) 
    --cpuset-cpus=  CPUs in which to allow execution (0-3, 0,1) 
    -f, --file=   Name of the Dockerfile (Default is 'PATH/Dockerfile') 
    --force-rm=false  Always remove intermediate containers 
    --help=false   Print usage 
    -m, --memory=   Memory limit 
    --memory-swap=  Total memory (memory + swap), '-1' to disable swap 
    --no-cache=false  Do not use cache when building the image 
    --pull=false   Always attempt to pull a newer version of the image 
    -q, --quiet=false  Suppress the verbose output generated by the containers 
    --rm=true    Remove intermediate containers after a successful build 
    -t, --tag=   Repository name (and optionally a tag) for the image 

,你可以看到它支持-f参数。