Commit Graph

200 Commits

Author SHA1 Message Date
b7982a6499 Fix a typo in comment of parseMaybeJSONToList
Signed-off-by: Yu Changchun <yuchangchun1@huawei.com>
Upstream-commit: 24dd8a4698315a4aafee5071f4fe4d74fa06c377
Component: engine
2015-04-11 10:34:21 +08:00
95c63c4203 Fix typo in builder/dispatchers.go
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: bbdf045ac1dfa8fc78b1c932736fe6400eecdf63
Component: engine
2015-04-09 11:43:05 -07:00
49e191d0e4 Remove engine usage from attach
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c44f513248a8b40b1b2221726c7441881383e919
Component: engine
2015-04-07 14:23:09 -07:00
088a52cbda Merge pull request #11149 from duglin/8667-AdvancedVars
Add support for advanced ${} uses
Upstream-commit: 9707286a5cecde3eee3c83e3c2da65df8e59d04e
Component: engine
2015-04-02 08:25:49 -04:00
3e035d76a2 Add support for more advanced ${xxx:...} syntax
Just ${xxx:+...} and ${xxx:-...} for now

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 39908fc6d9a13f0d44196475ba938b6cc352fdbe
Component: engine
2015-04-01 08:11:15 -07:00
753b8ae08c Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 03d3d79b2b3f8b720fff2d649aff0ef791cff417
Component: engine
2015-03-31 16:38:04 -07:00
0544f5e034 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 013fb87543a47524efba3c371a1d22afe151287c
Component: engine
2015-03-28 09:07:20 +08:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
0ee1e9f604 Fixes hacks from progressreader refactor
related to #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 0cd6c05d8112e9246b734107d54e2855e3d5fec5
Component: engine
2015-03-25 18:21:02 -07:00
a16f3d6cb4 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c79b9bab541673af121d829ebc3b29ff1b01efa2
Component: engine
2015-03-25 22:32:08 +01:00
d4497c7a2b .: remove trailing white spaces
blame tibor this one ;-)
```
find . -type f -not -name '*.png' -not -name '*.go' -not -name '*.md'
-not -name '*.tar' -not -name '*.pem' -not -path './vendor/*' -not -path
'./.git/*' -not -path '*/testdata/*' -not -path './docs/*images*' -not
-path '*/testfiles/*' -not -path './bundles/*' -not -path
'./docs/*static*/*' -not -path './docs/*article-img/*' -exec grep -HnEl
'[[:space:]]$' {} \; | xargs sed -iE 's/[[:space:]]*$//'
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 7617ec176d266650b19c2378ccab4aa41e6dc5a2
Component: engine
2015-03-25 13:38:17 -04:00
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
925b84807a Merge pull request #11657 from GeorgeMac/cleanup-redundant-else
#11602 - Cleanup redundant else statements find via golint 
Upstream-commit: 92f9e2d3955fcc3341407809c9db33ac702e1508
Component: engine
2015-03-23 18:27:29 -05:00
9e396b31ce Merge pull request #11658 from 4gh/doc_package_builder
Add builder/evaluator comments for the package in godoc-style
Upstream-commit: 9f894c93e40cda8177febe71cd3c17d4b7613659
Component: engine
2015-03-23 14:27:23 -07:00
835a16cc1d Add builder/evaluator comments for the package in godoc-style
fixes #11617

Signed-off-by: Frank Herrmann <fgh@4gh.tv>
Upstream-commit: a0cd0045282f21215d7845a987ec6292aa92a685
Component: engine
2015-03-23 20:56:03 +00:00
0221549820 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
Upstream-commit: 664ef0cbe2113e8307135e656cc6db9199f8268e
Component: engine
2015-03-23 20:40:29 +00:00
9b9105b3b2 Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 8b02d85e1728b48729b2fb8553b2ec4b56a30d37
Component: engine
2015-03-23 20:58:16 +01:00
69bd180001 Merge pull request #10431 from duglin/Issue10391
Clarify ENV non-recursivenes w.r.t. env var substitution + fix escaping
Upstream-commit: 61966d281bb715a2359b27bcd30d0d59c98d2812
Component: engine
2015-03-23 13:30:11 -05:00
9dcfa784ef Merge pull request #11538 from duglin/EmptyVolume
Check volume path to make sure its not the empty string
Upstream-commit: ded0ada9b47ab48b57d14225ec663e3756faff7f
Component: engine
2015-03-22 19:25:50 -07:00
7c1bfa9093 Implement build cancellation
Add the capability to cancel the build by disconnecting the client.

This adds a `cancelled` channel which is used to signal that a build
should halt. The build is halted by sending a Kill signal and noticing
that the cancellation channel is closed.

This first pass implementation does not allow cancellation during a
pull, but that will come in a subsequent PR.

* Add documentation of cancellation to cli and API

* Protect job cancellation with sync.Once

* Add TestBuildCancelationKillsSleep

* Add test case for build cancellation of RUN statements.

Signed-off-by: Peter Waller <p@pwaller.net>
Upstream-commit: 671c12204cb469d868f646da1474d5bad6541770
Component: engine
2015-03-22 11:31:28 +00:00
bafff954ca Check volume path to make sure its not the empty string
With this Dockerfile
```
FROM ubuntu
ENV ABC=""
VOLUME $ABC
```

It builds ok but then at run time I get this error:

FATA[0002] Error response from daemon: Cannot start container 8902b4a7aaf5c4e4b11a38070d392db465fa97ad88c91c8b38dda5ab8149ccac: [8] System error: no such file or directory

Because the Volume config shows "" as the path.  This PR checks for "" as
the path and stops it at build time.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8071bf396747d3ad01db504a417b75fe7a52608a
Component: engine
2015-03-20 21:39:49 -07:00
490a18c994 Fix some escaping around env var processing
Clarify in the docs that ENV is not recursive

Closes #10391

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6d66e3e7a5ecb021a9e89c4f85fadecf23e2000c
Component: engine
2015-03-20 20:09:00 -07:00
5e80a64076 Allow setting resource constrains for build
Closes #10191

Allow `docker build` to set --cpu-shares, --cpuset, --memory,
--memory-swap for all containers created by the build.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e6ae89a45a699bd44f03517396777e34ec76018b
Component: engine
2015-03-18 20:57:13 -04:00
ad61919ab6 Some fixed for new LABEL stuff
- command.Commands was missing "Label"
- used the correct error string in dispatcher when LABEL has no args, otherwise
  the test TestBuildMissingArgs will not work
- removed the premature error msg in line_parser that was blocking the
  label() func in dispatcher from showing the err msg in previous bullet
- since LABEL uses the env parser it needs to be added to the replaceEnvAllowed
  list so that proper quote processing will be done.  Especially once
  PR #10431 is merged.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6784a772baaa20936f00b8adc00a4b4444356181
Component: engine
2015-03-16 22:53:41 -07:00
5f00f97ea0 Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
Upstream-commit: b6ac111abfbed628a80b67f0b092a248083b354c
Component: engine
2015-03-16 20:20:05 -07:00
7a404617a3 Merge pull request #11402 from miminar/err-cleanup
Error formatting cleanups
Upstream-commit: 88f437d6c619f7b07a22cb5750814bce4d8d7164
Component: engine
2015-03-16 16:13:16 -07:00
526e8c6e31 Merge pull request #10591 from duglin/ErrUnknownCmd
Generate an error on unknown Dockerfile instruction
Upstream-commit: 085054db9d8850a7d2c8658bb9a7fdacf7a3ceb8
Component: engine
2015-03-16 17:47:28 -04:00
2479608ad5 Merge pull request #10977 from robertabbott/10959-progressreader
Moves progressreader from utils to its own package
Upstream-commit: 8ae20d8eba127361bc07260580e2d3b8e3628c3e
Component: engine
2015-03-16 12:45:33 -07:00
c29e43cc4b Format error by value
- Use `%v` verb to format errors.
- Give `param` constant in portallocator some better name.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 210ab030bc3dab7bcf8f7252f2f9facb5a26cb6b
Component: engine
2015-03-16 12:05:53 +01:00
0a3eeb1d23 Generate an error on unknown Dockerfile instruction
Instead of just printing a warning and going on, this will generate
an error and stop processing.

This used to be part of #10561 but I decided it might need its own
independent discussion/PR as to not derail #10561.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8a5b50d65dae2d0607e046c57241dd6b46b65c6a
Component: engine
2015-03-13 16:08:34 -07:00
51b13a7774 Allow specification of Label Name/Value pairs in image json content
Save "LABEL" field in Dockerfile into image content.

This will allow a user to save user data into an image, which
can later be retrieved using:

docker inspect IMAGEID

I have copied this from the "Comment" handling in docker images.

We want to be able to add Name/Value data to an image to describe the image,
and then be able to use other tools to look at this data, to be able to do
security checks based on this data.

We are thinking about adding version names,
Perhaps listing the content of the dockerfile.
Descriptions of where the code came from etc.

This LABEL field should also be allowed to be specified in the
docker import --change LABEL:Name=Value
docker commit --change LABEL:Name=Value

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: cdfdfbfb6223fdd5b319942d412caac6bc09cdeb
Component: engine
2015-03-13 09:47:09 -07:00
2c409e6dd8 Fix builder when num of RUN args is 1
FROM scratch
ADD echo /
RUN [ "echo" ]

will die with
  exec: "/bin/sh": stat /bin/sh: no such file or directory

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 645f8a32df3b5b22e5e194664a9f0733709714c9
Component: engine
2015-03-11 07:30:44 -07:00
6283bdf158 Remove import to utils in progressreader
Added method in StreamFormatter to handle calls
from progressreader. Solves #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 12b278d3540bc32699e8c2197b556188fd98b77b
Component: engine
2015-03-11 00:50:27 -07:00
8e64a493c0 cleanup: simplify parser_test
parser_test only needed the directory-names for
the tests to run. This replaces f.Readdir() with
f.Readdirnames() to only return the names.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9e63b0d0f9530a0a7d6445606062b8ca99793792
Component: engine
2015-03-10 00:55:00 +01:00
102aaf6e25 Merge pull request #11219 from icecrime/remove_maintainers_files
Remove subdirectories MAINTAINERS files
Upstream-commit: c5f9aa18f4a09a0ab6743d1e7c2de1ee355461cc
Component: engine
2015-03-09 09:02:58 -07:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
bac4428faa dispatchers: warn user if try to use EXPOSE ip:hostPort:containerPort
We could use EXPOSE ip:hostPort:containerPort,
but actually it did as EXPOSE ::containerPort

commit 2275c833 already warned user on daemon side.
This patch will print warning message on client side.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Upstream-commit: 26e85b0db1b896e98071f121fb14b2c6d905ed4f
Component: engine
2015-03-04 21:09:50 -05:00
e708804317 Merge pull request #11000 from anandkumarpatel/invalidate-probe
Improve build speed
Upstream-commit: e0823b09ec679a64a0d9d0f73f470abbd43dd75a
Component: engine
2015-03-04 11:35:00 -08:00
bc3e4a6737 Support dockerfile and Dockerfile
Closes #10807

Adds support for `dockerfile` ONLY when `Dockerfile` can't be found.
If we're building from a Dockerfile via stdin/URL then always download
it a `Dockerfile` and ignore the -f flag.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 15924f238503ffe44e5fcb99415ff753a36e5971
Component: engine
2015-03-03 18:38:50 -08:00
0e9344f3dc Remove comment and b.UtilizeCache check.
Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
Upstream-commit: 1a5ea50aa81112c745030b3cf421a9baebcdb9f5
Component: engine
2015-02-25 14:04:35 -08:00
a09a95ebf4 Add cacheBusted flag which gets set on the first cache miss
Refactor of probeCache function

Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
Upstream-commit: 2420c1f03bba2c90d2406e486974cdc0c8af0cea
Component: engine
2015-02-25 10:27:32 -08:00
2528f2e0d3 Set UtilizeCache to false on cache miss
Signed-off-by: Anandkumar Patel <anandkumarpatel@gmail.com>

Signed-off-by: AnandkumarPatel <anandkumarpatel@gmail.com>
Upstream-commit: 1e746a8a2b2f8a88903feca430f254605dcc6cc8
Component: engine
2015-02-24 18:29:26 -08:00
4e766f5eaa pass --change changes to the import job
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 17abfc3ddc79592753289a8556a343e276fb15b5
Component: engine
2015-02-24 13:01:36 -05:00
3aa5f48b11 Return error on invalid --change command
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Docker-DCO-1.1-Signed-off-by: Michael Crosby <crosbymichael@gmail.com> (github: rhatdan)
Upstream-commit: 3210d13fc8fb93263a7a5eadef0a0f133087a889
Component: engine
2015-02-24 13:01:35 -05:00
aeec0467c9 build_config job: parse dockerfile ast into config
Instead of building the actual image, `build_config` will serialize a subset of
dockerfile ast into *runconfig.Config

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 7f091eca704970a5cb8a4fdab295dae543c47a89
Component: engine
2015-02-24 13:01:35 -05:00
e430471f3b Merge pull request #10921 from duglin/FixNonverboseBuild
Build w/o verbose hangs w/RUN
Upstream-commit: ac06d0c46a26192c34a3ed782514652895fe5447
Component: engine
2015-02-23 15:15:12 -08:00
bdb65abebf Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7a9c944b827dc0cd416d701fe6460264f05166bb
Component: engine
2015-02-23 18:43:10 +00:00
a23c3ea95a Rename Destroy to Rm to be consistent with CLI.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
Upstream-commit: ba93f8316ce796ebeee62f704f8311af8b9f250a
Component: engine
2015-02-23 16:15:56 +01:00
fed3219626 Build w/o verbose hangs w/RUN
`docker build -q .` where Dockerfile contains a RUN cmd will hang on the
RUN. It waits for the output stream to close but because of -q we never
attached to the container and end up waiting forever.

The fact that no one noticed this tells me that people may not actually
use -q and if so I wonder if it would make sense to make -q work the may
it does for other commands (like `docker ps`) and make it so it only
shows the container ID at the end.  A -q/quiet option that only hides the
container RUN output apparently isn't really that useful since no one is
using it.  See: https://github.com/docker/docker/issues/4094

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 92c353582c210ebc351f7f5911273af76398a2a8
Component: engine
2015-02-20 13:38:03 -08:00
314f2be995 Map Commands instead of using them as a slice
The most obvious use case is when one wants to make sure as fast
as possible that a command is a valid Dockerfile command.

Signed-off-by: kargakis <kargakis@users.noreply.github.com>
Upstream-commit: 6ecf23861ec7036aa4210fe6d3b7dbfaaedbd6d0
Component: engine
2015-02-20 15:56:21 +01:00