Bug 1260045

Summary: "man docker-build" doesn't clearly explain using STDIN as argument
Product: [Fedora] Fedora Reporter: Robert P. J. Day <rpjday>
Component: dockerAssignee: Sally <somalley>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 22CC: adimania, admiller, dwalsh, ichavero, jcajka, jchaloup, lsm5, miminar, somalley, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-16 17:41:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert P. J. Day 2015-09-04 10:01:58 UTC
I only recently ran across this variation of "docker build", which doesn't *seem* to be explained completely in the man page. From here:

http://container42.com/2014/11/18/data-only-container-madness/

I saw the sample command:

~: docker build -t mickey_foo -< Dockerfile

I was a bit confused as to what was going on until I read the explanation here:

https://docs.docker.com/reference/builder/

"Note: If you build by passing a Dockerfile through STDIN (docker build - < somefile), there is no build context, so the Dockerfile can only contain a URL based ADD instruction. You can also pass a compressed archive through STDIN: (docker build - < archive.tar.gz), the Dockerfile at the root of the archive and the rest of the archive will get used at the context of the build."

This doesn't *seem* to be explained in "man docker-build", and it seems like a moderately useful variation. Should it be covered there?

Comment 1 Robert P. J. Day 2015-09-04 10:20:43 UTC
One more note about the above -- the current man page states:

  "When the URL to a tarball archive or to a single Dockerfile is given, no context is sent from  the  client  to the  Docker daemon."

The builder reference page states a bit more informatively that, if you pass a remote archive as the URL, the entire archive is used as the context. Technically, I guess both those statements can be considered true, but it seems it would be more useful to mention that the archive would be used as the context in that case.

Comment 2 Robert P. J. Day 2015-09-04 10:38:15 UTC
ACK, one more note on "man docker-build" I just noticed ... under "Building an image and naming that image", there are a number of examples that don't supply a final argument, such as:

  $ docker build -t fedora/jboss:1.0
                                     ^ ?Final argument?

AFAIK, you *must* supply an argument, such as "." for current directory; that is not the default. If you don't, you get:

  $ docker build -t rday/nginx
  docker: "build" requires 1 argument.
  See 'docker build --help'.

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

There are a few examples in that man page section that need to be fixed to have a final argument, yes?

OK, I think I'm done here.

Comment 4 Sally 2015-10-02 11:35:23 UTC
https://github.com/docker/docker/pull/16722  submitted

Comment 5 Sally 2015-10-14 14:16:37 UTC
https://github.com/docker/docker/pull/16722  merged

Comment 6 Daniel Walsh 2015-10-14 18:05:51 UTC
Fixed in docker-1.9.