Commit Graph

117 Commits

Author SHA1 Message Date
98bb6eba72 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 8936789919c5c8004f346f44a3452d1521818b60
Component: engine
2014-12-18 14:03:38 -08:00
a9b8d39261 Allow for relative paths on ADD/COPY
Moved Tianon's PR from: https://github.com/docker/docker/pull/7870
on top of the latest code

Closes: #3936

Signed-off-by: Andrew Page <admwiggin@gmail.com>
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f21f9f856e9d5af23521f131799028c2e67c04ed
Component: engine
2014-12-18 05:13:04 -08:00
2187cf5beb Merge pull request #9122 from dqminh/debug-huge-expose
Expose a large number of ports should not slow down builder
Upstream-commit: a76f7c6ec32431b6cbf286d9be86f7dde0b3ac0d
Component: engine
2014-12-16 10:03:31 -08:00
c0c6361cf0 builder: internals: fix incomplete chown walk when fixing permissions
This patch fixes the permission fixing code used by addContext, which
would not be responsible for Lchown-ing top-level directories added to a
destination that didn't exist prior to untar-ing the context.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
Upstream-commit: 916cba9c587a3f3ce97b407993fecd96ac2fecaf
Component: engine
2014-12-12 06:07:16 +11:00
5231d38261 Fix permissions on ADD/COPY
Fix a regression introduced in PR#9467 when a single file was added or
copied.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: cfc24769a26e825e4267cbfdd59af807e27508b9
Component: engine
2014-12-10 11:09:03 -08:00
3ecd658560 Use Set for stderr "logs" job in builder
Because engine implicitly adds his stder to job stderr

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: a62cbdeb47e5e504e670c546ad8bec45e696f370
Component: engine
2014-12-09 19:08:24 -08:00
15957abc33 Reduce permissions changes scope after ADD/COPY
Permissions after an ADD or COPY build instructions are now restricted
to the scope of files potentially modified by the operation rather than
the entire impacted tree.

Fixes #9401.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: f3cedce3608afe7bd570666a7fc878ab85c7bc03
Component: engine
2014-12-04 17:16:22 -08:00
ed716fd8a8 Merge pull request #9323 from unclejack/merge_release_v1.3.2
Merge release v1.3.2 to master
Upstream-commit: e6ec703df31f04c3ea3a6aeb19881494a6ae58ae
Component: engine
2014-11-24 19:26:36 -05:00
033a9598e5 Update code for use of urlutil pkg
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5794b5373ef26846b3cc5e48e651208771d12b19
Component: engine
2014-11-24 18:47:42 -05:00
9d0c84c559 pkg/chrootarchive: pass TarOptions via CLI arg
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	graph/load.go
		fixed conflict in imports
Upstream-commit: 9c01bc249dc628280f3fc019d5f0e0ace71be248
Component: engine
2014-11-25 01:03:40 +02:00
dd4a9e5429 add pkg/chrootarchive and use it on the daemon
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

Conflicts:
	builder/internals.go
	daemon/graphdriver/aufs/aufs.go
	daemon/volumes.go
		fixed conflicts in imports
Upstream-commit: 1cb17f03d0b217acf2d2c289b4946d367f9d3e80
Component: engine
2014-11-25 01:03:40 +02:00
19f9fcbc25 build: add pull flag to force image pulling
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 054e57a622e6a065c343806e7334920d17a03c5b
Component: engine
2014-11-21 19:59:44 +02:00
5dafd01fe8 Add support for ENV of the form: ENV name=value ...
still supports the old form: ENV name value

Also, fixed an issue with the parser where it would ignore lines
at the end of the Dockerfile that ended with \

Closes #2333

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 1314e1586f8cd6201c16161eb960a743c727946b
Component: engine
2014-11-20 09:54:28 -08:00
deefafa9d6 Remove unused sysinfo parameter to runconfig.Parse
Removing dead code.

Signed-off-by: John Gossman <johngos@microsoft.com>
Upstream-commit: e45b0f92711ff190cff4b61b2ea80cdd53203a16
Component: engine
2014-11-14 18:20:54 -08:00
69df5cc039 Updated cover tool import path.
Signed-off-by: Hans Rødtang <hansrodtang@gmail.com>
Upstream-commit: b4336803f35591c8e4d94b023c9d5e9525795520
Component: engine
2014-11-14 06:16:41 +01:00
159f1734a9 expose sorts its ports before saving as comment
Saving ports as `map[nat.Port]struct{}` directly has ordering issue which is
more replicatable where we expose a huge number of ports at the same time. As a
result, the cache will be burst whenever the map order is different from the
previous build.
This sorts the ports first and save them as a whitespace-separated list instead
of the map representation, so the order will always be consistent if the port
list isnt changed.

NOTICE: this will burst the old expose caches

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 87d0562c61b80aba05f4c3b4f49f5527afb55989
Component: engine
2014-11-12 09:14:35 -05:00
9ca9222a81 speed up creation of args and msg for huge cmds
Whenever a command arguments is formed by a large linked list, repeatedly
appending to arguments and displayed messages took a long time because go will
have to allocate/copy a lot of times.

This speeds up the allocation by preallocate arrays of correct size for args
and msg

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 3aae63f4528ab1d7e1e12cc4e2e7bacd97991d43
Component: engine
2014-11-12 00:04:45 -05:00
11b8f91734 Merge pull request #9048 from coaku/b_xzk_rm_redundant_trim
Remove redundant stripComment
Upstream-commit: 0b4132782a7ceec6815e73a10e50d7b007d7b9dd
Component: engine
2014-11-10 21:53:22 -08:00
7a77c7a4b5 Remove the redundant stripComment.
Signed-off-by: xuzhaokui <cynicholas@gmail.com>
Upstream-commit: 6c79ee7d1e38f7b2f408105db9af7fcf9942f7ca
Component: engine
2014-11-09 23:07:44 +08:00
2f7c6a8c08 Use the HTTP Last-Modified http header as the mtime value for ADD cmd when present
Closes #8331

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 2e482c86bc14ddd4cfa45281dcf8f9ca141c9f14
Component: engine
2014-11-07 13:58:05 -08:00
4047c8a0da Merge pull request #8468 from laktek/master
Fix URL check in build from Git.
Upstream-commit: 9cc71b459771d0cbac51051410859fd878236920
Component: engine
2014-10-31 14:43:21 -07: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
6c8bda9fe4 Merge pull request #8770 from LK4D4/logrus_support
Logrus support
Upstream-commit: 15b6b7be010546f30d7eabd000167d428efc0b13
Component: engine
2014-10-27 09:05:24 -07:00
fdfe0c97e7 Add HasValidGITPrefix to utils/utils.go
This will allow us to use a common Git prefix check for both api/clients/commands.go and
builder/job.go. Previous prefix check in build from Git (in builder/jobs.go) ignored valid prefixes such as "git@", "http://" or "https://".

Signed-off-by: Lakshan Perera <lakshan@laktek.com>
Upstream-commit: d3ac9ea98e872fee808693c736bc5a465d6426e2
Component: engine
2014-10-26 03:25:25 +00:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07: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
f424039349 Merge pull request #8673 from SvenDowideit/whats-docker-version
DOCKER_VERSION and docker-version havn't been implemented.
Upstream-commit: bb3e33154d4be8779981ad74ca381be3cf57063f
Component: engine
2014-10-22 19:03:54 -07: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
c1f75e87da DOCKER_VERSION and docker-version havn't been implemented.
So far, it looks like the declarations are not used, and so its safer not to
confuse people into thinking they do something.

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@docker.com> (github: SvenDowideit)
Upstream-commit: 6ed610fb8014d500e001bb0677f0e1af0dc9312d
Component: engine
2014-10-21 16:04:11 +10:00
41862f8f56 Merge pull request #8511 from coolljt0725/fix_tag
Fix tag an existed tag name of a repository
Upstream-commit: b90ab68f2a10e3f1e7a3568e7338afc89cbd00bc
Component: engine
2014-10-20 14:32:23 -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
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
d86ec1998c Merge pull request #8578 from erikh/fix_slash
builder: Handle trailing \ appropriately.
Upstream-commit: 9a827137725d13dbe14c577df40dc35d061152b3
Component: engine
2014-10-15 12:11:37 -07:00
33fccf1f63 Merge pull request #8579 from erikh/builder_html_panic
builder: handle anything we cannot parse the command for as a fatal error
Upstream-commit: abec82bdeee84cef603561ae29fed45e45130a7c
Component: engine
2014-10-15 12:01:52 -07:00
7e0088079e builder: provide a friendly message on parser errors
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 3f2eb353bdbb36ce26690909bcf761d4289294d6
Component: engine
2014-10-15 18:08:23 +00:00
4a6aadc8cd builder: handle anything we cannot parse the command for as a fatal error.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 63637b9d277d322a06f24e3195fab48bc2a705d6
Component: engine
2014-10-15 08:47:15 +00:00
ac6df7dc24 builder: comments should also be elided in the middle of statements following a line continuation.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 96f342f7030c3955900f8f2ddf06b0d36b1d993c
Component: engine
2014-10-15 08:44:14 +00:00
8a73cf85f8 builder: strip blank lines before processing any line continuations.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: a1ef2207dd1f63a4104cfbf7927931174f5438a5
Component: engine
2014-10-15 04:00:17 +00:00
61f914763d builder: Handle trailing \ appropriately.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 7fa449191ce9abc3e0a5261b66d8338948f66940
Component: engine
2014-10-15 03:08:18 +00: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
6047debf85 Fix the bug of tag a existed tag name of a repository.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 5e6f16e34264fa81205c8becbdcd401823261056
Component: engine
2014-10-10 09:18:12 +08: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
94f1cd5e88 ignore invalid Dockerfile instructions and do not consider "docker-version" a Dockerfile instruction
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 0a2c481c7f24fcd295b1e1f6504732971b289919
Component: engine
2014-10-06 23:26:59 -04:00
4f7e9edd1b Merge pull request #8370 from duglin/ParserIndent
Fix builder/parser so it keeps some whitespace on split lines.
Upstream-commit: 7bd482d570549263a786e648fc72503f67a8368b
Component: engine
2014-10-06 10:32:02 -07:00
009f167f3a Fix builder/parser so it keeps some whitespace on split lines.
If previous line ends with whitespace, or next line starts with whitepsace
we need to preserve a space otherwise things line:
RUN echo\
   hello
will appear as: RUN echohello

Noticed this while looking at #5744 because he had lines ending in &&\

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f440c6b2246cc4cfac4c5d351172e209dca2c765
Component: engine
2014-10-03 20:33:12 -07:00
6fa0bb6bd9 Added validity checks for repo name and tag in build job.
Signed-off-by: Joffrey F <joffrey@docker.com>
Upstream-commit: aabba9801a63228bb2e5144c8688b60e4d429ac2
Component: engine
2014-10-02 17:37:13 +02:00