Commit Graph

144 Commits

Author SHA1 Message Date
d3c1cd34ce Merge pull request #8739 from duglin/CleanupDockerIgnores
Do some cleanup on .dockerignore paths
Upstream-commit: a85f58719f29f76f465747d095c85dbb8ba69d06
Component: engine
2014-11-03 16:05:24 -05:00
f115554d46 Do some cleanup on .dockerignore paths
While working on the fix for #8330 I noticed a few things:
1 - the split() call for the .dockerignore process will generate a blank
    "exclude".  While this isn't causing an issue right now, I got worried
	that in the future some code later on might interpret "" as something bad,
	like "everything" or ".".  So I added a check for an empty "exclude"
	and skipped it
2 - if someone puts "foo" in their .dockerignore then we'll skip "foo".
    However, if they put "./foo" then we won't due to the painfully
	simplistic logic of go's filepath.Match algorithm.  To help things
	a little (and to treat ./Dockerfile just like Dockerfile) I added
	code to filepath.Clean() each entry in .dockerignore.  It should
	result in the same semantic path but ensure that no matter how the
	user expresses the path, we'll match it.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c0f0f5c9887032c606750b645001829d9f14f47c
Component: engine
2014-11-02 11:29:46 -08:00
b3f73f86dd builder: Restore /bin/sh handling in CMD when entrypoint is specified with JSON
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 24545c18c35620c211003561dc482d66ee6d0306
Component: engine
2014-10-27 21:50:22 +00:00
8aa0b668bd builder: whitelist verbs useful for environment replacement.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4e74cd498b66e494b3336118a19c02000b282251
Component: engine
2014-10-27 17:38:25 +00:00
a3019fc24f builder: handle escapes without swallowing all of them.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: be49867cab663b5bdcf7804f3d2504f056db9db1
Component: engine
2014-10-27 17:38:24 +00:00
dc1bcb95a0 builder: some small fixups + fix a bug where empty entrypoints would not override inheritance.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: cdd6e97910c50e5766c8bec2121f906e9ee2d119
Component: engine
2014-10-24 00:23:25 +00:00
4efe32a77f builder: handle cases where onbuild is not uppercase.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: a34831f0168156ded7ecf96a1734c2735fede1ca
Component: engine
2014-10-21 20:17:37 +00:00
86ec0544b5 Add a testcase to make sure we don't squash tabs or convert them to spaces
This is in response to @SvenDowideit asking if we had a "tab" testcase
in https://github.com/docker/docker/issues/2315#issuecomment-58133508
I couldn't find one so I'm adding one

Closes #2315

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c980fe09b77700fcaf47459e91a149876b7abef9
Component: engine
2014-10-17 15:52:48 -07:00
98837c45ee Merge pull request #8639 from erikh/fix_escapes
builder: fix escaping for ENV variables.
Upstream-commit: 75fd1b614dfd5acd36975357b51341585f89003c
Component: engine
2014-10-17 15:50:37 -07:00
6ef784efe2 builder: fix escaping for ENV variables.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: df0e0c76831bed08cf5e08ac9a1abebf6739da23
Component: engine
2014-10-17 21:47:35 +00:00
2e9533ccba Merge pull request #8415 from LK4D4/use_logs_in_builder
Use logs instead of attach for builder
Upstream-commit: 3c325f89e544415bafc23006ead0bdc21cab2f61
Component: engine
2014-10-17 13:32:13 -07:00
1ccc013586 Use logs instead of attach for builder
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 6f09d064bd438ab4425d6105f40887f02bb9e97e
Component: engine
2014-10-17 13:20:02 -07:00
810883724d Rewrite TestBuildCopyDisallowRemote to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 98e7608b4cec04463781ccb314259873bbb56a16
Component: engine
2014-10-17 11:58:12 -07:00
50718a9b0f Rewrite TestBuildCopyEtcToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: c8a5d56fd789b50b78ad58c07a535aaf01af77f7
Component: engine
2014-10-17 11:57:48 -07:00
7e037f1bad Rewrite TestBuildCopyWholeDirToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 6582ea574cfcd6cc8e3b1abebe7bfcc7aee05ece
Component: engine
2014-10-17 11:57:30 -07:00
5ab35b8993 Rewrite TestBuildCopyDirContentToExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 4a029259ff41c37eb72a6f221f9725f66491139f
Component: engine
2014-10-17 11:57:07 -07:00
3100829c7e Rewrite TestBuildCopyDirContentToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 832618afc6e6a8c489afb40f94340f158f9680c7
Component: engine
2014-10-17 11:56:49 -07:00
ff7999247d Rewrite TestBuildCopySingleFileToNonExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 24d83afd5203f93a22a3d95a212e9ec295aadc8b
Component: engine
2014-10-17 11:56:28 -07:00
f2d974c957 Rewrite TestBuildCopySingleFileToExistDir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 2248109ff8607264ba40d4a4ac24bad66462d105
Component: engine
2014-10-17 11:56:01 -07:00
e5897b7fab Rewrite TestBuildCopySingleFileToWorkdir to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: d41cba6aed1ffdda9c3e3441d720dab9afc3eb66
Component: engine
2014-10-17 11:55:34 -07:00
be8f5dfa14 Rewrite TestBuildCopySingleFileToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 83c5dced10c4e2a40990e927ccc15a1e0428529c
Component: engine
2014-10-17 11:55:04 -07:00
fa31328c73 Rewrite TestBuildCopyAddMultipleFiles to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: e45c92153d0c21308fe5983aa76182cc03ef398e
Component: engine
2014-10-17 11:54:29 -07:00
02f8c7b8a5 Merge pull request #8567 from LK4D4/add_log_done
Add logDone for TestBuildAddSingleFileToNonExistDir
Upstream-commit: 5a20dc67b005717a0549fe504a3b0ccf62c913c6
Component: engine
2014-10-17 11:20:12 -07:00
2cbac498ba Merge pull request #8486 from duglin/Issue5701
Add failing testcase for single quotes in CMD
Upstream-commit: 09ceae5c9c268f2b79954b1580c5ec1632f24d0e
Component: engine
2014-10-17 11:11:49 -07:00
a1fc81a541 Cleanup errorOut resp in build tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: b1e3c9e9cd49591f8efcbcd00d45bcd98fbe2831
Component: engine
2014-10-16 15:06:20 -07:00
9a84feded9 Add failing testcase for single quotes in CMD
Closes #5701

This is due to @SvenDowideit comment at: https://github.com/docker/docker/issues/5701#issuecomment-58133541
where he asked for a testcase showing the error case.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 9edf96782470deb15deec3be07e3988164454148
Component: engine
2014-10-16 14:40:55 -07:00
2c00860ff9 Minor fix of tests names
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: fcfe80f63397c0a8bdd6605798c0639ec3dcda56
Component: engine
2014-10-14 11:47:01 -07:00
b0b0bf7337 Add logDone for TestBuildAddSingleFileToNonExistDir
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: fbaa41b5aa920ca752481e1b94aeff29857cb76d
Component: engine
2014-10-14 11:17:41 -07:00
872f82a3de Fix builder from being over-aggressive on ${}
`${SOME_VAR%pattern}` was turning into `SOME_VAL%pattern}` which the shell would then balk at.

I've updated the `TOKEN_ENV_INTERPOLATION` regex to account for this (ie, if `${` is used, it _must_ also match the closing `}`), and renamed the variable to not be exported (since it's not used outside the function following it).

I also added comments for the bits of `tokenEnvInterpolation` so they're easier to follow. 😄

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 24189b2c36985f8345691fa6ec2c0766cfc133a7
Component: engine
2014-10-14 00:58:55 -06:00
3381602232 builder: ONBUILD triggers were not accurately being executed in JSON cases.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 1150c1639a9efbd2e5e4ac1e71961aef77a32de0
Component: engine
2014-10-14 01:59:45 +00:00
b7f1d56490 Fix Tag Test for longer tags
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: de32f48e6668e9f071272d588cf6acdd7090b9ca
Component: engine
2014-10-07 19:37:08 -07:00
2d4da4a816 Allow child to overwrite entrypoint from parent
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 50fa9dffcf023c81f3142f0ddd294db4ac6b8281
Component: engine
2014-10-07 23:45:35 +00:00
a6ccd9b35c Merge pull request #8434 from tiborvass/ignore_invalid_Dockerfile_instructions
Ignore unknown dockerfile instructions
Upstream-commit: 12203e475de1da4c6c58b52cc458e353f2b7ea3a
Component: engine
2014-10-07 14:45:51 -07:00
6c9c0cbd11 Merge pull request #8341 from unclejack/add_workdir_test
add test for workdir env vars and add docs
Upstream-commit: 40cad37f0a4f182150476a577196af29da142fc1
Component: engine
2014-10-07 14:27:32 +10:00
6634e2c862 Add test for ignoring invalid dockerfile instructions
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 9fe1dd3103071a7ce8e6d7a1ce204351e8eaa248
Component: engine
2014-10-06 23:14:25 -04:00
3bb92dd8aa Merge pull request #8409 from unclejack/integcli_lint
integcli: lint fixes
Upstream-commit: a650ab7f29ea89d89a1bdee19823ca45fac4d4a4
Component: engine
2014-10-06 14:32:08 -07:00
16206f937c integcli: lint fixes
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c0e632246d821f3f70ffcf7244cf7a9b336b0344
Component: engine
2014-10-06 23:15:17 +03:00
620b3b5c3c Fix TestBuildCacheADD to check cache in out, not in id
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 21dff8cbecce458e7f532cedf1ca109c1f4fe6e2
Component: engine
2014-10-06 10:04:10 -07:00
65b99b3138 Add ENV variables support to WORKDIR build command
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)

Conflicts:
	builder/builder.go
		This file has been deleted.
Upstream-commit: 2c5b5cfc929c8d6ffaefcbc85d2c9ad16ad301b8
Component: engine
2014-10-01 17:34:36 +03:00
afe8e130e0 Move archive package into pkg/archive
Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: 30d5a42c1f24e26f681b7330249f04fec891aee9
Component: engine
2014-09-29 23:23:36 -07:00
1a11728b82 Merge pull request #8289 from duglin/FixTestcaseFor8230
Fixes the new testcase for PR #8230
Upstream-commit: 7c1aee62910405720f977e5777fafefc662dc175
Component: engine
2014-09-29 15:33:51 -07:00
1cba9ff5e0 Fixes the new testcase for PR #8230
This new version makes sure that the same context is used for the two
builds run in the test.  If you don't use the same build then about 1/2 the
time the file copied into the container will look like a different file,
probably due to timestamp differences.  But reusing the same context we
re-use the same file on disk and therefore avoid the change in timestamps,
and we use the cache on the 2nd build.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8b3fbac15c0579c1372f3e13f607c1001d149d16
Component: engine
2014-09-29 13:35:09 -07:00
3dce9f533b Merge pull request #8284 from erikh/fix_cmd_again
builder: Fix CMD to inject /bin/sh -c when provided with a non-json value
Upstream-commit: 670c8696a29825b23208496bd4d8e88b5faa7773
Component: engine
2014-09-29 15:56:16 -04:00
f56118757d builder: Fix CMD to inject /bin/sh -c when provided with a non-json value.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 9f142bf9be0174bf957812d1045a7cf0aa34ad88
Component: engine
2014-09-29 12:22:18 -07:00
3ecb3c4d7a Merge pull request #8230 from duglin/Issue6820
add wildcard support to COPY/ADD (part 2 of issue #6820)
Upstream-commit: 1cd6135972bda50f913315910baba1b17d097338
Component: engine
2014-09-29 11:19:01 -07:00
ad9bd3a850 check tag's validity before building.
When user passes an invalid tag to `docker build`
(i.e.  `docker build -t abcd:A0123456789B0123456789C0123456789 .`), check the
tag first and terminate-early so user can specify the tag again

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 8833d800bf622dcb6a66da0fe4c7a61a1620b62c
Component: engine
2014-09-29 06:21:54 -04:00
fbb83ba5bc add wildcard support to copy/add
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: acd40d50799a117c4e7c318abdbc8c14b9eb1632
Component: engine
2014-09-25 20:44:51 -07:00
d851131502 Merge pull request #7994 from erikh/parser_fix_volume_parsing
builder: Fix handling of VOLUME command where multiple volumes are specified in a space delimited list.
Upstream-commit: d369612b416484301e172bfae3fc692e9c176faf
Component: engine
2014-09-25 12:45:48 -04:00
cdd6c2350b builder: Fix handling of VOLUME command where multiple volumes are
specified in a space delimited list.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: a5ca549a18fb5c1006005cc220ab330eec3018de
Component: engine
2014-09-25 09:44:19 -07:00
32980488fe Rewrite TestContextTar tests to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: d302d9296125d2c7abf4adf992fd6739a19d5fbd
Component: engine
2014-09-24 17:09:18 +04:00