Commit graph

460 commits

Author SHA1 Message Date
Michael Crosby
77d30e7112 Merge pull request #8041 from unclejack/lower_allocations_broadcastwriter
lower the number of allocations in broadcastwriter
2014-09-17 15:26:44 -07:00
unclejack
1f03e60c2a move stdcopy to pkg/stdcopy
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-17 18:06:17 +03:00
unclejack
9ae3134dc9 add the timeutils package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-17 14:30:08 +03:00
Jessie Frazelle
51b26853ef Merge pull request #7976 from duglin/Issue7902
Fix for issue 7902 - add trailing zeros to timestamps so logs align
2014-09-16 13:55:03 -07:00
Doug Davis
cd7a5f5c09 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>
2014-09-16 10:28:37 -07:00
Tonis Tiigi
a8914293fb 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)
2014-09-16 19:17:34 +03:00
Phil Estes
b5184d3c24 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)
2014-09-06 01:06:18 -04:00
unclejack
76212635b5 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-03 11:36:21 +03:00
Alexandr Morozov
114838cbda
Some more style fixes
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 15:21:28 +04:00
Michael Crosby
cd776cdd77 Fix panic in validate context for build
Fixes #7611

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-25 14:25:31 -07:00
Alexandr Morozov
07f2e79486
Skip permissions check on named pipes
Fixes #7680

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-25 22:59:53 +04:00
Erik Hollensbe
ac63d925d2 move utils.Fataler to pkg/log.Fataler
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-13 15:32:41 -07:00
Josiah Kiehl
a02f67be5b Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
2014-08-13 15:18:15 -07:00
Michael Crosby
bc9f5cdeb5 Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
2014-08-07 14:51:42 -07:00
Erik Hollensbe
5cdb9c8aca utils.Debugf -> log.Printf, move jsonlog to own package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:39:01 -07:00
Erik Hollensbe
5ab09f2f71 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:37:01 -07:00
Alexandr Morozov
8d056423f8 Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:19 +00:00
Dan Walsh
b4813f2841 Docker should use /var/lib/container/tmp for large temporary files.
/tmp is often a tmpfs file system and large temporary files could cause
docker commands to fail.  Also using /tmp potentially allows users on the
system to get access to content, or even attack the content.  Moving the tmpdir to
/var/lib/container/tmp will protect the data.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

Conflicts:
	docker/docker.go
2014-08-05 16:43:42 -04:00
Michael Crosby
c5cdbc376f Merge pull request #7357 from crosbymichael/docker-ignore
Fix .dockerignore when ignoring unreadable dirs
2014-07-31 15:19:50 -07:00
Bruno Renié
27cca4c70c 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)
2014-07-31 15:10:56 -07:00
Tibor Vass
531f5907d6 Merge pull request #7324 from erikh/move_tarsum
Move tarsum to pkg/
2014-07-31 16:56:24 -04:00
Erik Hollensbe
ef6b78f7db Remove CheckSum from utils; replace with a TeeReader
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 11:23:43 -07:00
Erik Hollensbe
4184cccb0f move testdata to tarsum package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 06:52:24 -07:00
Erik Hollensbe
1219e458d1 utils/tarsum* -> pkg/tarsum
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 06:42:12 -07:00
Erik Hollensbe
4398108433 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)
2014-07-29 13:09:10 -07:00
Victor Vieux
3bae02cbe3 Merge pull request #7272 from unclejack/create_httputils_pkg
move resumablerequestreader to pkg/httputils
2014-07-29 12:18:10 -07:00
unclejack
c0517857f6 move resumablerequestreader to pkg
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-07-29 16:30:45 +03:00
Vincent Batts
704b97d1c4 jsonmessage: added test and cleaned up others
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-07-28 14:43:28 -04:00
Vincent Batts
77237be0e2 progress bar: don't strings.Repeat a negative number
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-07-28 12:01:43 -04:00
Tibor Vass
caa5769928 Fix io.Reader ambiguity on EOF in progressreader
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-07-25 19:26:27 -04:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
unclejack
f033ce3ee9 resumablerequestreader: allow initial response
Make it possible to inspect an initial response and pass it to
ResumableRequestReader. This makes it possible to inspect an initial
response and passing it to ResumableRequestReader to avoid making an
extra request.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-07-21 19:54:25 +03:00
Victor Vieux
222a6f4401 add basic support for 'all'
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-11 23:43:21 +00:00
Victor Vieux
94e6dc9781 Basic --cap-add and --cap-drop support for native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-11 23:43:21 +00:00
James Turnbull
aa0eca03e6 Updated docker logs timestamp to RFC3339
Currently the docker logs timestamp flag generates log entries like:

    $ sudo docker logs -ft daemon_dave
    [May 10 13:06:17.934] hello world

It uses Go's StampMilli timestamp to generate the timestamp. The entry
is also wrapped in [ ].

This is non-standard operational timestamp and one that will require
custom parsing.

The new timestamp is RFC3999Nano and generates entries like:

    2014-05-10T17:42:14.999999999Z07:00 hello world

These are readily parsed by tools like ELK.

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-07-09 11:59:06 -04:00
LK4D4
7bdd23bfee BroadcastWriter refactoring
It became slightly faster and lighter
possibly fixes #5923 problems

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-07-03 10:12:53 +04:00
LK4D4
a8d95b7c57 Benchmark for BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-07-03 10:06:58 +04:00
LK4D4
9d4e802221 Move WriteBroadcaster to separate package as BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-07-02 23:31:06 +04:00
LK4D4
ed032ddfd6 Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:19:15 +04:00
LK4D4
d17c929659 Fix stdcopy when reads large frame at once
Fixes TestLogsContainerMuchBiggerThanPage with go 1.3(#6520)
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-19 21:42:55 +04:00
Victor Vieux
1ca7964cdd Merge pull request #6257 from proppy/test-conntimeout
utils: add test for TimeoutConn
2014-06-18 16:23:39 -07:00
LK4D4
f08cd445b0 Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-18 17:39:57 +00:00
Victor Vieux
f0ec901819 Merge pull request #6490 from icecrime/6203-artifacts_on_events_output
Avoid erasing line for non-progress messages
2014-06-17 16:26:51 -07:00
Tibor Vass
d0fe1147ea Merge pull request #6199 from icecrime/event_subscription_refactoring
Event subscription refactoring
2014-06-17 17:39:28 -04:00
Michael Crosby
4dcf4e9bd0 Merge pull request #6320 from LK4D4/fix_stdcopy_eof
Don't exit on eof in header reading in stdcopy
2014-06-17 14:20:13 -07:00
Arnaud Porterie
3807f8b708 Avoid erasing line for non-progress messages
The JSONMessage.Display methods erases the entire line by outputting the <ESC>[2K\r sequence before displaying the message content. This is not necessary for messages other than progress indicators, and introduces unwanted characters in the /events output.

Fixes #6203.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
2014-06-17 22:40:34 +02:00
Arnaud Porterie
d0c4e44863 Refactor events publishing
Events subscription (/events API endpoint) attributes pseudo-unique identifiers to incoming subscribers: originally its host, then its subscription time. This is unecessary and leads to code complexity.

Introduce a JSONMessagePublisher to provide simple pub/sub mechanism for JSONMessage, and rely on this new type to publish events to all subscribed listeners. The original logic is kept for the 'since' and 'until' parameters, and for client disconnection handling.

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <icecrime@gmail.com> (github: icecrime)
2014-06-17 21:56:22 +02:00
Alexandr Morozov
b1bae92534 Don't exit on eof in header reading in stdcopy
There was random lines drops in docker logs because of this
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-11 15:13:31 +04:00
Levi Gross
a7b60b21de Fixed up if statement
Signed-off-by: Levi Gross <levi@levigross.com>

Docker-DCO-1.1-Signed-off-by: Levi Gross <levi@levigross.com> (github: levigross)
2014-06-10 10:02:00 -04:00
Johan Euphrosine
39320f9393 utils: add test for TimeoutConn
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-06-07 15:11:57 -07:00
SvenDowideit
5febba93ba IANA allocated Docker port: 2375
2375/2376 are assigned:
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker

For #1440

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
2014-06-04 06:54:19 +10:00
unclejack
5aeb77296a Merge pull request #4430 from vbatts/vbatts-images_orphan
Adding -f untagged=true flag to `docker images`
2014-06-03 20:33:56 +03:00
Victor Vieux
b292928cd5 Merge pull request #5848 from unclejack/resumable_pulls
resume pulling the layer on disconnect
2014-06-02 14:07:01 -07:00
Vincent Batts
3a4e3ca327 filters: don't encode an empty set. update comments
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:52 -04:00
Vincent Batts
89a15fa235 filters: use json marshal, instead of beam/data
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:52 -04:00
Vincent Batts
f1cc7ce5d7 filter flag: split out for separate --filter flags
adding tests and allowing for easy passing of filters.Args from client
to server.

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:51 -04:00
Vincent Batts
babd572015 filters: cleanup & fmt
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:51 -04:00
Vincent Batts
caf9b19b0c filters: remove out filter proc prototype
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:50 -04:00
Vincent Batts
5f3812ec97 filters, for images: start with untagged/tagged boolean
This is a new feature and flag. (replaces the suggestion of a flag for
--untagged images).
The concept is to have a syntax to filter. This begins with this
filtering for the 'images' subcommand, and at that only filtering for
whether images are untagged.
  example like: docker rmi $(docker images -q --filter 'untagged=true')

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-02 16:33:50 -04:00
unclejack
2a1b7f222a resume pulling the layer on disconnect
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-06-02 21:41:22 +03:00
Alexandr Morozov
1ae37cef91 Remove unused and racy "used" param from streamformatter
Also tests written
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-02 21:43:07 +04:00
Derek
02f4ae6c56 Use Timeout Conn wrapper to set read deadline for downloading layer
Docker-DCO-1.1-Signed-off-by: Derek <crq@kernel.org> (github: crquan)
2014-05-27 22:50:04 -07:00
Victor Vieux
f2baa364a1 improve numeric only id detection
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-27 21:03:12 +00:00
Victor Vieux
d74b6095c9 Merge pull request #5861 from crquan/fix-user-agent-trailing-space
Remove Trailing Whitespace in User-Agent
2014-05-19 12:08:53 -07:00
Victor Vieux
8eef1be29e Merge pull request #5782 from unclejack/fix_5270 2014-05-19 10:36:10 -07:00
Jonathan McCrohan
3cec63d56f 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)
2014-05-18 02:22:22 +01:00
Derek
42734394b0 Remove Trailing Whitespace in User-Agent
After removed, the User-Agent shows in log like this:

[debug] http.go:160 https://index.docker.io/v1/repositories/busybox/images --
HEADERS: map[User-Agent:[docker/0.11.1-dev go/go1.2.2 git-commit/8887e00-dirty kernel/3.14.3-n1 os/linux arch/amd64]]

The code also moved all validation work into validVersion,
to keep the main logic as clean.

Docker-DCO-1.1-Signed-off-by: Derek <crq@kernel.org> (github: crquan)
2014-05-16 17:15:04 -07:00
unclejack
1dedcd0d37 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)
2014-05-17 02:38:28 +03:00
Victor Vieux
bc22c9948c Merge pull request #5756 from crosbymichael/move-units-to-pkg
Move duration and size to units pkg
2014-05-14 11:36:14 -07:00
Victor Vieux
c78b390b6c Merge pull request #5780 from vbatts/vbatts-start_tarsum_test
tarsum: start a test for TarSum
2014-05-14 11:28:26 -07:00
Vincent Batts
d153740d9c tarsum: adding benchmarks
to cover a couple of use-cases:
* 1mb file, using no compression
* 1mb file, using compression
* 1024 1k files, using no compression
* 1024 1k files, using compression

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-05-14 11:48:17 -04:00
unclejack
219b7ae8b5 add UpdateSuffixarray and refactor TruncIndex
This commit refactors TruncIndex to make it possible to add container
ids to the TruncIndex without updating the Suffixarray.

This is useful during the Docker daemon's startup when we don't want to
update the Suffixarray for every container we add.

Add continues to function like before.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-05-14 17:57:59 +03:00
Vincent Batts
cfd1227e91 tarsum: test gofmt
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-05-13 15:14:32 -04:00
Vincent Batts
efa369a6ee tarsum: adding the layer for "scratch" image
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-05-13 15:08:48 -04:00
Vincent Batts
461f801f83 tarsum: start a test for TarSum
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-05-13 14:57:31 -04:00
Michael Crosby
dcf81f95fd Move Follow symlink to pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-13 10:35:57 -07:00
Michael Crosby
d33b4655c4 Move duration and size to units pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-12 17:05:07 -07:00
Guillaume J. Charmes
3f8ffb461a
Remove signal_freebsd (already in pkg/signal)
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-05-11 01:03:12 -07:00
Victor Vieux
3744452ecf add resolvconf
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-05 22:55:32 +00:00
Alexandr Morozov
d1297feef8 Timestamps for docker logs.
Fixes #1165
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-05-01 20:40:36 +04:00
unclejack
d072f316e3 change inode map to struct from bool
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-04-17 20:08:14 +03:00
Michael Crosby
413190e159 Merge pull request #5172 from pnasrat/5166-large-image-graph-restore
Enable construction of TruncIndex from id array.
2014-04-14 10:31:16 -07:00
Paul Nasrat
84a76f2796 Add benchmark tests for TruncIndex.
Compare add vs new.

Some historical data in PR #5172.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-04-13 22:36:15 -04:00
Kato Kazuyoshi
0f72486346 Fix utils.FollowSymlinkInScope's infinite loop bug
fs_test.go doesn't finish if Docker's code is placed under a directory
which has symlinks between / and the directory.
For example, the below doesn't finish before the change.

  /home -> usr/home
  FollowSymlinkInScope("/home/bob/foo/bar", "/home/bob/foo")

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-04-12 07:37:18 +09:00
Kato Kazuyoshi
e3e078ca2f Add the test to reproduce the issue even in "make test"
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-04-12 07:37:17 +09:00
Paul Nasrat
4f169c2db5 Enable construction of TruncIndex from id array.
Fixes #5166

Current graph.restore is essentially O(n^2 log n) due to how
suffixarray creation works.

Rather than create/append/create new this supports creation from a seed
array of ids.

Functional testing shows this eliminates the hang on Creating image
graph reported on list.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-04-11 16:39:58 -04:00
unclejack
e76113be6c Merge pull request #4925 from creack/fix_logs
Fix expending buffer in StdCopy
2014-03-31 23:15:07 +03:00
Victor Vieux
9709c31d1b fix import display
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-31 19:21:57 +00:00
Guillaume J. Charmes
e4aaacc235
Fix expending buffer in StdCopy
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-31 10:54:06 -07:00
Alexander Larsson
7a3070a600 Add --opt arguments for drivers
In order to handle special configuration for different drivers we
make the Config field a map to string array. This lets
us use it for lxc, by using the "lxc" key for those, and we can
later extend it easily for other backend-specific options.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-03-27 21:47:47 +01:00
Daniel Norberg
fbfac21ed4 configurable dns search domains
Add a --dns-search parameter and a DnsSearch
configuration field for specifying dns search
domains.

Docker-DCO-1.1-Signed-off-by: Daniel Norberg <daniel.norberg@gmail.com> (github: danielnorberg)
2014-03-19 10:49:25 -04:00
Guillaume J. Charmes
f9bd6c860d Merge pull request #4364 from vieux/move_clone
move git clone from daemon to client
2014-03-17 11:36:56 -07:00
Michael Crosby
5239aa1f11 Move server and buildfile into server pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-14 09:37:08 -07:00
Victor Vieux
03f0ec35ae as you could have multiple messages per line with streams, don't \r
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-13 22:26:42 +00:00
Victor Vieux
8301fc8e56 move git clone from daemon to client
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)

add a little doc
2014-03-11 01:23:14 +00:00
Michael Crosby
b5a544b02e Merge pull request #4563 from creack/signal-improvment
Signal improvments
2014-03-10 17:59:17 -07:00
Guillaume J. Charmes
c563262239 Move signal to pkg
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 17:36:32 -07:00
unclejack
8bcb156694 Merge pull request #3985 from creack/add_freebsd_support
Add freebsd client support
2014-03-11 00:58:30 +02:00
Guillaume J. Charmes
bb43761940
Merge branch 'master' into add_freebsd_support
Conflicts:
	archive/archive.go
	archive/start_unsupported.go
2014-03-10 13:20:49 -07:00
Michael Crosby
82a5439835 Move image into sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-09 22:59:29 -07:00
unclejack
611acf7a7c handle symlinks for Docker's root dir & TMPDIR
This removes the incomplete symlink handling from engine.go and it adds
it one place in docker.go.

It also enables handling symlinks for TMPDIR.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-03-03 23:00:53 +02:00
unclejack
aac9542a68 Merge pull request #4412 from crosbymichael/fix-env-clobber
Don't always just append env vars, replace defaults with ones from confi...
2014-03-03 22:52:03 +02:00
Michael Crosby
b02b933c62 Don't always just append env vars, replace defaults with ones from config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-01 03:46:45 -08:00
Guillaume J. Charmes
d3a6ee1e55
Make the chan for utils.Go buffered in order to avoid goroutine leak
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-28 16:35:43 -08:00
Tianon Gravi
2ca4e0ea60 Use a more defensive vendored archive/tar import path to make it clear this isn't upstream's released archive/tar
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-27 09:43:44 -07:00
Michael Crosby
01dc79b3ea Merge pull request #4276 from tianon/json-stream-newlines
Add newlines to the JSON stream functions
2014-02-26 21:25:42 -05:00
Victor Vieux
389eba4396 Merge pull request #4297 from dotcloud/add-simple-checksum
registry: Added simple checksums (sha256) for layers
2014-02-26 18:15:48 -08:00
unclejack
a42ef866ed Merge pull request #4316 from tianon/more-lenient-kernel-version
Adjust kernel version parsing to be more lenient of strange things like "3.12-1-amd64"
2014-02-26 16:15:56 +02:00
Victor Vieux
b7a0f62f0f fix divide by zero error
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-02-25 08:01:46 +00:00
Tianon Gravi
2ae8180de2 Adjust kernel version parsing to be more lenient of strange things like "3.12-1-amd64"
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-24 13:38:58 -07:00
Sam Alba
8d230cf89c registry: Added simple checksums (sha256) for layers
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
2014-02-23 18:50:04 -08:00
Tianon Gravi
060da572d2 Add newlines to the JSON stream functions
This makes the JSON streams a _lot_ easier to parse in less well-baked JSON parsers, and no less so in better ones.

Line-based JSON streams are very, very common, where simply chunk-based is not very common at all.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-21 00:07:44 -07:00
Victor Vieux
518670f3d8 Merge pull request #4153 from crosbymichael/move-proxy
Move proxy into pkg
2014-02-17 14:51:16 -08:00
Tianon Gravi
b762d3a739 Add vendored archive/tar that includes xattrs patch
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-17 08:20:21 -07:00
Michael Crosby
8c39db8f96 Move proxy into pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-14 15:48:05 -08:00
unclejack
31dde3ea05 disallow tcp:// from defaulting to 127.0.0.1:4243
This stops docker from accepting tcp:// as a valid bind address.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-02-13 13:54:37 +02:00
Tianon Gravi
da04f49b38 Move even more stuff into dockerversion
Also, use it in all the places. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-02-11 17:26:54 -07:00
Guillaume J. Charmes
547ac42199
Add Freebsd client support
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-02-06 16:40:39 -08:00
Tianon Gravi
ee93f6185b Move UserLookup functionality into a separate pkg/user submodule that implements proper parsing of /etc/passwd and /etc/group, and use that to add support for "docker run -u user:group" and for getting supplementary groups (if ":group" is not specified)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-31 20:15:24 -07:00
Tianon Gravi
065dd231dd Update/fix build tags, Dockerfile, and release.sh for proper building and releasing of linux/386 and linux/arm cross-compiled client binaries
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-01-31 03:16:42 -07:00
Guillaume J. Charmes
45dd051e8e Remove all darwin specific files and use more generic _unsupported with build tags.
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-30 23:10:56 +00:00
Brandon Philips
87fb2c973d server: add socket activation
This adds the ability to socket activate docker by passing in
`-H fd://*` along with examples systemd configuration files.

The fastest way to test this is to run:

```
/usr/lib/systemd/systemd-activate -l 127.0.0.1:2001 /usr/bin/docker -d -H 'fd://*'
docker -H tcp://127.0.0.1:2001 ps
```

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-01-27 17:17:07 -08:00
Victor Vieux
9dcbdbc4b1 move pull and import to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-01-24 14:46:31 -08:00
Charles Lindsay
dea3c2655d Add comment about ignoring Sscanf error
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-22 09:32:50 -08:00
Charles Lindsay
cce099aa34 Re-add kernel Flavor tests
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-21 09:56:53 -08:00
Charles Lindsay
b78ae3b652 Re-add Flavor to KernelVersionInfo
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 21:26:23 -08:00
Charles Lindsay
5b97e00438 Use Sscanf instead of regexp
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 21:02:37 -08:00
Charles Lindsay
14b2b2b7c2 Fix apparent typo
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:40 -08:00
Charles Lindsay
d2c9c1036b Remove Flavor from KernelVersionInfo
Also change to parsing it with regexp to keep things simple.

Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:39 -08:00
Charles Lindsay
fc30346086 Add failing test for odd kernel version
Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
2014-01-20 19:49:39 -08:00
Michael Crosby
03a25c0800 Merge branch 'fix-registry-push-tags' of https://github.com/codeaholics/docker into codeaholics-fix-registry-push-tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-20 11:23:09 -08:00
Michael Crosby
fdd8d4b7d9 Stream the cp operation on the client
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-01-17 10:51:29 -08:00
James Allen
37fcbfa1f4 Add RWMutex lock into TruncIndex to fix race condition when inserting values
The idx.index array is overwritten when a new value is inserted to the index.
When two containers are created concurrently, their ids are inserted to the
index and one can overwrite the other leaving one of ids missing from the
index. Adding a RWMutex lock around read/write operations fixes this.

Docker-DCO-1.1-Signed-off-by: James Allen <jamesallen0108@gmail.com> (github: jpallen)
2014-01-15 17:30:00 +00:00
Fabio Falci
89bed4337d Use https to get the latest docker version
To avoid unexpected results since docker was using http.
For instance, my broadband doesn't return not found when it's down but
a html page saying that the internet is down. Docker was showing that
html instead of ignoring it.

Fix #3570

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
2014-01-13 20:37:29 +00:00
Guillaume J. Charmes
762a0cc472 Cleanup utils.Download
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:22:49 -08:00
Guillaume J. Charmes
c6350bcc24 Disable compression for build. More space usage but much faster upload
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-08 14:21:13 -08:00
Danny Yates
6b48761ce9 Remove unneeded DependencyGraph
Docker-DCO-1.0-Signed-off-by: Danny Yates <danny@codeaholics.org> (github: codeaholics)
2014-01-08 10:14:14 +00:00
Guillaume J. Charmes
1137ecf7d1
Disable compression for build. More space usage but much faster upload
Docker-DCO-1.0-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-01-07 17:46:04 -08:00
Tianon Gravi
8f3b8f3835 Run 'gofmt -s -w' 2014-01-06 22:14:35 -07:00
Victor Vieux
4e414f6205 Merge pull request #3377 from cpuguy83/3333-fix_-H_default
Make blank -H option default to the same as no -H was sent
2014-01-06 11:30:27 -08:00
Michael Crosby
4f31141e13 Merge pull request #3310 from pnasrat/cgroups-subpackage
Extract cgroups utilities to own submodule.
2014-01-06 11:27:29 -08:00
Guillaume J. Charmes
194eb246ef Merge pull request #3353 from creack/improve_add_cache
Improve add cache
2014-01-02 16:07:33 -08:00
Paul Nasrat
c561212b83 Extract cgroups utilities to own submodule.
Use mountinfo rather than for cgroups parsing.
Make helper method private and change name.
Makes method naming more explicit rather than GetThisCgroup.
Use upstream term subsystem rather than cgroupType.
2014-01-02 17:54:57 -05:00
Michael Crosby
81e596e272 Merge pull request #3287 from vieux/fix_progressbar_display_push
fix progressbar in docker push
2014-01-02 13:38:11 -08:00
Brian Goff
8b82b0dfe7 Make blank -H option default to the same as no -H was sent 2013-12-29 14:36:46 -05:00
Guillaume J. Charmes
894d4a23fb
Change BuildFile in order to use TarSum instead of custom checksum 2013-12-26 16:16:26 -08:00
Guillaume J. Charmes
fc9f4d8bad
Log files name along with their checksum in TarSum + add a Method to retrieve the checksum map 2013-12-26 16:01:36 -08:00
Guillaume J. Charmes
360078d761 Remove old debug from tarsum 2013-12-26 15:39:06 -08:00
Solomon Hykes
7ce7516c12 Move utility package 'term' to pkg/term 2013-12-23 23:42:37 +00:00
Victor Vieux
85f9b778f5 fix progressbar in docker push 2013-12-20 16:55:41 -08:00