Commit Graph

226 Commits

Author SHA1 Message Date
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
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
d6d379e87a Add ability to refer to image by name + digest
Add ability to refer to an image by repository name and digest using the
format repository@digest. Works for pull, push, run, build, and rmi.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Upstream-commit: a2b0c9778feac970524b98ef7a91b5528fdeb9d5
Component: engine
2015-03-17 10:10:42 +00:00
e051d5c51d moving random.go from utils
Closes #10962
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 53ece336dcab8e778fc37afc7a264f7d168110ff
Component: engine
2015-02-26 18:31:18 +00: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
f634216d52 Removing -X flag option and autogenerated code to create Dockerversion.go functionality
Addresses #9207

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 6871b9b16afe46e7566ac2937246b4a64be97269
Component: engine
2015-02-20 05:40:12 +00:00
a251ace79f Merge pull request #10208 from mota/fix-env-writerto
Fix env.WriteTo count return
Upstream-commit: 6d65fa1faa4770b5e7930da8f9e8bd82be539475
Component: engine
2015-02-06 14:14:16 -08:00
32b5682b75 Merge pull request #10145 from duglin/Issue10141
Docker run -e FOO should erase FOO if FOO isn't set in client env
Upstream-commit: edaf23b7a7f71626bdafb4e3a9677ad05fa17cab
Component: engine
2015-01-21 14:16:51 -08:00
a5f51dc24e Fix env.WriteTo count return
Some calls like json.Encoder.Encode mask the number of bytes written to
an io.Writer. The solution provides a wrapper io.Writer around the
actual io.Writer that allows multiple calls to Write to be considered as
one and allow access to this count.

Signed-off-by: Pierre Wacrenier <pierre.wacrenier@gmail.com>
Upstream-commit: 0cd30cf3991de1b491cac3c0cecdc976f0098f29
Component: engine
2015-01-21 01:14:23 +01:00
5d2fe159f4 Docker run -e FOO should erase FOO if FOO isn't set in client env
See #10141 for more info, but the main point of this is to make sure
that if you do "docker run -e FOO ..." that FOO from the current env
is passed into the container.  This means that if there's a value, its
set.  But it also means that if FOO isn't set then it should be unset in
the container too - even if it has to remove it from the env.  So,
   unset HOSTNAME
   docker run -e HOSTNAME busybox env
should _NOT_ show HOSTNAME in the list at all

Closes #10141

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 9ab73260f8e4662e7321b257c636928892f023cf
Component: engine
2015-01-19 08:00:32 -08:00
6136e835bf Fix "-X" 6l usage ("define string data")
It turns out "-X" is only for strings! :)

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: da01690a0a22ced060d4fb4fc46cb545ff1604df
Component: engine
2015-01-16 21:46:01 -07:00
8404235dd8 Merge pull request #9648 from estesp/9202-update-resolvconf
Update container resolv.conf when host network changes /etc/resolv.conf
Upstream-commit: 92af1f014520b4f75a6220478b01ed6a02ca5bfb
Component: engine
2015-01-08 14:06:55 -08:00
ae1406d798 Update container resolv.conf when host network changes /etc/resolv.conf
Only modifies non-running containers resolv.conf bind mount, and only if
the container has an unmodified resolv.conf compared to its contents at
container start time (so we don't overwrite manual/automated changes
within the container runtime). For containers which are running when
the host resolv.conf changes, the update will only be applied to the
container version of resolv.conf when the container is "bounced" down
and back up (e.g. stop/start or restart)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 63a7ccdd2372d87f56f7a86da07c72ea51332c2a
Component: engine
2015-01-08 14:15:13 -05:00
1a4a1b2193 Have .dockerignore support Dockerfile/.dockerignore
If .dockerignore mentions either then the client will send them to the
daemon but the daemon will erase them after the Dockerfile has been parsed
to simulate them never being sent in the first place.

an events test kept failing for me so I tried to fix that too

Closes #8330

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6d801a3caa54ad7ef574bc426aa1ffc412c5af82
Component: engine
2015-01-06 10:57:48 -08:00
24d7379326 validate image ID properly & before load
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>

Conflicts:
	graph/load.go
Upstream-commit: bff1d9dbce76bed1e267a067eb4a1a74ef4da312
Component: engine
2014-12-11 16:29:27 -05:00
e0fcb513b1 Move git and url checks into pkg
This moves the IsGIT and IsURL functions out of the generic `utils`
package and into their own `urlutil` pkg.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: feca1b1780a0942aafc1796d1fd52026a673bf92
Component: engine
2014-11-24 18:10:37 -05:00
85fb88371f Allow git@ prefixes for any hosted git service
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: c7e4cc4a531b5337d64bda22df8553e646a96fe7
Component: engine
2014-11-24 20:49:54 +00:00
179af9eeb6 Extract TreeSize to daemon build
TreeSize uses syscall.Stat_t which is not available on Windows.
It's called only on daemon path, therefore extracting it to daemon
with build tag 'daemon'

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: b64c9b521ab4e4082ed874a23a493f4a266304d5
Component: engine
2014-11-14 18:20:53 -08:00
eaa70c2db5 change util.CopyDirectory to archive.CopyWithTar
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: e5ecfd3b178bbc399de344635606d82e147276ff
Component: engine
2014-11-01 12:23:08 -04: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
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
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07: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
a84cb1fe40 Move Matches() file path matching function into pkg/fileutils
This is the second of two steps to break the archive package's
dependence on utils so that archive may be moved into pkg. `Matches()`
is also a good candidate pkg in that it is small, concise, and not
specific to docker internals

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: 73f4bfed810b65943f1d9d038a8db9bd834067fa
Component: engine
2014-09-29 23:21:41 -07:00
3ffb3fc6cc Move Go() promise-like func from utils to pkg/promise
This is the first of two steps to break the archive package's dependence
on utils so that archive may be moved into pkg.  Also, the `Go()`
function is small, concise, and not specific to the docker internals, so
it is a good candidate for pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: b845a62149d5f4990462ac6c9167c5cfaa0e66cb
Component: engine
2014-09-29 23:16:27 -07:00
7c11f5dee8 Replace utils.CheckLocalDns with bytes.Contains line
Since RemoveLocalDns patch will  remove all localhost entries
from resolv.conf we no longer need anything more then
!bytes.Contains(resolvConf, []byte("nameserver")

To check for no nameserver entry in dns config.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: a297d6ab8c08a13503fd004ec1ad7ee9e23bd22a
Component: engine
2014-09-29 06:37:31 -04:00
b90aac66ac Remove nameserver 127.0.0.1 line rather then dumping resolv.conf
We have a bug report complaining about docker dumping the contents of the
hosts resolv.conf if it container 127.0.0.1.  They asked that instead
of dropping the file altogether, that we just remove the line.

This patch removes the 127.0.0.1 lines, if they exist and then
checks if any nameserver lines exist.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 65640994fda8e1667de3642d8f4daf76dd3de302
Component: engine
2014-09-29 06:37:31 -04:00
cb5f7b942d add the timeutils package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9ae3134dc9f0652ef48ec1fd445f42d8fe26de35
Component: engine
2014-09-17 14:30:08 +03:00
bcad074599 Merge pull request #7976 from duglin/Issue7902
Fix for issue 7902 - add trailing zeros to timestamps so logs align
Upstream-commit: 51b26853ef2f124ea837364c02585cbf96999d6a
Component: engine
2014-09-16 13:55:03 -07:00
a36831cc2a Fix for issue 7902.
Use utils.RFC3339NanoFixed ("2006-01-02T15:04:05.000000000Z07:00")
instead of time.RFC3339Nano to format our log timestamps - this way
things are aligned, in particular the nano seconds are padded with zeros

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: cd7a5f5c0998f288f71d307076e661ed54f1a5f1
Component: engine
2014-09-16 10:28:37 -07:00
d0a61e9c18 Improve ValidateContextDirectory error handling.
- Errors sent to the walker callback functions were ignored. This meant that
  one could get a panic when calling methods on a nil FileInfo object. For
  example when the file did not exists any more.

- Lstat calls inside walker callback are reduntant because walker already calls
  Lstat and passes the result to the callback.

- Error returned from filepath.Rel() can never be EACCES because it compares
  strings and does not care about actual files.

- If Matched() returns error then ValidateContextDirectory() must return error.
  Currently it still kept walking although the outcome was already known. 

- Function will now fail in case of unknown error(not EACCES nor ENOENT).
  Previous implementation did not make a clear decision about this (but 
  panicked because of the issues above).

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: a8914293fbb1328f9a5c931bd51e34f5d6584e17
Component: engine
2014-09-16 19:17:34 +03:00
e9ab736d16 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 76212635b594d4472dd8d5b2e071fac416addbe7
Component: engine
2014-09-03 11:36:21 +03:00
cc2787ae0d Some more style fixes
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 114838cbda38f4808d3a7a0d40b33d2ee445d158
Component: engine
2014-08-29 15:21:28 +04:00
2b6c63642e Fix panic in validate context for build
Fixes #7611

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: cd776cdd77239353d8bd17d3e05d66665f381157
Component: engine
2014-08-25 14:25:31 -07:00
cb2b33e883 Skip permissions check on named pipes
Fixes #7680

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 07f2e794867030c755901ae5479df03e3c4ce189
Component: engine
2014-08-25 22:59:53 +04:00
b8d5783511 move utils.Fataler to pkg/log.Fataler
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ac63d925d2618e700d117c5d9e402ccc0c5cecc8
Component: engine
2014-08-13 15:32:41 -07:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
325695b856 utils.Debugf -> log.Printf, move jsonlog to own package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 5cdb9c8acab75df74d20cd937e4091dacb355160
Component: engine
2014-08-06 16:39:01 -07:00
604012d742 Fix .dockerignore when ignoring unreadable dirs
The initial `ValidateContextDirectory` implementation fails loudly when a file
lacks read permissions in the current context. However that situation is valid
if the file is included in the `.dockerignore` patterns.

Docker-DCO-1.1-Signed-off-by: Bruno Renié <brutasse@gmail.com> (github: brutasse)
Upstream-commit: 27cca4c70cc7f0cccfda693ca7bbb2422eec3e13
Component: engine
2014-07-31 15:10:56 -07:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
669e2fe479 add basic support for 'all'
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 222a6f44016451dcbd2da0003e64521c06e88ba9
Component: engine
2014-07-11 23:43:21 +00:00
ca489c2f49 Basic --cap-add and --cap-drop support for native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 94e6dc978134b61a2b30aa9118f98f6fadd10535
Component: engine
2014-07-11 23:43:21 +00:00
4d29e9b718 Move WriteBroadcaster to separate package as BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 9d4e80222144c0aef3e78202ecb4904b3ce5ed9b
Component: engine
2014-07-02 23:31:06 +04:00
1ce22444ec Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: ed032ddfd68a8654671a13d676c0f7539e36a10b
Component: engine
2014-06-24 21:19:15 +04:00
dc559e048a improve numeric only id detection
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f2baa364a13ea3e22719e3637bf6f5f42e5dc677
Component: engine
2014-05-27 21:03:12 +00:00
f45c8a5e25 Merge pull request #5782 from unclejack/fix_5270
Upstream-commit: 8eef1be29e763db58a22d336b71d97c076a11199
Component: engine
2014-05-19 10:36:10 -07:00
95b5064ed6 client: Rip out HTTP check from docker version
For background to this change please see:
https://github.com/dotcloud/docker/issues/4802
https://github.com/dotcloud/docker/pull/5670

Docker-DCO-1.1-Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com> (github: jmccrohan)
Upstream-commit: 3cec63d56f9de6332aa3f33502695283d4feb054
Component: engine
2014-05-18 02:22:22 +01:00
e59443d033 add ValidateContextDirectory to utils/utils.go
This commit adds a function which can be used to ensure all contents of
a directory can be accessed.

This function doesn't follow symlinks to check if they're pointing to
files which exist. Such symlinks can be useful later.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 1dedcd0d376f57abae5cadd38116c1aca2821330
Component: engine
2014-05-17 02:38:28 +03:00