Bug 1260045 - "man docker-build" doesn't clearly explain using STDIN as argument
"man docker-build" doesn't clearly explain using STDIN as argument
Product: Fedora
Classification: Fedora
Component: docker (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Sally
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-09-04 06:01 EDT by Robert P. J. Day
Modified: 2016-02-16 12:41 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-02-16 12:41:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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


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:


"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 06:20:43 EDT
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 06:38:15 EDT
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 07:35:23 EDT
https://github.com/docker/docker/pull/16722  submitted
Comment 5 Sally 2015-10-14 10:16:37 EDT
https://github.com/docker/docker/pull/16722  merged
Comment 6 Daniel Walsh 2015-10-14 14:05:51 EDT
Fixed in docker-1.9.

Note You need to log in before you can comment on or make changes to this bug.