Commit Graph

419 Commits

Author SHA1 Message Date
31f1448b86 Refactor ultis/utils_daemon, fixes #11908
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 01724c1cf11ce4a9e3b1978c7c07fd25656ed137
Component: engine
2015-04-03 20:20:04 +02:00
f6752519af Merge pull request #11893 from runcom/11892-refactor-utils-flags
Refactor utils/flags.go
Upstream-commit: 00a15227f8c7679a4a5c1f90e61367a3d1be92df
Component: engine
2015-03-30 13:35:40 -07:00
f3f4c403c1 Merge pull request #11900 from runcom/11899-refactor-utils-http
Refactor utils/http.go
Upstream-commit: 70a479dda5e2f99ac141853c2a8527a026c1da6f
Component: engine
2015-03-30 13:11:45 -07:00
a62098f98e Refactor utils/http.go, fixes #11899
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 0995ab5946b068a14cba05be8b2693c4181097e3
Component: engine
2015-03-30 17:59:57 +02:00
342d42b5a5 Refactor utils/tmpdir.go, fixes #11905
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: f1bbc1f34f98529f352130b5985ae5763e5b9c2e
Component: engine
2015-03-29 20:56:07 +02:00
0f80e9e5da Refactor utils/flags.go, fixes #11892
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 5670c6c6954e08575a6c821137a7ea6d9084af93
Component: engine
2015-03-29 03:22:46 +02: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
e0fdaa87e8 Moved pidfile from utils to pkg
Fixes #10958 by moving utils.daemon to pkg.pidfile.
Test cases were also added.
Updated the daemon to use the new pidfile.

Signed-off-by: Rick Wieman <git@rickw.nl>
Upstream-commit: 772833274fd84b3c960ccab14258b7e5a00b18cd
Component: engine
2015-03-24 23:59:32 +01: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
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
b06c1f22f7 Make utils_daemon and volumes cross-platform compileable.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
Upstream-commit: 1ec2eac50db2c98e00a488664625a22bf3757066
Component: engine
2015-03-16 11:46:07 +01: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
459803f719 Move directory size calculation to pkg/ (fixes #10970)
Signed-off-by: Martijn Dwars <ikben@martijndwars.nl>
Upstream-commit: e2b8933d213b283578babc1d86538950295e4fc7
Component: engine
2015-03-04 21:16:31 +01:00
2d06b1cf02 Merge pull request #11017 from brahmaroutu/random_10962
moving random.go from utils
Upstream-commit: f5850e8e30b9420d26bd12136d8bbb6669d1e2bb
Component: engine
2015-02-26 21:35:42 -05: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
88b1d37e3b Move TimeoutConn to seperate pkg dir.
Fixes #10965
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
Upstream-commit: 690a85797e70c3816a1dec768bff0c454e1e23a9
Component: engine
2015-02-25 17:09:47 +01: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
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
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
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