Commit Graph

397 Commits

Author SHA1 Message Date
0d4aa9a72d Add key migration to daemon
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 007ef161b45dd91afcfb7ef9cd32e6c88dbf196e
Component: engine
2015-01-21 16:55:05 -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
b098aaedce Merge pull request #9784 from dmcgowan/v2-registry
Client Support for Docker Registry HTTP API V2
Upstream-commit: 8b95ad230e2ee76450ceb9a80aa8e942a56bb397
Component: engine
2015-01-19 10:46:38 -08: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
2a0f9941dc Fix tests
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 7eeda3f14de744b98b1c5aca4f2ecce87a479baa
Component: engine
2015-01-15 14:05:05 -08:00
bd2dadaee1 Update push and pull to registry 2.1 specification
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 0336b0cdaa74ac03003c4a933eb866fb0cec8125
Component: engine
2015-01-15 14:05:05 -08:00
287a9987a0 Fix docker run/exec/create not printing error messages
If an error message happens while parsing docker run or docker exec, the message
is not being printed out.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 12a7e78b125afd277adb7cd099817a419f4faaa0
Component: engine
2015-01-13 09:23:13 -05:00
d3407c8087 Merge pull request #8456 from lindenlab/cleanup-repository-info
Cleanup: Replace ResolveRepositoryName with RepositoryInfo{}
Upstream-commit: 6870bde5847d4484d87f91baf58edc52f575ea5d
Component: engine
2015-01-08 17:19:03 -05: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
5aa04a56fb Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: 568f86eb186731b907b659e4ec64bda21c2fe31d
Component: engine
2015-01-08 20:14:58 +00: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
b060268a74 Merge pull request #8748 from duglin/Issue8330
Have .dockerignore support Dockerfile/.dockerignore
Upstream-commit: 6d780139c4b7960b482a5f4fbf043adb6673864b
Component: engine
2015-01-06 13:47:42 -08: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
fa232dc1ae Exit with non-zero code on first argument parsing error
Ignoring return value of ParseFlags leads to exit code 0 if bad
arguments are supplied. This patch makes sure that subcommands exit
with non-zero code in such a case.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 8a785792cd3c3fb4494bced475263aef5fa4534b
Component: engine
2015-01-06 13:46:38 +01:00
7a4065fe5d Fixed error reporting
Removed redundant print line and fixed handling of command-less docker
invocation.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 08f0f1ee1db2dea79e622764891cb8b1432bcab1
Component: engine
2015-01-06 13:44:27 +01:00
319270793a Handle bad options better
* Do not log bad options error message twice, e.g.:

    $ docker run --pouet
    flag provided but not defined: --pouet
    See 'docker run --help'.
    2014/11/05 21:41:23 flag provided but not defined: --pouet

  With this patch just the first two lines will be produced.

* Print 'docker' just once when run without a command, e.g.:

    $ docker --hel
    flag provided but not defined: --hel
    See 'docker docker --help'.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 1d09fc22ca14b0b83bdc81cba06d3d7ac886a3e6
Component: engine
2015-01-06 13:44:27 +01:00
639170852f refactor redundant code around calls to cmd.Parse
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 41be2f73c7ce2cbb5450ee8bb35bf7235125ca63
Component: engine
2015-01-06 13:41:16 +01:00
c7d1f45ca3 Merge pull request #9233 from inatatsu/fix-pkg-units-size-for-gccgo
Fix to avoid a compile error due to float to int truncation with GCCGO
Upstream-commit: 2acb856dff848bd69c5e971f6352854a26362164
Component: engine
2014-12-18 18:33:01 -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
3388d83b40 Fix to avoid a compilation error of size_test.go with GCCGO due to float to int truncation
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: 82a5cd0d3701fc559fb92290ed6bc2974a9d8b6d
Component: engine
2014-11-25 18:12:22 +09: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
c334a2067e Merge pull request #8150 from dqminh/pull-output-non-terminal
Pull: print some data instead of newlines when output is not a terminal
Upstream-commit: 9854b0aa40eb3261d599604915c909cebcc60179
Component: engine
2014-11-18 16:20:42 -07: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
c976d3fdc2 Consolidate tmpdir implementations, include Windows
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: 376ae7780bf04d89ad1532f1c2a752535fa7ac7d
Component: engine
2014-11-14 18:20:53 -08:00
e4ae3b734b print everything except progress in non-terminal
Instead of only checking `Progress != nil` (which is always true because
the server sends `"progressDetail":{}` when it doesnt have the progress), we
also check if `Progress.String() != ""`, which should be sufficient to filter
out the progress data.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: aeeb0d59d3ed40c3b0d9cecd3c19a52f005dd140
Component: engine
2014-11-05 10:44:31 -05: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
dd63155260 Merge pull request #7942 from estesp/7747-stderr-stdout-bug
Fix gh#7747: filter bare newline output and log client pull to stdout
Upstream-commit: 28e308c25ed431da14bf010df8a9beca05b32018
Component: engine
2014-09-22 10:53:34 -07:00
a701f25898 Merge pull request #8041 from unclejack/lower_allocations_broadcastwriter
lower the number of allocations in broadcastwriter
Upstream-commit: 77d30e71122c7ec328f79836dcab4409f72e04b9
Component: engine
2014-09-17 15:26:44 -07:00
ba4bc005be move stdcopy to pkg/stdcopy
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 1f03e60c2a96a92acae0e4d2fd604ab2c6d55473
Component: engine
2014-09-17 18:06:17 +03: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
53de305780 Fix gh#7747 - filter bare newline output and log client pull to stdout
Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: b5184d3c2417c743b3fec34312270d243e4d980c
Component: engine
2014-09-06 01:06:18 -04: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