Compare commits

...

1954 Commits

Author SHA1 Message Date
Jessica Frazelle
cc5c79129f Bump version to v1.7.0
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-06-15 17:32:17 -07:00
Michael Crosby
9fc1c4efb9 Get Mtu from default route
If no Mtu value is provided to the docker daemon, get the mtu from the
default route's interface.  If there is no default route, default to a
mtu of 1500.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit ff4e58ff56)
2015-06-15 17:32:10 -07:00
Derek McGowan
012bf4129d Store layer digests on pull
Currently digests are not stored on pull, causing a simple re-tag or re-push to send up all layers. Storing the digests on pull will allow subsequent pushes to the same repository to not push up content.
This does not address pushing content to a new repository. When content is pushed to a new repository, the digest will be recalculated. Since only one digest is currently stored, it may cause a new content push to the original repository.

Fixes #13883

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit a98ea87e46)
2015-06-15 15:06:23 -07:00
Mary Anthony
0bd5953a88 retooling for hugo
Tweaking for Hugo
Updating the Dockerfile with new sed; fix broken link on Kitematic
Fixing image pull for Dockerfile
Removing docs targets

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit f93fee5f48)
2015-06-15 14:43:25 -07:00
David Calavera
197f2e0693 Revert "contrib/init: unshare mount namespace for inits"
This reverts commit b6569b6b82.

Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit d8592eaff8)
2015-06-15 11:39:13 -07:00
Brian Goff
73e41874b6 Fixes content-type/length for stats stream=false
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 855a056af7)
2015-06-12 11:56:31 -07:00
Darren Shepherd
64552d0b49 Set omitempty for IP and PublicPort to conform w/ API 1.18
Signed-off-by: Darren Shepherd <darren@rancher.com>
(cherry picked from commit 09de92b891)
2015-06-12 10:46:07 -07:00
Chun Chen
84b21b55b9 Fix send on closed channel bug
Signed-off-by: Chun Chen <chenchun.feed@gmail.com>
(cherry picked from commit a408790de8)
2015-06-12 10:29:58 -07:00
Madhu Venugopal
7ffbd7eaee Vendoring in libnetwork to fix #13873.
Libnetwork sha# e578e95aa101441481411ff1d620f343895f24fe

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit f3d1826350)
2015-06-12 10:29:58 -07:00
Brian (bex) Exelbierd
469534c855 Update man page Dockerfile to use go-md2man v1.0.1 and go-lang 1.4
The main Dockerfile to was updated - this update brings the
sub-directory specific file inline with it.

Fixes #12866

Signed-off-by: Brian Exelbierd <bex@pobox.com>
(cherry picked from commit 5d51118c7c)
2015-06-11 14:12:55 -07:00
Eric-Olivier Lamey
85d6e7c4ec Display empty string instead of <nil> when IP opt is nil.
Fixes #13878.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit 9ad89281ae)
2015-06-11 12:53:36 -07:00
Doug Davis
a1f16a3738 Remove duplicate call to net.ParseIP
and a little cleanup

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit b180de55ca)
2015-06-11 12:53:36 -07:00
David Calavera
2ef2967570 Cleanup driver and graph db after stopping containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 0964a664e8)
2015-06-11 12:49:52 -07:00
Jörg Thalheim
ceda1e75a4 zfs: correctly apply selinux context
fixes #13858

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
(cherry picked from commit 19c31a703f)
2015-06-11 12:48:45 -07:00
Jana Radhakrishnan
2519689e99 Vendoring libnetwork to fix stale arp cache issue
Vendoring in libnetwork 90638ec9cf7fa7b7f5d0e96b0854f136d66bff92

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 386ab25137)
2015-06-11 12:48:45 -07:00
Eric-Olivier Lamey
009ba67dd0 Fix docs URL not using https.
Fixes #13838.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit 212dfb45de)
2015-06-11 12:48:45 -07:00
Jessica Frazelle
4743f3b3aa update gitignore for new manpages
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit f88e620359)
2015-06-11 12:48:45 -07:00
Mary Anthony
759cdd8ed6 Moving man pages out of docs
Adding in other areas per comments
Updating with comments; equalizing generating man page info
Updating with duglin's comments
Doug is right here again;fixing.

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit eacae64bd8)
2015-06-10 15:32:19 -07:00
Michael Crosby
ff770d33cd Revert shared container rootfs
This is breaking various setups where the host's rootfs is mount shared
correctly and breaks live migration with bind mounts.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit c9d71317be)
2015-06-10 14:16:11 -07:00
Brian Goff
1d3f7cc012 Default events since to current time
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 74c12aa429)
2015-06-10 10:38:33 -07:00
David Calavera
5291de79ae Allow to downgrade local volumes from > 1.7 to 1.6.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit bd9814f0db)
2015-06-10 10:19:12 -07:00
Zefan Li
821f9450fc Cleanup Daemon.verifyVolumesInfo() a bit
vols.VolumesRW has been initialized so it can't be nil. Furthermore
it's ok to read a nil map.

Signed-off-by: Zefan Li <lizefan@huawei.com>
(cherry picked from commit 8b4c0decfc)
2015-06-10 10:19:11 -07:00
John Howard
6a04940f86 Windows: Fix PR13278 compile break
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 71eadd4176)
2015-06-10 10:19:11 -07:00
Alexander Morozov
cf13497ca8 Update libcontainer to v2.1.1
It includes fix for mounting / as volume on SELinux.
docker/libcontainer#619

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 38acd31e8a)
2015-06-09 17:47:07 -07:00
Jana Radhakrishnan
2b15a888cd libnetwork: Add garbage collection trigger
When the daemon is going down trigger immediate
garbage collection of libnetwork resources deleted
like namespace path since there will be no way to
remove them when the daemon restarts.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit c68e7f96f9)
2015-06-09 17:28:08 -07:00
Tibor Vass
455ad3afe2 Do not set auth headers if 302
This patch ensures no auth headers are set for v1 registries if there
was a 302 redirect.

This also ensures v2 does not use authTransport.

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 123a0582b2)
2015-06-09 15:37:55 -07:00
Alessandro Boch
b5086a7494 Add integ test for unpublished ports in ps o/p
- This is a test to assert the fix #13734

Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit 7b9ae696d8)
2015-06-09 11:47:25 -07:00
Jessica Frazelle
80157b35ac skip test on lxc
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 1392f99a97)
2015-06-09 11:47:25 -07:00
Zefan Li
4ebcd0d544 test: Skip TestDevicePermissions on lxc
Closes: #13641

Signed-off-by: Zefan Li <lizefan@huawei.com>
(cherry picked from commit e55649192e)
2015-06-09 11:47:25 -07:00
Flavio Castelli
3e4284bd7c Added openSUSE and SUSE Linux Enterprise support to install.sh
Handle docker installation on openSUSE and SUSE Linux Enterprise
via https://get.docker.io/

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
(cherry picked from commit d0c4c7c83f)
2015-06-09 10:14:15 -07:00
Eric-Olivier Lamey
eb4798a10e Tiny improvements to systemd docs.
Show how to use `systemctl show` and recommend against modifying
system unit files in `/usr` and `/lib`.

Fixes #13796.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit 68bfd9e3ae)
2015-06-09 10:14:15 -07:00
Doug Davis
6c90a239ed Fix COPY/ADD quoted/json form
Minor tweak to the quoted/json form and made man page look like the Dockerfile
docs.  W/o the `,` people may think there should be a space delimited list.

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit f4a3e8bef0)
2015-06-09 10:14:15 -07:00
Eric-Olivier Lamey
8e81f3711f Fix a typo and a minor formatting issue in the docs.
Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit 173d0918a8)
2015-06-09 10:14:15 -07:00
Doug Davis
d10ed90080 Minor doc edit to add clarity around the --volume path format
Also add a comment to the ValidatePath func so devs/reviewers
know exactly what its looking for.

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit 3fcf53db92)
2015-06-09 10:14:15 -07:00
Ben Severson
7223584e10 quick doc fix for windows versions
Signed-off-by: Ben Severson <BenSeverson@users.noreply.github.com>
(cherry picked from commit a448b7aff2)
2015-06-09 10:14:15 -07:00
Chris Wahl
c4ba3a8352 Corrected VMWare to VMware
Corrected spelling of VMware.

Signed-off-by: Chris Wahl <github@wahlnetwork.com>
(cherry picked from commit 55cea4952b)
2015-06-09 10:14:15 -07:00
Antonio Murdaca
33588c23c3 Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 4ce817796e)
2015-06-08 11:39:17 -07:00
Eric-Olivier Lamey
6a5cbd0dd4 Fix docs URL in systemd service file.
Fixes #13799.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit dbf5e36fd6)
2015-06-08 11:39:17 -07:00
Eric-Olivier Lamey
495640005a Restore --default-gateway{,-v6} daemon options.
This was added before the libnetwork merge, and then lost. Fixes #13755.

Signed-off-by: Eric-Olivier Lamey <eo@lamey.me>
(cherry picked from commit 5fa60149e2)
2015-06-08 11:36:48 -07:00
John Howard
5c408158a6 Windows: factor out bridge server+config
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit ead2f80073)
2015-06-08 11:36:48 -07:00
Arnaud Porterie
ede1c3f0c2 Remove reference to experimental release
Remove reference to experimental releases as it is really a nightly
channel rather than a scheduled release.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit d8680f7beb)
2015-06-05 10:50:50 -07:00
Arnaud Porterie
09295a1453 Rename EXPERIMENTAL.md to README.md
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit 8352f2e264)
2015-06-05 10:50:50 -07:00
Mary Anthony
1f6eca7b99 Moving experimental
Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit 95dfc4c4a5)
2015-06-05 10:50:50 -07:00
Jessica Frazelle
8f211fde46 fix lxc build
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 0adfb908a6)
2015-06-05 10:29:08 -07:00
Sven Dowideit
5c70b1eadd Bring over DHE docs updates for publishing
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
(cherry picked from commit 9ed2cb300b)
2015-06-05 09:04:00 -07:00
Tianon Gravi
b3adf94d81 Fix release script to release _both_ .deb files
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
(cherry picked from commit 4572329d4b)
2015-06-04 16:39:20 -07:00
David Calavera
8e7ea1a8fd Migrate data from old vfs paths to new local volumes path.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 16a5590c5b)
2015-06-04 12:14:21 -07:00
Alessandro Boch
c11128520c Fix for #13720
Signed-off-by: Alessandro Boch <aboch@docker.com>
(cherry picked from commit ea180a73bc)
2015-06-04 12:12:50 -07:00
Tianon Gravi
25fc200dcf Swap build-* to use UTC instead of local time
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
(cherry picked from commit aa54a93f74)
2015-06-04 09:03:54 -07:00
Tianon Gravi
d17f27a13f Make "DEST" a make.sh construct instead of ad-hoc
Using "DEST" for our build artifacts inside individual bundlescripts was already well-established convention, but this officializes it by having `make.sh` itself set the variable and create the directory, also handling CYGWIN oddities in a single central place (instead of letting them spread outward from `hack/make/binary` like was definitely on their roadmap, whether they knew it or not; sneaky oddities).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
(cherry picked from commit ac3388367b)
2015-06-04 09:03:54 -07:00
Madhu Venugopal
f2f2c492e1 Using container NetworkDisabled to fix #13725
container.config.NetworkDisabled is set for both daemon's
DisableNetwork and --networking=false case. Hence using
this flag instead to fix #13725.

There is an existing integration-test to catch this issue,
but it is working for the wrong reasons.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 83208a531d)
2015-06-04 09:03:54 -07:00
Jessica Frazelle
18af7fdbba fix version struct on old versions
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 229b599259)
2015-06-03 17:33:10 -07:00
Antonio Murdaca
339f0a128a SizeRW & SizeRootFs omitted if empty in /container/json call
Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 6945ac2d02)
2015-06-03 17:33:10 -07:00
Jessica Frazelle
5a0fa9545a Update urls from .com to .org.
I added 301 redirects from dockerproject.com to dockerproject.org but may as
well make sure everything is updated anyways.

Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 7943bce894)
2015-06-03 14:23:45 -07:00
Alexander Morozov
930f691919 Support CloseNotifier for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 9e7fc245a7)
2015-06-03 13:47:20 -07:00
Antonio Murdaca
bf371ab2a5 Do not omit empty json field in /containers/json api response
Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 725f34151c)
2015-06-03 12:43:08 -07:00
Michael Crosby
d283999b1c Fix nat integration tests
This removes complexity of current implementation and makes the test
correct and assert the right things.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 4f42097883)
2015-06-02 18:54:54 -07:00
Arnaud Porterie
2786c4d0e2 Update vendoring
Update libnetwork to 005bc475ee49a36ef2ad9c112d1b5ccdaba277d4
Synchronize changes to distribution (was missing _test.go file)

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit 1664d6cd66)
2015-06-02 17:42:41 -07:00
Antonio Murdaca
2939617c8b Expose old config field for api < 1.19
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
(cherry picked from commit 6deaa58ba5)
2015-06-02 16:02:13 -07:00
David Calavera
f5e3c68c93 Update libnetwork to 4ded6fe3641b71863cc5985652930ce40efc3af4
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit ad244668c3)
2015-06-02 12:06:40 -07:00
David Calavera
c96b03797a Bump libnetwork for 1.7 release.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit ad41efd9a2)
2015-06-02 12:06:40 -07:00
Stephen J Day
0f06c54f40 Break down loadManifest function into constituent parts
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 84413be3c9)
2015-06-02 11:56:42 -07:00
Stephen J Day
32fcacdedb Add tests for loadManifest digest verification
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 74528be903)
2015-06-02 11:56:42 -07:00
Stephen J Day
140e36a77e Attempt to retain tagging behavior
Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 1e653ab645)
2015-06-02 11:56:42 -07:00
Stephen J Day
4945a51f73 Properly verify manifests and layer digests on pull
To ensure manifest integrity when pulling by digest, this changeset ensures
that not only the remote digest provided by the registry is verified but also
that the digest provided on the command line is checked, as well. If this check
fails, the pull is cancelled as with an error. Inspection also should that
while layers were being verified against their digests, the error was being
treated as tech preview image signing verification error. This, in fact, is not
a tech preview and opens up the docker daemon to man in the middle attacks that
can be avoided with the v2 registry protocol.

As a matter of cleanliness, the digest package from the distribution project
has been updated to latest version. There were some recent improvements in the
digest package.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 06612cc0fe)
2015-06-02 11:56:41 -07:00
Jeffrey van Gogh
c881349e5e Upon HTTP 302 redirect do not include "Authorization" header on 'untrusted' registries.
Refactoring in Docker 1.7 changed the behavior to add this header where as Docker <= 1.6 wouldn't emit this Header on a HTTP 302 redirect.

This closes #13649

Signed-off-by: Jeffrey van Gogh <jvg@google.com>
(cherry picked from commit 65c5105fcc)
2015-06-02 11:56:41 -07:00
Victor Vieux
ecdf1297a3 no not print empty keys in docker info
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
(cherry picked from commit c790aa36ea)
2015-06-02 11:03:06 -07:00
Antonio Murdaca
db3daa7bdd Fix wrong kill signal parsing
Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com>
(cherry picked from commit 39eec4c25b)
2015-06-02 09:43:43 -07:00
Richard
c0fc839e2b If no endpoint could be established with the given mirror configuration,
fallback to pulling from the hub as per v1 behavior.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
(cherry picked from commit 6e4ff1bb13)
2015-06-01 18:11:10 -07:00
Alexander Morozov
2e29eadb5c Fix race condition in registry/session
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 9d98c28855)
2015-06-01 14:45:22 -07:00
Tonis Tiigi
ecda5c0a6d Fix breakouts from git root during build
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 7f7ebeffe8)
2015-06-01 13:06:12 -07:00
Arnaud Porterie
4872f86d00 Add note about overlay not being production ready
Add a paragraph in cli.md mentioning that overlay is not a production
ready graphdriver.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit 67cb748e26)
2015-06-01 12:26:57 -07:00
Lei Jitang
6ca78fff63 Add docker stats --no-stream show cpu usage
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 96123a1fd5)

Conflicts:
	daemon/stats.go
2015-06-01 10:09:14 -07:00
David R. Jenni
e9c51c3edc Fix issue #10184.
Merge user specified devices correctly with default devices.
Otherwise the user specified devices end up without permissions.

Signed-off-by: David R. Jenni <david.r.jenni@gmail.com>
(cherry picked from commit c913c9921b)
2015-06-01 09:32:50 -07:00
Jessica Frazelle
b38c720f19 fix experimental version and release script
add api version experimental

Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit b372f9f224)

Conflicts:
	docs/sources/reference/api/docker_remote_api_v1.20.md
2015-06-01 09:31:32 -07:00
Jana Radhakrishnan
3bed793ba1 Do not attempt releasing network when not attached to any network
Sometimes container.cleanup() can be called from multiple paths
for the same container during error conditions from monitor and
regular startup path. So if the container network has been already
released do not try to release it again.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
(cherry picked from commit 6cdf8623d5)
2015-06-01 08:53:49 -07:00
Doug Davis
ab7e7a7338 Carry #11858
Continues 11858 by:
- Making sure the exit code is always zero when we ask for help
- Making sure the exit code isn't zero when we print help on error cases
- Making sure both short and long usage go to the same stream (stdout vs stderr)
- Making sure all docker commands support --help
- Test that all cmds send --help to stdout, exit code 0, show full usage, no blank lines at end
- Test that all cmds (that support it) show short usage on bad arg to stderr, no blank line at end
- Test that all cmds complain about a bad option, no blank line at end
- Test that docker (w/o subcmd) does the same stuff mentioned above properly

Signed-off-by: Doug Davis <dug@us.ibm.com>
(cherry picked from commit 8324d7918b)
2015-06-01 08:53:49 -07:00
Lei Jitang
4fefcde5a6 Ensure all the running containers are killed on daemon shutdown
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit bdb77078b5)
2015-05-29 16:50:23 -07:00
Arnaud Porterie
63e3b7433f Add note about overlay not being production ready
Add a paragraph in cli.md mentioning that overlay is not a production
ready graphdriver.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit 67cb748e26)
2015-05-29 16:28:00 -07:00
Jessica Frazelle
736c216d58 fix bug with rmi multiple tag
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 185f392691)
2015-05-29 15:12:33 -07:00
Antonio Murdaca
85f0e01833 Fix regression in stats API endpoint where stream query param default is true
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
(cherry picked from commit ec97f41465)
2015-05-29 15:06:01 -07:00
Zhang Wei
eb3ed436a4 bug fix: close http response body no longer in use
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
(cherry picked from commit 6c49576a86)
2015-05-29 14:34:25 -07:00
Burke Libbey
d77d7a0056 Use bufio.Reader instead of bufio.Scanner for logger.Copier
When using a scanner, log lines over 64K will crash the Copier with
bufio.ErrTooLong. Subsequently, the ioutils.bufReader will grow without
bound as the logs are no longer being flushed to disk.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
(cherry picked from commit f779cfc5d8)
2015-05-29 13:39:21 -07:00
Antonio Murdaca
a0aad0d4de Add syslog-address log-opt
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
(cherry picked from commit e8c88d2533)
2015-05-29 10:28:28 -07:00
Mary Anthony
baf9ea5ce4 Fixes to the 1.19 version
updating with changes to this instant
Signed-off-by: Mary Anthony <mary@docker.com>

(cherry picked from commit 30901609a8)
2015-05-29 10:28:28 -07:00
David Calavera
a6fe70c696 Mount bind volumes coming from the old volumes configuration.
Signed-off-by: David Calavera <david.calavera@gmail.com>
(cherry picked from commit 53d9609de4)
2015-05-29 09:52:36 -07:00
Harald Albers
eee959a9b9 Update bash completion for 1.7.0
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit b2832dffe5)
2015-05-29 09:52:36 -07:00
Alexander Morozov
d000ba05fd Treat systemd listeners as all other
Fix #13549

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 6f9fa64645)
2015-05-28 14:16:28 -07:00
Antonio Murdaca
d8eff999e0 Fix race in httpsRequestModifier.ModifyRequest when writing tlsConfig
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
(cherry picked from commit a27395e6df)
2015-05-28 11:33:34 -07:00
Jason Shepherd
fb124bcad0 adding nicer help when missing arguments (#11858)
Signed-off-by: Jason Shepherd <jason@jasonshepherd.net>
(cherry picked from commit 48231d623f)
2015-05-28 11:33:34 -07:00
Lei Jitang
9827107dcf Fix automatically publish ports without --publish-all
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 9a09664b51)
2015-05-28 10:03:29 -07:00
Jessica Frazelle
e57d649057 fix release script
Signed-off-by: Jessica Frazelle <princess@docker.com>
(cherry picked from commit 9f619282db)
2015-05-28 10:03:29 -07:00
Tianon Gravi
d6ff6e2c6f Add fedora:22 to our rpm targets
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
(cherry picked from commit 96903c837f)
2015-05-28 10:03:29 -07:00
Jessica Frazelle
cc2944c7af Merge remote-tracking branch 'origin/master' into bump_v1.7.0
* origin/master: (999 commits)
  Review feedback:     - Match verbiage with other output     - Remove dead code and clearer flow
  Vendoring in libnetwork 2da2dc055de5a474c8540871ad88a48213b0994f
  Restore the stripped registry version number
  Use SELinux labels for volumes
  apply selinux labels volume patch on volumes refactor
  Modify volume mounts SELinux labels on the fly based on :Z or :z
  Remove unused code
  Remove redundant set header
  Return err if we got err on parseForm
  script cleaned up
  Fix unregister stats on when rm running container
  Fix container unmount networkMounts
  Windows: Set default exec driver to windows
  Fixes title, line wrap, and Adds install area Tibor's comment Updating with the new plugins Entering comments from Seb
  Add regression test to make sure we can load old containers with volumes.
  Do not force `syscall.Unmount` on container cleanup.
  Revert "Add docker exec run a command in privileged mode"
  Cleanup container rm funcs
  Allow mirroring only for the official index
  Registry v2 mirror support.
  ...

Conflicts:
	CHANGELOG.md
	VERSION
	api/client/commands.go
	api/client/utils.go
	api/server/server.go
	api/server/server_linux.go
	builder/shell_parser.go
	builder/words
	daemon/config.go
	daemon/container.go
	daemon/daemon.go
	daemon/delete.go
	daemon/execdriver/execdrivers/execdrivers_linux.go
	daemon/execdriver/lxc/driver.go
	daemon/execdriver/native/driver.go
	daemon/graphdriver/aufs/aufs.go
	daemon/graphdriver/driver.go
	daemon/logger/syslog/syslog.go
	daemon/networkdriver/bridge/driver.go
	daemon/networkdriver/portallocator/portallocator.go
	daemon/networkdriver/portmapper/mapper.go
	daemon/networkdriver/portmapper/mapper_test.go
	daemon/volumes.go
	docs/Dockerfile
	docs/man/docker-create.1.md
	docs/man/docker-login.1.md
	docs/man/docker-logout.1.md
	docs/man/docker-run.1.md
	docs/man/docker.1.md
	docs/mkdocs.yml
	docs/s3_website.json
	docs/sources/installation/windows.md
	docs/sources/reference/api/docker_remote_api_v1.18.md
	docs/sources/reference/api/registry_api_client_libraries.md
	docs/sources/reference/builder.md
	docs/sources/reference/run.md
	docs/sources/release-notes.md
	graph/graph.go
	graph/push.go
	hack/install.sh
	hack/vendor.sh
	integration-cli/docker_cli_build_test.go
	integration-cli/docker_cli_pull_test.go
	integration-cli/docker_cli_run_test.go
	pkg/archive/changes.go
	pkg/broadcastwriter/broadcastwriter.go
	pkg/ioutils/readers.go
	pkg/ioutils/readers_test.go
	pkg/progressreader/progressreader.go
	registry/auth.go
	vendor/src/github.com/docker/libcontainer/cgroups/fs/cpu.go
	vendor/src/github.com/docker/libcontainer/cgroups/fs/devices.go
	vendor/src/github.com/docker/libcontainer/cgroups/fs/memory.go
	vendor/src/github.com/docker/libcontainer/cgroups/systemd/apply_systemd.go
	vendor/src/github.com/docker/libcontainer/container_linux.go
	vendor/src/github.com/docker/libcontainer/init_linux.go
	vendor/src/github.com/docker/libcontainer/integration/exec_test.go
	vendor/src/github.com/docker/libcontainer/integration/utils_test.go
	vendor/src/github.com/docker/libcontainer/nsinit/README.md
	vendor/src/github.com/docker/libcontainer/process.go
	vendor/src/github.com/docker/libcontainer/rootfs_linux.go
	vendor/src/github.com/docker/libcontainer/update-vendor.sh
	vendor/src/github.com/docker/libnetwork/portallocator/portallocator_test.go
2015-05-27 19:13:22 -07:00
Tibor Vass
2daede5a9c Merge pull request #13374 from RichardScothern/v2-mirror
V2 mirror support
2015-05-27 21:15:26 -04:00
Arnaud Porterie
c2e8f07a05 Merge pull request #13518 from mrjana/clone
Vendoring in libnetwork 2da2dc055de5a474c8540871ad88a48213b0994f
2015-05-27 17:42:10 -07:00
Richard
e817e08481 Review feedback:
- Match verbiage with other output
    - Remove dead code and clearer flow

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-05-27 17:29:24 -07:00
Jana Radhakrishnan
d429465b37 Vendoring in libnetwork 2da2dc055de5a474c8540871ad88a48213b0994f
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-28 00:04:01 +00:00
Tianon Gravi
c9d3681a5d Merge pull request #13477 from kvasdopil/freebsd-build
Make hack/make.sh work on FreeBSD
2015-05-27 17:42:49 -06:00
David Calavera
49e734c6e4 Merge pull request #13496 from Microsoft/10662-windefaults
Windows: Set default exec driver to windows
2015-05-27 16:02:24 -07:00
Richard
f6f7d35248 Restore the stripped registry version number
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-05-27 15:15:47 -07:00
Arnaud Porterie
ec471a7c9b Merge pull request #12572 from jfrazelle/selinux-labels-carry
Modify volume mounts SELinux labels on the fly based on :Z or :z
2015-05-27 14:46:16 -07:00
Brian Goff
b2a43baf2e Use SELinux labels for volumes
Fixes a regression from the volumes refactor where the vfs graphdriver
was setting labels for volumes to `s0` so that they can both be written
to by the container and shared with other containers.
When moving away from vfs this was never re-introduced.
Since this needs to happen regardless of volume driver, this is
implemented outside of the driver.

Fixes issue where `z` and `Z` labels are not set for bind-mounts.

Don't lock while creating volumes

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-27 13:43:38 -07:00
David Calavera
f5d3311839 Merge pull request #13449 from duglin/FixRaceInStop
Fix race condition on container stop
2015-05-27 13:05:53 -07:00
Jessica Frazelle
af7d17a6c9 apply selinux labels volume patch on volumes refactor
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-27 12:50:16 -07:00
Dan Walsh
160dc79db0 Modify volume mounts SELinux labels on the fly based on :Z or :z
This patch is extending the qualifiers on the -v command to allow
an admin to tell the system to relabel, content. There might be a
need for something similar for changing the DAC Permissions.

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-27 12:50:16 -07:00
Alexander Morozov
7b57fae046 Merge pull request #13507 from hqhq/hq_remove_redundant_set_header
Remove redundant set header
2015-05-27 10:44:57 -07:00
David Calavera
26650e2ccc Merge pull request #13483 from jfrazelle/lxc-we-meet-again
fix lxc tests unshare, they dont use our apparmor profile
2015-05-27 10:22:31 -07:00
Doug Davis
b29f3bb1c3 Merge pull request #13506 from hqhq/hq_fix_wrong_return_nil
Return err if we got err on parseForm
2015-05-27 12:38:53 -04:00
Alexander Morozov
2029257e3c Merge pull request #13493 from jlhawn/volume_unmount_fix
Fix container unmount networkMounts
2015-05-27 08:44:11 -07:00
Phil Estes
f3e56420a3 Merge pull request #13499 from cpuguy83/fix_stats_unsubscribe
Fix unregister stats on when rm running container
2015-05-27 11:10:36 -04:00
Antonio Murdaca
3f66f6f2f0 Merge pull request #13500 from HuKeping/cleanup
Remove unused code
2015-05-27 13:59:40 +02:00
Hu Keping
a34cb32186 Remove unused code
As far as I see, it's a dead code.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-27 22:39:02 +08:00
Qiang Huang
94d604357f Remove redundant set header
Which is already done in writeJSON.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-27 18:25:57 +08:00
Qiang Huang
7c7aebfcfe Return err if we got err on parseForm
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-27 18:16:28 +08:00
Alexey Guskov
f228fb09ac script cleaned up
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-05-27 10:21:09 +03:00
Brian Goff
b3e8ab3021 Fix unregister stats on when rm running container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-26 22:22:03 -04:00
moxiegirl
e580734149 Merge pull request #13406 from moxiegirl/experimental-work
Placeholder Part II: For commenting about install
2015-05-26 18:19:26 -07:00
Josh Hawn
04f99a6ca8 Fix container unmount networkMounts
UnmountVolumes used to also unmount 'specialMounts' but it no longer does after
a recent refactor of volumes. This patch corrects this behavior to include
unmounting of `networkMounts` which replaces `specialMounts` (now dead code).

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-05-26 17:38:26 -07:00
Arnaud Porterie
b50e780925 Merge pull request #13491 from jfrazelle/revert-exec-privileged
Revert "Add docker exec run a command in privileged mode"
2015-05-26 16:41:50 -07:00
Brian Goff
838e1a8947 Merge pull request #13487 from calavera/volume_load_regression_test
Add regression test to make sure we can load old containers with volumes.
2015-05-26 19:40:08 -04:00
Tibor Vass
54b514735c Merge pull request #12881 from nakedible/patch-1
Prevent fallback to v1 registry for digest pulls
2015-05-26 19:24:37 -04:00
John Howard
041ba90dbb Windows: Set default exec driver to windows
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-26 16:17:33 -07:00
Mary Anthony
1ba1a0550f Fixes title, line wrap, and Adds install area
Tibor's comment
Updating with the new plugins
Entering comments from Seb

Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-26 15:37:38 -07:00
Alexander Morozov
0d445685b8 Merge pull request #13444 from runcom/fix-race-stats
Fix race in stats cli and native driver
2015-05-26 15:34:50 -07:00
David Calavera
ea0e15ba62 Add regression test to make sure we can load old containers with volumes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-26 15:28:58 -07:00
Arnaud Porterie
bd18d86250 Merge pull request #13492 from calavera/donot_force_syscall_unmount_on_cleanup
Do not force `syscall.Unmount` on container cleanup.
2015-05-26 15:23:16 -07:00
David Calavera
f78dce152c Do not force syscall.Unmount on container cleanup.
This is not necessary and it's a regression from the old behavior.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-26 14:28:26 -07:00
Alexander Morozov
de318d8c1d Merge pull request #13489 from cpuguy83/cleanup_rm_funcs
Cleanup container rm funcs
2015-05-26 14:24:02 -07:00
Jessica Frazelle
40b71adee3 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5.

Signed-off-by: Jessica Frazelle <princess@docker.com>

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
2015-05-26 14:12:16 -07:00
Arnaud Porterie
47e727d1fc Merge pull request #13440 from LK4D4/fix_bridge_none
Fix network with -b none
2015-05-26 14:08:21 -07:00
Tianon Gravi
3b795e035b Merge pull request #13409 from LK4D4/add_opts_to_checkconfig
Add some opts to checkconfig
2015-05-26 13:54:23 -06:00
Brian Goff
f8628ba891 Cleanup container rm funcs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-26 15:38:52 -04:00
Derek McGowan
c19962ade1 Allow mirroring only for the official index
Strip authconfig from session to keep credentials from being sent to the mirror.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-05-26 11:08:19 -07:00
Richard
13deed3801 Registry v2 mirror support.
The v2 registry will act as a pull-through cache, and needs to be
handled differently by the client to the v1 registry mirror.

See docker/distribution#459 for details

Configuration

Only one v2 registry can be configured as a mirror. Acceptable configurations
in this chanage are: 0...n v1 mirrors or 1 v2 mirror. A mixture of v1 and v2
mirrors is considered an error.

Pull

If a v2 mirror is configured, all pulls are redirected to that mirror. The
mirror will serve the content locally or attempt a pull from the upstream mirror,
cache it locally, and then serve to the client.

Push

If an image is tagged to a mirror, it will be pushed to the mirror and be
stored locally there. Otherwise, images are pushed to the hub. This is
unchanged behavior.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-05-26 11:08:19 -07:00
David Calavera
fc679bebb9 Merge pull request #13479 from Microsoft/10662-fixcontaineragain
Windows: Fix up container again
2015-05-26 10:49:48 -07:00
Arnaud Porterie
7853bd29ec Merge pull request #13480 from Microsoft/10662-fixvolumecompile
Windows: Fix volume_windows compile
2015-05-26 10:32:44 -07:00
Jessica Frazelle
a08fb73f93 fix lxc tests unshare, they dont use our apparmor profile
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-26 10:31:21 -07:00
John Howard
1dc0499b64 Windows: Fix volume_windows compile
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-26 09:43:21 -07:00
John Howard
5d207de509 Windows: Fix up container again
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-26 09:33:55 -07:00
Brian Goff
0fccc40307 Merge pull request #13471 from ibuildthecloud/no-nil
Preinitialize MountPoints to avoid assigning to a nil map
2015-05-26 12:26:49 -04:00
Sebastiaan van Stijn
aee9ac302d Merge pull request #13335 from jfrazelle/add-apparmor-unshare-test
add unshare apparmor profile test
2015-05-26 17:32:45 +02:00
Alexey Guskov
9e00e34092 Make hack/make.sh work on FreeBSD
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-05-26 15:59:36 +03:00
Antonio Murdaca
9e425d56d0 Add lock before accessing native driver active containers
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-26 13:55:02 +02:00
Antonio Murdaca
77280a87b7 Fix race in stats cli and native driver
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-26 13:55:02 +02:00
Darren Shepherd
59214a0737 Preinitialize MountPoints to avoid assigning to a nil map
Fixes #13435

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-25 19:37:57 -07:00
James Turnbull
628c396555 Merge pull request #13467 from epc/epc-2015145
Documentation Copy edits for typos
2015-05-25 14:32:17 -04:00
Ed Costello
7d75c5be95 Copy edits for typos
Signed-off-by: Ed Costello <epc@epcostello.com>
2015-05-25 13:39:56 -04:00
Sebastiaan van Stijn
8efd87f5a2 Merge pull request #13447 from justone/mention-dockviz-alternative
mention dockviz alternative
2015-05-25 19:26:19 +02:00
Sebastiaan van Stijn
187362414d Merge pull request #13418 from donkirkby/patch-1
small formatting and grammar fixes
2015-05-25 19:15:47 +02:00
Nate Jones
453c0abf1c mention dockviz alternative
closes #13431

Signed-off-by: Nate Jones <nate@endot.org>
2015-05-25 09:43:25 -07:00
Sebastiaan van Stijn
c12081987a Merge pull request #13461 from moxiegirl/add-glossary-back
Adding back in Glossary
2015-05-25 18:32:15 +02:00
Sebastiaan van Stijn
5f57143b31 Merge pull request #13458 from janjaapdriessen/patch-1
Fix markdown syntax for "docker run" instruction example
2015-05-25 18:07:19 +02:00
Don Kirkby
5051aee555 small formatting and grammar fixes
Having the line break in the middle of a code span caused the line break to appear on the web site version, even though it doesn't appear in the preview.

The other two changes are just small grammar improvements.

Signed-off-by: don <donkirkby@gmail.com>
2015-05-25 09:05:42 -07:00
Sebastiaan van Stijn
e2ed11df13 Merge pull request #13445 from lloydde/doc-cli-no-head
doc: cli images examples rm "| head".
2015-05-25 17:32:13 +02:00
Jan-Jaap Driessen
02405a96b2 Markdown changes (thanks to runcom for the rebase+squash handholding)
Signed-off-by: Jan-Jaap Driessen <janjaapdriessen@gmail.com>
2015-05-25 17:24:41 +02:00
Mary Anthony
08da08f3f9 Adding back in Glossary
Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-25 07:39:27 -07:00
Doug Davis
29bdcaf3cf Fix race condition on container stop
I'm fairly consistently seeing an error in
DockerSuite.TestContainerApiRestartNotimeoutParam:

docker_api_containers_test.go:969:
    c.Assert(status, check.Equals, http.StatusNoContent)
    ... obtained int = 500
    ... expected int = 204

And in the daemon logs I see:
INFO[0003] Container 8cf77c20275586b36c5095613159cf73babf92ba42ed4a2954bd55dca6b08971 failed to exit within 0 seconds of SIGTERM - using the force
ERRO[0003] Handler for POST /containers/{name:.*}/restart returned error: Cannot restart container 8cf77c20275586b36c5095613159cf73babf92ba42ed4a2954bd55dca6b08971: [2] Container does not exist: container destroyed

ERRO[0003] HTTP Error                                    err=Cannot restart container 8cf77c20275586b36c5095613159cf73babf92ba42ed4a2954bd55dca6b08971: [2] Container does not exist: container destroyed
 statusCode=500

Note the "container destroyed" error message.  This is being generatd by
the libcontainer code and bubbled up in container.Kill() as a result of the
call to `container.killPossiblyDeadProcess(9)` on line 439.

See the comment in the code, but what I think is going on is that because we
don't have any timeout on the Stop() call we immediate try to force things to
stop. And by the time we get into libcontainer code the process just finished
stopping due to the initial signal, so this secondary sig-9 fails due to the
container no longer running (ie. its 'destroyed').

Since we can't look for "container destroyed" to just ignore the error, because
some other driver might have different text, I opted to just ignore the error
and keep going - with the assumption that if it couldnt send a sig-9 to the
process then it MUST be because its already dead and not something else.

To reproduce this I just run:
curl -v -X POST http://127.0.0.1:2375/v1.19/containers/8cf77c20275586b36c5095613159cf73babf92ba42ed4a2954bd55dca6b08971/restart

a few times and then it fails with the HTTP 500.

Would like to hear some other ideas on to handle this since I'm not
thrilled with the proposed solution.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-25 04:28:23 -07:00
Sebastiaan van Stijn
fd28f15288 Merge pull request #13452 from WeiZhang555/cleanup
Cleanup: change test func name
2015-05-25 13:11:31 +02:00
Zhang Wei
ab121345ee Cleanup: change test func name
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-25 14:51:10 +08:00
Lloyd Dewolf
ca23ac37ef doc: cli images examples rm "| head".
It's a given that lines of example output might be truncated or come
from a contrived environment.

Signed-off-by: Lloyd Dewolf <foolswisdom@gmail.com>
2015-05-24 14:04:13 -07:00
Alexander Morozov
3cb14df68c Fix network with -b none
* Don't AllocateNetwork when network is disabled
* Don't createNetwork in execdriver when network is disabled

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-24 08:26:59 -07:00
Arnaud Porterie
f83073d3eb Merge pull request #13424 from mavenugo/vendorin
Vendoring in libnetwork 67438080724b17b641b411322822c00d0d3c3201
2015-05-23 21:08:58 -07:00
Arnaud Porterie
bce3e761c0 Merge pull request #13161 from calavera/plugin_discovery
Proposal: Volume refactor and external volume plugins
2015-05-23 18:44:18 -07:00
Madhu Venugopal
a3d22c764c Vendoring in libnetwork 67438080724b17b641b411322822c00d0d3c3201
This version brings in upto-date important bug-fixes from libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-23 18:42:34 -07:00
moxiegirl
2e2e36e476 Merge pull request #13427 from moxiegirl/event-state-12164
Finally, finally, close #12164
2015-05-23 15:37:57 -07:00
Mary Anthony
6de4138465 Finally, finally, close #12164
Updating with typo Seb found

Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-23 14:27:50 -07:00
Alexander Morozov
89582f9781 Merge pull request #13403 from hqhq/hq_fix_ipcmode_check
Don't check running container at create time
2015-05-23 08:32:51 -07:00
Arnaud Porterie
8d0486832d Document in the experimental section
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit a31633c2707c78c2ffd684a5a3e576f310af0fb5)
2015-05-22 17:00:04 -07:00
David Calavera
ab8a5bcf04 Move Documentation changes out or this PR.
The will come in a follow up PR inside the experimental section.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-22 16:58:48 -07:00
David Calavera
d592778f4a Propagate unmount events to the external volume drivers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-22 16:43:34 -07:00
Qiang Huang
84aae5a226 Don't check running container at create time
We should let user create container even if the container he wants
join is not running, that check should be done at start time.

In this case, the running check is done by getIpcContainer() when
we start container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-23 07:15:14 +08:00
Jessie Frazelle
4bcfa47362 Merge pull request #13414 from tiborvass/no-distrib-in-dockerfile
Remove distribution source code from /go/src
2015-05-22 15:11:36 -07:00
Tibor Vass
2b0b0c4b97 Remove distribution source code from /go/src
We already vendor distribution under ./vendor, but
because the GOPATH is /go:/go/src/github.com/.../vendor
Go will always compile the source code at /go not in ./vendor.

Apart from the fact that it is very inconvenient during
development, it was also a time-bomb: someone vendors a fix
from upstream distribution, but forgets to update
REGISTRY_COMMIT in the Dockerfile, and the binary doesn't get
the fix.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-22 16:50:56 -04:00
Alexander Morozov
6cc4cf7c0c Add BRIDGE_NETFILTER to check-config.sh
It is needed to use network with --userland-proxy=false and for
--icc=false

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-22 10:46:55 -07:00
Jessie Frazelle
f2c0b54315 Merge pull request #13408 from jfrazelle/13407-fix-experimental-build
lol 108 chars ETOOMANY
2015-05-22 10:42:57 -07:00
Alexander Morozov
ceca037d05 Add optional CONFIG_BLK_CGROUP and CONFIG_IOSCHED_CFQ to check-config.sh
It is needed for blkio.weight support

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-22 10:41:29 -07:00
Michael Crosby
ed9ad0be6d Merge pull request #13391 from jfrazelle/add-security-maintainers
Add diogo and nathan as security maintainers.
2015-05-22 10:12:04 -07:00
Jessica Frazelle
a1ea562b20 lol 108 chars ETOOMANY
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-22 10:10:17 -07:00
Alexander Morozov
d71ba0cc83 Merge pull request #13372 from calavera/move_socket_creation_to_package
Extract sockets initialization to a package.
2015-05-22 08:46:31 -07:00
moxiegirl
8e76c0d1d8 Merge pull request #13303 from moxiegirl/experimental-work
Experimental features placeholder
2015-05-22 08:42:57 -07:00
Brian Goff
0775456b46 Merge pull request #13401 from WeiZhang555/cleanup
Delete "defer deleteAllContainers()" from integration-cli
2015-05-22 09:17:23 -04:00
Zhang Wei
6809fa6861 Delete "defer deleteAllContainers()" from integration-cli
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-22 17:01:52 +08:00
David Calavera
a867c1b70a Mark volume drivers and plugins as experimental in the documentation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
David Calavera
3bf0ca31cf Allow named volumes for external drivers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
Arnaud Porterie
2653c7c16c Make API volume-driver dependent on 'experimental'
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 20:34:17 -07:00
Arnaud Porterie
4fc37a1ede Mark --volume-driver as experimental
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 20:34:17 -07:00
Arnaud Porterie
7da5a7eb66 Disable -v overloading
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
(cherry picked from commit ec5a362fb93358244305067419589f602fd33807)
2015-05-21 20:34:17 -07:00
David Calavera
81fa9feb0c Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
Brian Goff
23e8dff9e7 Merge pull request #13399 from hqhq/hq_fix_run_test
Fix test failure when --net none build
2015-05-21 21:50:44 -04:00
Brian Goff
88275e94d6 Merge pull request #12766 from Microsoft/10662-graphdriverrefactor
Windows: graphdriver refactor
2015-05-21 21:28:24 -04:00
Jessica Frazelle
7c6cab6345 Add diogo and nathan as security maintainers.
Updated my email.

Also retabbed the whole file... I am OCD.

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-21 17:59:38 -07:00
Jessie Frazelle
2b8271399e Merge pull request #13386 from icecrime/experimental_suffix_version
Suffix experimental version / fix warning output
2015-05-21 17:42:23 -07:00
Qiang Huang
c0dd8538db Fix test failure when --net none build
Closes: #13369

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-22 08:21:09 +08:00
Arnaud Porterie
78578125ce Add suffix to experimental builds version
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 16:27:42 -07:00
Sven Dowideit
ddf783ed2f Merge pull request #13395 from SvenDowideit/cs-docker-1.6.2cs5-release-notes
Publish release notes for latest cs Docker engine
2015-05-22 09:16:12 +10:00
Sven Dowideit
740b1b5a2d Publish release notes for latest cs Docker engine
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-22 09:14:06 +10:00
Sebastiaan van Stijn
b639f00280 Merge pull request #13336 from calavera/document_missing_build_flags
Document missing build flags.
2015-05-22 01:03:37 +02:00
Jessie Frazelle
6c5a140f8a Merge pull request #13393 from tiborvass/fix-token-bug
registry: Fix auth bug
2015-05-21 15:58:17 -07:00
David Calavera
2be757f869 Merge pull request #12964 from Microsoft/10662-emptywindowsexecdriver
Windows: Empty Windows Exec Driver
2015-05-21 15:30:21 -07:00
David Calavera
a85b09d8a4 Document missing build flags.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 15:02:00 -07:00
Tibor Vass
fc29f7f70b registry: fix auth bug
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-21 16:53:22 -04:00
Alexander Morozov
7fffcfff32 Merge pull request #13387 from cpuguy83/fix_ngroutine_test
Better checking for LogsFollowGoroutinesWithStdout
2015-05-21 12:31:57 -07:00
Brian Goff
2805ff1ece Better checking for LogsFollowGoroutinesWithStdout
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-21 14:13:01 -04:00
Michael Crosby
523d2f6a04 Merge pull request #13371 from theadactyl/patch-2
Add theadactyl as community manager
2015-05-21 11:06:38 -07:00
David Calavera
00e78a18ba Merge pull request #13380 from coolljt0725/add_missing_check_return_err_function
Add missing return error check for container.WriteHostConfig() in container_linux.go
2015-05-21 09:32:52 -07:00
David Calavera
0ac5e8a170 Merge pull request #13383 from duglin/CreateRMTest
Add a 'docker create' + 'docker rm' testcase
2015-05-21 09:32:32 -07:00
Doug Davis
012e588a74 Add a 'docker create' + 'docker rm' testcase
Per @thaJeztah's comment here: https://github.com/docker/docker/pull/13367#issuecomment-104286651
I couldn't find an existing test that covered this.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-21 07:30:51 -07:00
Lei Jitang
a9bc05a2f8 Add missing return error check
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-21 17:03:43 +08:00
Jessie Frazelle
ef0a145593 Merge pull request #13310 from coolljt0725/make_ps_size_show_virtual_size_work
Make docker ps --size show virtual size really work
2015-05-20 18:32:11 -07:00
Mary Anthony
7231692a02 Experimental features placeholder
Signed-off-by: Mary Anthony <mary@docker.com>

Adding experimental features into the mix

Signed-off-by: Mary Anthony <mary@docker.com>

renaming file

Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-20 18:10:07 -07:00
Lei Jitang
d0de2b1e2f Make docker ps --size show virtual size really work
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-21 08:57:11 +08:00
Jessie Frazelle
366fe46c6a Merge pull request #13326 from tianon/squeeze-lts
Fix "squeeze" detection in contrib/mkimage/debootstrap
2015-05-20 17:41:27 -07:00
Tianon Gravi
f74d9b8672 Merge pull request #13195 from albers/completion-custom-host
respect -H in bash completion
2015-05-20 17:31:16 -07:00
Jessie Frazelle
c68915ff70 Merge pull request #13270 from samsabed/gpg-dockerfile
Trivial use port 80 for dev Dockerfile gpg
2015-05-20 17:30:01 -07:00
Tianon Gravi
28465588d0 Merge pull request #13241 from hqhq/hq_enhance_checkconfig
Enhance check-config.sh
2015-05-20 17:25:30 -07:00
David Calavera
0bfbc6e788 Extract sockets initialization to a package.
Because I just used it somewhere else and it would be nice if I didn't have to copy and paste the code.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-20 16:48:39 -07:00
theadactyl
f86d39c6b6 Add theadactyl as community manager
Added Community Manager role to Org.Operators and added theadactyl as community manager

Signed-off-by: Thea Lamkin <thea@docker.com>
2015-05-20 16:21:36 -07:00
moxiegirl
2bf409d4ef Merge pull request #13366 from moxiegirl/162-release-notes
Updating with 1.6.2-cs5 notes
2015-05-20 15:03:27 -07:00
Mary Anthony
7554949da6 Updating with 1.6.2-cs5 notes
Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-20 14:39:00 -07:00
Antonio Murdaca
0fddb6ad7e Merge pull request #13263 from rajdeepd/dry-run-test-2
TestCase for CpuShares and Cpuset
2015-05-20 23:33:42 +02:00
Jessica Frazelle
6f75dd85c5 add unshare apparmor profile test
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-20 14:06:00 -07:00
Jessie Frazelle
19790c46dc Merge pull request #13338 from icecrime/13023_experimental_env_var
Add DOCKER_EXPERIMENTAL environment variable
2015-05-20 13:04:28 -07:00
Arnaud Porterie
79532e6d58 Merge pull request #13078 from Microsoft/10662-pkgarchive
Windows: Archive package changes for Windows daemon
2015-05-20 12:39:26 -07:00
Arnaud Porterie
ca6722f1c5 Add DOCKER_EXPERIMENTAL environment variable
The DOCKER_EXPERIMENTAL environment variable drives the activation of
the 'experimental' build tag.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-20 12:21:17 -07:00
Alexander Morozov
dec13cef2a Merge pull request #13346 from mrjana/cnm_integ
Fix network connectivity problem for non-root users
2015-05-20 12:02:07 -07:00
Jessie Frazelle
76a5fb3e1e Merge pull request #13359 from davidxia/increase-docker-kill-timeout
Increase upstart kill timeout to 20 seconds
2015-05-20 11:54:07 -07:00
Rajdeep Dua
ebe344d34b TestCase for CpuShares and Cpuset
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
2015-05-20 11:32:48 -07:00
David Xia
2f9e7a067a Increase upstart kill timeout to 20 seconds
Give Docker more time to kill containers before upstart kills Docker.
The default kill timeout is 5 seconds.
This will help decrease the chance of but not eliminate the chance of
orphaned container processes.

Signed-off-by: David Xia <dxia@spotify.com>
2015-05-20 14:20:46 -04:00
Alexander Morozov
53a795378d Merge pull request #13324 from duglin/BadRCOnVersion
Make version check return 400 instead of 404
2015-05-20 11:13:56 -07:00
Jana Radhakrishnan
afd901e408 Fix network connectivity problem for non-root users
If a container was started with a non-root user the container
may not be able to resolve DNS names because of too restrictive
permission in the /etc/resolv.conf container file. This problem
is in how this file gets created in libnetwork and ths PR
attempts to fix the issue by vendoring in the libnetwork code
with the fix.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-20 17:51:20 +00:00
Brian Goff
c6d9c904af Merge pull request #13356 from LK4D4/test_double_nethost
Test for two containers in --net=host
2015-05-20 13:17:16 -04:00
Jessie Frazelle
b0315e4472 Merge pull request #13354 from jacobat/comment-fix
Fix wording in comment
2015-05-20 09:44:23 -07:00
Alexander Morozov
7e5902c92d Test for two containers in --net=host
This is test for regression which was encountered during libnetwork
merging.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-20 09:35:28 -07:00
Jacob Atzen
007269ba24 Fix wording in comment
Signed-off-by: Jacob Atzen <jatzen@gmail.com>
2015-05-20 18:03:46 +02:00
John Howard
8228ee4b0f Windows: Archive package changes for Windows daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:55:54 -07:00
John Howard
8db09ff629 Windows: Empty Windows Exec Driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:54:04 -07:00
John Howard
4e8b2509fd Windows: graphdriver refactor
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-20 08:51:27 -07:00
Jessie Frazelle
c696993452 Merge pull request #13347 from fntlnz/13184-remove-delete-container
Removed deleteContainer calls
2015-05-20 07:18:41 -07:00
Brian Goff
37e4d40228 Merge pull request #13328 from icecrime/10662-registryfix-carry
Windows: fix registry filepath and location
2015-05-20 10:09:46 -04:00
Lorenzo Fontana
086b514f6a Removed deleteContainer calls
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-05-20 08:38:23 +02:00
Sven Dowideit
a09dfbcaad Merge pull request #13214 from zoechi/master
add bwu_docker
2015-05-20 13:43:16 +10:00
Sven Dowideit
a057accb59 Merge pull request #13315 from SvenDowideit/add-kitematic-docs
Add Kitematic documentation to docs.master.docker.com
2015-05-20 12:27:33 +10:00
Sven Dowideit
82bd3886d5 Add Kitematic documentation to docs.master.docker.com
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-20 01:57:45 +00:00
Jessie Frazelle
d29dc0b608 Merge pull request #13325 from LK4D4/cleanup_mounts
Fix Put without Get in overlay
2015-05-20 03:11:58 +02:00
Arnaud Porterie
496bc46c88 Merge pull request #13060 from mrjana/cnm_integ
Replace existing docker networking code and integrate with libnetwork
2015-05-19 17:24:18 -07:00
Jana Radhakrishnan
f12f51b8b9 Removed dead code from docker after libnetwork integration
As part of this some generic packages like iptables, etchosts and resolvconf
have also been moved to libnetwork. Even though they can still be
consumed in a generic fashion they will reside and be maintained
from within the libnetwork project.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:55 +00:00
Jana Radhakrishnan
d18919e304 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:19 +00:00
Jana Radhakrishnan
272f8cd4bc Vendoring in libnetwork, netns, netlink
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:18 +00:00
David Calavera
322f675123 Merge pull request #13332 from LK4D4/fix_race_in_rand
Use goroutine-safe version of rand.Source
2015-05-19 14:20:33 -07:00
Jessie Frazelle
92c869cd12 Merge pull request #12437 from fmzhen/remove-regex-replace
Removal of the regex to replace ips
2015-05-19 22:59:17 +02:00
Fred Lifton
4a743c39dd Merge pull request #13119 from psankar/master
Followup commit to https://github.com/docker/docker/pull/12986
2015-05-19 13:14:20 -07:00
Alexander Morozov
d8661250e7 Use goroutine-safe version of rand.Source
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-19 12:32:40 -07:00
Doug Davis
7fcf849749 Make version check return 400 instead of 404
Closes: #13321

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-19 11:21:05 -07:00
Arnaud Porterie
81e7d3571b Windows: fix registry filepath and location
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-19 10:58:45 -07:00
Arnaud Porterie
0cc5da0635 Merge pull request #12884 from Microsoft/10662-startcontainerrefactor
Windows: Refactor container
2015-05-19 10:44:23 -07:00
Arnaud Porterie
a16b2ab274 Merge pull request #13265 from tiborvass/refactor-v1-auth
registry: Refactor requestfactory to use http.RoundTrippers
2015-05-19 09:57:34 -07:00
Tianon Gravi
c64466fb68 Fix "squeeze" detection in contrib/mkimage/debootstrap
This stops us from erroneously adding "squeeze-lts" to "oldstable" which is now "wheezy", not "squeeze" (but "oldoldstable" _is_ squeeze, hence the new check on `/etc/debian_version` being `6.*` instead, and done as a `case` for the eventual addition of `wheezy-lts`, etc).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-19 09:38:27 -07:00
Alexander Morozov
ea4f43c2fa Merge pull request #13258 from unclejack/fix_build_network
builder/internals: set up network as bridge
2015-05-19 09:36:03 -07:00
Alexander Morozov
3916561619 Fix Put without Get in overlay
It is called for example on daemon start after crash

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-19 09:32:23 -07:00
moxiegirl
6f4b808f41 Merge pull request #13238 from hqhq/hq_fix_usingdocker_md
Remove wrong usage in usingdocker.md
2015-05-19 09:24:31 -07:00
Alexander Morozov
29595fd944 Merge pull request #13311 from WeiZhang555/cleanup
clean some redundant else clauses
2015-05-19 07:57:52 -07:00
Qiang Huang
f46cf73295 Remove wrong usage in usingdocker.md
Fixes: https://github.com/docker/docker/issues/13235

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-19 13:07:41 +08:00
Tibor Vass
73823e5e56 Add transport package to support CancelRequest
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-18 23:31:42 -04:00
Zhang Wei
d91ae65280 clean some redundant else clauses
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-05-19 10:54:04 +08:00
Mingzhen Feng
3ab7ceb5d7 Removal of the regex to replace ips
Signed-off-by: Mingzhen Feng <fmzhen@zju.edu.cn>
2015-05-19 10:15:18 +08:00
Tibor Vass
cf8c0d0f56 requestdecorator: repurpose the package and rename to useragent
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-18 21:51:54 -04:00
Tibor Vass
a01cc3ca77 registry: Refactor requestfactory to use http.RoundTrippers
This patch removes the need for requestFactories and decorators
by implementing http.RoundTripper transports instead.

It refactors some challenging-to-read code.

NewSession now takes an *http.Client that can already have a
custom Transport, it will add its own auth transport by wrapping
it.

The idea is that callers of http.Client should not bother
setting custom headers for every handler but instead it should
be transparent to the callers of a same context.

This patch is needed for future refactorings of registry,
namely refactoring of the v1 client code.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-18 21:51:53 -04:00
Doug Davis
472538bee0 Merge pull request #13219 from brahmaroutu/gccgo_compile_issue
fix to gccgo compilation error
2015-05-18 20:43:47 -04:00
moxiegirl
6a18412d5b Merge pull request #13189 from alvinr/mongodb-fixup
Fixup MongoDB changes to line up with MongoDB 3.0 release
2015-05-18 15:22:41 -07:00
Doug Davis
dfc329d76a Merge pull request #13308 from lightsofapollo/issue-13307
Increase default connection timeout to 30s
2015-05-18 18:01:00 -04:00
James Lal
f5e6f50a1e Increase default connection timeout to 30s
Closes #13307
Signed-off-by: James Lal <jlal@mozilla.com>
2015-05-18 13:26:33 -07:00
Alvin Richards
3f37afe0b9 Bring MongoDB examples up to date with 3.0 release
Signed-off-by: Alvin Richards <alvin.richards@docker.com>
2015-05-18 13:08:31 -07:00
Michael Crosby
aac645ae04 Merge pull request #13282 from duglin/RemoveBash
Remove use of 'bash' from our tests
2015-05-18 13:06:21 -07:00
Brian Goff
ccf02a9f77 Merge pull request #13279 from hqhq/hq_use_inspectfield
Use inspectField to simplify code
2015-05-18 14:53:37 -04:00
Michael Crosby
785ba790fb Merge pull request #13204 from chenhanxiao/gitignore
gitignore: add *.rej
2015-05-18 11:51:06 -07:00
Tianon Gravi
0c375a779a Merge pull request #13244 from hqhq/hq_update_vendor_pty
kr/pty: vendor upstream 5cf931ef8f
2015-05-18 11:46:43 -07:00
Brian Goff
3b69ca5b97 Merge pull request #13277 from runcom/restartpolicy-methods
RestartPolicy methods instead of strings checking
2015-05-18 14:36:54 -04:00
Michael Crosby
70e9e4bf9f Merge pull request #13249 from coolljt0725/fix_incorrect_document_of_storage_opt
Fix incorrect document storage-opt
2015-05-18 11:35:01 -07:00
Doug Davis
3b1f73fbcd Remove use of 'bash' from our tests
Not 100% sure why our Windows test don't complain about some of these,
I'm guessing it because we have bash as part of some git package, but
either way we really shouldn't require bash to run our tests unless we
really need to - which in these cases we don't

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-18 11:29:08 -07:00
Michael Crosby
fc4f3e5650 Merge pull request #13295 from aimxhaisse/13294-mflag-panic
Fix panic when using default-initialized FlagSet
2015-05-18 11:27:12 -07:00
Sebastiaan van Stijn
93825056d8 Merge pull request #13206 from draghuram/info_api_doc
Bring /info API doc in line with the actual response.
2015-05-18 20:20:57 +02:00
James Turnbull
8f8ee7d5c3 Merge pull request #12804 from ankushagarwal/configuring-docker
Add CentOS/RHEL configuration to the config article
2015-05-18 14:18:32 -04:00
Michael Crosby
aca4ae8c90 Merge pull request #13280 from runcom/test-clean-from-inspect
Clean tests from not needed inspect call
2015-05-18 11:06:18 -07:00
Michael Crosby
cbc122e8a7 Merge pull request #13306 from ahmetalpbalkan/logopts-context
Pass --log-opts map to logdrivers
2015-05-18 10:58:17 -07:00
Raghuram Devarakonda
9c0608565c Bring /info API doc in line with the actual response.
The fix handles versions 1.18 and 1.19.

Closes #13139.

Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-05-18 13:55:42 -04:00
Ahmet Alp Balkan
8b11592d69 Pass -log-opts map to logdrivers
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-18 16:50:14 +00:00
Brian Goff
19ae59f910 Merge pull request #13283 from Microsoft/10662-fixbaselinenewdriver
Windows: NewDriver() re-baseline parms
2015-05-18 10:56:06 -04:00
s. rannou
e94bab8278 Fix panic when using default-initialized FlagSet
Closes #13294

Signed-off-by: Sebastien Rannou <mxs@sbrk.org>
2015-05-18 11:55:38 +02:00
Nuutti Kotivuori
642e6a3773 Prevent fallback to v1 registry for digest pulls
The intention of the user is to download a verified image if explicitly
pulling with a digest and falling back to v1 registry circumvents that
protection.

Signed-off-by: Nuutti Kotivuori <naked@iki.fi>
2015-05-18 08:26:26 +03:00
Qiang Huang
74f8a4eca4 Use inspectField to simplify code
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-18 10:06:13 +08:00
Alexander Morozov
9c5635a2a0 Merge pull request #13284 from Microsoft/10662-compileconfigwindows
Windows: Simple import error on config_windows.go
2015-05-17 08:59:00 -07:00
Sam Abed
79f704490c Use port 80 for Dockerfile gpg
Signed-off-by: Sam Abed <sam.abed@gmail.com>
2015-05-17 13:22:21 +10:00
Brian Goff
692b7b911e Merge pull request #13271 from Microsoft/10662-nounixsocket
Windows: No unix_socket.go
2015-05-16 21:34:15 -04:00
Jessie Frazelle
48b4229cb4 Merge pull request #13239 from Microsoft/10662-hack
Make which cross binary fails clearer
2015-05-17 01:09:36 +03:00
John Howard
b9e4b95788 Windows: Refactor container
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-16 12:38:20 -07:00
John Howard
dfddfa6bb8 Windows: Simple import error on config_windows.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-16 12:18:55 -07:00
John Howard
50b4079b5f Windows: NewDriver() re-baseline parms
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-16 11:38:19 -07:00
Sebastiaan van Stijn
a9172f572e Merge pull request #13281 from mavenugo/plugin_typo
Fixing a Typo in plugins mime-type
2015-05-16 19:52:57 +02:00
Antonio Murdaca
a268e36719 Clean tests from not needed inspect call
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 18:12:54 +02:00
Alexander Morozov
b5e932a3bf Merge pull request #13237 from ahmetalpbalkan/tag/event
Introduce daemon event 'tag' upon image tagging
2015-05-16 09:05:03 -07:00
Madhu Venugopal
215a5ebdb6 Fixing a Typo in plugins mime-type
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-16 08:49:23 -07:00
Antonio Murdaca
624bf81fdb Add RestartPolicy methods instead of using strings checking
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 14:15:28 +02:00
Antonio Murdaca
42cfc95549 Merge pull request #13273 from HuKeping/remove-deadcode
Cleanup dead code of integration-cli/utils.go
2015-05-16 14:03:42 +02:00
Hu Keping
35b4ed4d17 Remove dead code of integration-cli/utils.go
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-16 16:49:55 +08:00
Michael Crosby
115b11ae69 Merge pull request #13222 from calavera/plugins_infra
Remote plugins plumbing.
2015-05-15 16:37:55 -07:00
John Howard
6c187b8b4b Windows: No unix_socket.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-15 15:49:02 -07:00
Madhu Venugopal
ba3bcf0537 Allow to call back when a plugin is loaded.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-15 13:50:44 -07:00
Ahmet Alp Balkan
1630ed97ac Introduce daemon event 'tag' upon image tagging
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-15 20:21:59 +00:00
unclejack
d6a545a989 builder/internals: set up network as bridge
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-15 22:58:21 +03:00
Alexander Morozov
27b77464d8 Merge pull request #13232 from Microsoft/10662-zfs
Windows: No ZFS graphdriver
2015-05-15 11:51:48 -07:00
Alexander Morozov
0db7365c66 Merge pull request #13221 from duglin/ReenableDebug
add link between -D and --log-level=debug back in
2015-05-15 11:45:44 -07:00
David Calavera
b785e5091f Merge pull request #13086 from shishir-a412ed/docker_root_execdriver
root dir for execdriver (/var/run/docker) should be configurable
2015-05-15 11:16:12 -07:00
Alexander Morozov
88127ce475 Merge pull request #13246 from unclejack/refactor_statscollector
daemon/stats_collector: refactor getSystemCpuUsage
2015-05-15 11:06:47 -07:00
David Calavera
839d64ffb1 Remote plugins plumbing.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-15 11:04:58 -07:00
Michael Crosby
520955b1cf Merge pull request #13236 from vieux/revert_time_change
Revert "Fix inconsistent date formats in API"
2015-05-15 10:32:03 -07:00
John Howard
0bdeef94c7 Make which cross binary fails clearer
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-15 09:25:13 -07:00
Alexander Morozov
5d2ef30a38 Merge pull request #13251 from cpuguy83/13233_fix_log_follow_goroutine_check
Extend sleep/timeout for ngoroutine check
2015-05-15 08:57:25 -07:00
Brian Goff
248e5a4c83 Merge pull request #13220 from Microsoft/10662-sysinfo
Windows: Refactor sysinfo for compilation
2015-05-15 10:53:55 -04:00
Brian Goff
2c8eba14df Merge pull request #13243 from coolljt0725/remove_redundant_log
Cleanup:Remove redundant log in pkg/pidfile/pidfile.go
2015-05-15 10:13:19 -04:00
Brian Goff
f207322c0a Extend sleep/timeout for ngoroutine check
In cases where this is failing it's ok to have the test take extra time,
but we don't want it to fail because of some race/performance
differences between systems.
So make the timeout go to 30s and double the sleep time in between
checks so it's not pounding the daemon quite so fast.

Originally I couldn't make this test fail (pre-change), but changed
graphdrivers and saw a failure pretty quickly.
This change seems to smooth that out.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-15 09:54:43 -04:00
Shishir Mahajan
8b2c6cb072 root dir for execdriver (/var/run/docker) should be configurable
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-05-15 09:30:36 -04:00
Lei Jitang
0204ecdf70 Fix incorrect document storage-opt
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-15 19:13:07 +08:00
unclejack
25f776451e daemon/stats_collector: refactor getSystemCpuUsage
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-15 12:22:50 +03:00
Lei Jitang
60e5c273cf Remove redundant log in pkg/pidfile/pidfile.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-15 15:26:00 +08:00
Qiang Huang
478d86a5f5 kr/pty: vendor upstream 5cf931ef8f
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-15 15:22:16 +08:00
Qiang Huang
6e19912df9 Enhance check-config.sh
Currently check-config.sh just said enable or missing, when I used
a fresh kernel, made check-config.sh happy, still can't start
container. It take me days debuging kernel and Docker and finally
found it's because I enabled some CONFIGs as modules and never
loaded these modules.

So I think it's necessary to let check-config.sh told users which
configs are enabled as modules.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-15 10:20:31 +08:00
Victor Vieux
b261ce5fb0 Revert "Fix inconsistent date formats in API"
This reverts commit 945fc9d882.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-14 17:31:45 -07:00
David Calavera
e4855eebf2 Merge pull request #13188 from ahmetalpbalkan/inputs-standard-rfc3339
Parse input timestamps with standard RFC3339
2015-05-14 16:49:01 -07:00
John Howard
35cdcbb323 Windows: No ZFS graphdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-14 15:57:45 -07:00
Tibor Vass
c5240d79e3 Merge pull request #12770 from Microsoft/10662-daemonconfigrefactor
Windows: Start of daemon config refactor
2015-05-14 14:55:22 -07:00
Brian Goff
a4592467e7 Merge pull request #13223 from Microsoft/10662-loggers
Windows: Factor out syslog and journald
2015-05-14 16:26:43 -04:00
Alexander Morozov
b2ad9314a2 Merge pull request #13196 from crosbymichael/update-libocntainer-may13
Update libcontainer to a37b2a4f152e2a1c9de596f54c0
2015-05-14 10:49:25 -07:00
John Howard
655a58e27b Windows: Factor out syslog and journald
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-14 10:34:09 -07:00
Doug Davis
a85ca8b7c4 add link between -D and --log-level=debug back in
Due to popular demand :-)
See #11965

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-14 10:29:49 -07:00
John Howard
b7ee717a10 Windows: Refactor sysinfo for compilation
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-14 09:44:51 -07:00
vagrant
d2a2c974d9 fix to gccgo compilation error
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-05-14 16:28:23 +00:00
Alexander Morozov
fe6f77df2c Merge pull request #13087 from duglin/FixNatTest
Fix random errors in DockerSuite.TestNetworkNat
2015-05-14 08:35:27 -07:00
Brian Goff
ac81cd1fc3 Merge pull request #13202 from duglin/ImportFix
Fix a regression in `docker import` on error from URL
2015-05-14 10:36:50 -04:00
Doug Davis
1c5a4728e1 Merge pull request #13208 from ahmetalpbalkan/nit
Remove out of date comment
2015-05-14 06:59:21 -07:00
Doug Davis
3f4926e49b Fix a regression in docker import on error from URL
when the daemon can't download the image from a `docker import` the
error message was lost due to 'err' being redefined with a block by
mistake.  This removes the ":" from "... err := " which fixes it.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-14 06:56:52 -07:00
Günter Zöchbauer
ef956253d8 Add bwu_docker to the list.
Signed-off-by: Guenter Zoechbauer <guenter@gzoechbauer.com>
2015-05-14 15:27:51 +02:00
Ahmet Alp Balkan
999f464feb Parse input timestamps with standard RFC3339
Fix for #13175.

This change allows user-input timestamps (e.g. to `docker events
--since/--until`  or `docker logs --since` to be parsed using
standard RFC3339Nano layout in Go instead of the layout that parses
all timestamps into fixed-length strings (currently buggy).

User inputs need not to be complying to the internal format
(`RFC3339NanoFixed`) anyway.

Added test case for `events --since/--until` with all possible
timestamp input formats.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-14 07:44:42 +00:00
Ahmet Alp Balkan
9448d3627b Remove out of date comment
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-14 07:37:31 +00:00
Ankush Agarwal
9bfe6f0d24 Update Configuring and running Docker article
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-05-14 07:45:20 +02:00
Sankar சங்கர்
cb4d47ddb3 Copied info about google groups, IRC, etc. to README.md from CONTRIBUTORS.md
Signed-off-by: Sankar சங்கர்  <sankar.curiosity@gmail.com>
2015-05-14 11:12:20 +05:30
Sebastiaan van Stijn
1d57642906 Merge pull request #11706 from HuKeping/time
Fix inconsistent date formats in API
2015-05-13 20:23:19 -07:00
Hu Keping
945fc9d882 Fix inconsistent date formats in API
Prior to this patch, the response of
- GET /images/json
- GET /containers/json
- GET /images/(name)/history

display the Created Time as UNIX format which doesn't make sense.

These should be more readable as CLI command `docker inspect` shows.

Due to the case that an older client with a newer version daemon, we
need the version check for now.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-14 18:58:55 +08:00
Chen Hanxiao
3957cc8022 gitignore: add *.rej
Ignore noise from unsuccessful patch operation.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-05-13 22:10:26 -04:00
Sebastiaan van Stijn
ed25742002 Merge pull request #12667 from ibuildthecloud/host-uts
Add --uts=host to allow sharing the UTS namespace
2015-05-13 18:30:32 -07:00
Darren Shepherd
f2e5207fc9 Add --uts=host to allow sharing the UTS namespace
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-13 17:56:32 -07:00
Brian Goff
f2bc54f796 Merge pull request #13201 from Microsoft/10662-fixdebugtrap
Fix package on debugtrap_unsupported.go
2015-05-13 20:44:13 -04:00
Brian Goff
feb0fa8dbf Merge pull request #13112 from hqhq/hq_fix_oonkilldisable
Fix oom kill disable issue
2015-05-13 20:03:33 -04:00
John Howard
1e78eec826 Fix package on debugtrap_unsupported.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-13 16:38:59 -07:00
Antonio Murdaca
b37abf2528 Merge pull request #13146 from rajdeepd/dry-run-test-1
Modified Test Case to include check for Memory and MemorySwap
2015-05-14 01:10:35 +02:00
Alexander Morozov
64ea54c0ed Merge pull request #13154 from coolljt0725/typo_remove_redundant_dot
Minor typo: remove redundant dot in error message in runconfig/parse.go
2015-05-13 15:24:01 -07:00
Michael Crosby
677d76cd4a Update test for /sys mounting
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-13 15:02:53 -07:00
moxiegirl
32f8a40398 Merge pull request #13193 from moxiegirl/dhe-commercial-release
adding release note for 1.6.2
2015-05-13 14:51:50 -07:00
Alexander Morozov
31c8112285 Merge pull request #13194 from crosbymichael/merge_release_v1.6.2
Merge release 1.6.2
2015-05-13 14:01:40 -07:00
Michael Crosby
87c35d0e0a Update libcontainer to a37b2a4f152e2a1c9de596f54c0
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-13 13:55:26 -07:00
Mary Anthony
6c17b4818d adding release note for 1.6.2
Signed-off-by: Mary Anthony <mary@docker.com>

ugh, cut n paste

Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-13 13:54:30 -07:00
Michael Crosby
cec64ebef8 Bump to version 1.6.2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	VERSION
2015-05-13 13:51:39 -07:00
Michael Crosby
9cee8c4ed0 Merge pull request #13133 from crosbymichael/bump_v1.6.2
Bump to version v1.6.2
2015-05-13 13:46:56 -07:00
Harald Albers
db5b4a2a69 respect -H in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2015-05-13 13:39:25 -07:00
Rajdeep Dua
1eea2c589d Modified Test Case to include check for Memory and MemorySwap
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
2015-05-13 13:39:07 -07:00
Alexander Morozov
877461bc20 Merge pull request #13190 from unclejack/precompile_regexp
Precompile regexp
2015-05-13 13:00:14 -07:00
David Calavera
3da0013ac4 Merge pull request #13155 from coolljt0725/fix_validate_tag_name
Fix validate tag name. Fix #13149
2015-05-13 12:03:22 -07:00
Michael Crosby
c46c8f4e40 Merge pull request #13192 from tianon/fix-bad-vendor.sh-rebase
Fix mangled hack/vendor.sh rebase
2015-05-13 12:02:07 -07:00
Tianon Gravi
c2d6187811 Fix mangled hack/vendor.sh rebase
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-13 12:52:59 -06:00
unclejack
cb08c1173f pkg/stringid: precompile regexp
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-13 21:48:48 +03:00
unclejack
8f57e7d2ef image: precompile regexp
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-13 21:47:43 +03:00
Alexander Morozov
1b678f86b3 Merge pull request #13174 from ahmetalpbalkan/TestLogsSince
integ-cli: Fix race in TestLogsSince
2015-05-13 11:35:17 -07:00
Jessie Frazelle
ebe9a85486 Merge pull request #13183 from runcom/fix-typo-tests-grouping
Fix typo to run tests grouped by RunUnprivileged
2015-05-13 11:33:14 -07:00
David Calavera
951c2ef2c9 Merge pull request #12226 from ahmetalpbalkan/logdrivers/refactoring
daemon: Logging drivers architectural refactoring
2015-05-13 11:00:50 -07:00
Brian Goff
8eac7d0779 Merge pull request #13180 from unclejack/fix_test_name
integcli: change Dettach to Detach
2015-05-13 09:07:18 -04:00
Antonio Murdaca
a36f6a140b Fix typo to run tests grouped by RunUnprivileged
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-13 14:24:54 +02:00
unclejack
fdec5197f1 integcli: change Dettach to Detach
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-05-13 12:49:19 +03:00
Lei Jitang
e00cfbb6f2 Fix invalid tag name
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-13 14:28:52 +08:00
Antonio Murdaca
3401ee13f8 Merge pull request #13169 from jfrazelle/cleanup-integration
cleanup test-integration
2015-05-13 06:34:30 +02:00
Antonio Murdaca
56847ec4d4 Merge pull request #13106 from duglin/HumanizeCliErrors
Use stderr instead of logrus for CLI error messages
2015-05-13 05:23:56 +02:00
Lei Jitang
c6dad07b1b Minor typo: remove redundant dot in error message in runconfig/parse.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-13 11:04:07 +08:00
Ahmet Alp Balkan
2fe2f7a186 integ-cli: Fix race in TestLogsSince
TestLogsSince used to rely on time synchronization and precision of
the timestamps. This change provides a less flaky alternative.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-13 02:59:11 +00:00
Jessie Frazelle
36d995a291 Merge pull request #11965 from duglin/DEBUG
Remove use of "DEBUG" env var from CLI and de-couple -D from --log-level
2015-05-12 18:24:04 -07:00
Tibor Vass
3985f17812 Merge pull request #13131 from Microsoft/10662-loadonwindows
Windows: Build load.go
2015-05-12 18:04:33 -07:00
Brian Goff
ec4baad954 Merge pull request #13166 from runcom/small-streamformatter-refactor
Refactor pkg/stremformatter - custom constructors
2015-05-12 20:28:18 -04:00
Doug Davis
0024935f64 Use stderr instead of logrus for CLI error messages
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-12 17:22:41 -07:00
Jessie Frazelle
df89008f0c Merge pull request #13099 from Microsoft/10662-pkgparsers
Windows: Implement parsers:kernel+os
2015-05-12 16:07:43 -07:00
Jessica Frazelle
e096d56713 cleanup test-integration
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-12 15:39:57 -07:00
Antonio Murdaca
6b700bdaca Refactor pkg/stremformatter with custom constructors instead of passing a boolean
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-13 00:09:41 +02:00
John Howard
f7ae2a372d Windows: Impl pkg\parsers kernel+os
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-12 14:41:02 -07:00
John Howard
aed8f9f76e Windows: Build load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-12 14:26:57 -07:00
Jessie Frazelle
37cb2a15bf Merge pull request #13040 from cpuguy83/13014_fix_goroutine_leak_on_logs_follow
Make sure log pipes are closed
2015-05-12 13:52:49 -07:00
Michael Crosby
cb53a628b0 Merge pull request #13136 from Microsoft/10662-factoroutresolveconf
Windows: Don't pull in all of resolvconf
2015-05-12 13:49:47 -07:00
Michael Crosby
e0777e69cb Merge pull request #13162 from jfrazelle/add-modprobe-br_netfilter
modprobe br_netfilter
2015-05-12 13:46:34 -07:00
Alexander Morozov
f35038dfba Merge pull request #13160 from runcom/remove-api-codepath-less-than-1-12
Remove API codepaths < 1.12
2015-05-12 13:08:36 -07:00
Ahmet Alp Balkan
3a8728b431 daemon: Logging drivers refactoring
- noplog driver pkg for '--log-driver=none' (null object pattern)
- centralized factory for log drivers (instead of case/switch)
- logging drivers registers themselves to factory upon import
  (easy plug/unplug of drivers in daemon/logdrivers.go)
- daemon now doesn't start with an invalid log driver
- Name() method of loggers is actually now their cli names (made it useful)
- generalized Read() logic, made it unsupported except json-file (preserves
  existing behavior)

Spotted some duplication code around processing of legacy json-file
format, didn't touch that and refactored in both places.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-12 19:11:52 +00:00
Jessie Frazelle
b0518fe038 Merge pull request #12847 from cpuguy83/fix_firewald_errors
Fix error message on firewalld init
2015-05-12 12:01:59 -07:00
Jessica Frazelle
4800d4df8c this fixes hairpin nat tryinng to ping a the host and port from inside a container
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-12 11:57:36 -07:00
Jessie Frazelle
73387bf15a Merge pull request #13105 from duglin/FixRunOutput
Fix RUN err msg (again)
2015-05-12 11:36:55 -07:00
Jessie Frazelle
5bf2ebf0a5 Merge pull request #13127 from shishir-a412ed/exec_opt_doc
Missing exec-opt[] option in CommandLine docs
2015-05-12 11:34:51 -07:00
Antonio Murdaca
7284b08204 Remove API codepaths < 1.12
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-12 20:09:49 +02:00
Jessie Frazelle
d4eba30065 Merge pull request #13141 from vieux/fallback_inspect
fallback to interface with docker inspect
2015-05-12 11:02:06 -07:00
Alexander Morozov
445afe0977 Merge pull request #13151 from Mic92/master
zfs: update filesystem cache on filesystem creation/deletion
2015-05-12 10:53:01 -07:00
Brian Goff
e3ba3dd5b8 Make sure log pipes are closed
Pipes are still not closed (and goroutines leaked) if neither pipe is
used.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-12 13:50:51 -04:00
Alexander Morozov
c9821d8dd6 Merge pull request #13150 from hqhq/hq_remove_warn
Remove redundant warning
2015-05-12 10:32:01 -07:00
Alexander Morozov
3b13e56fd7 Merge pull request #13000 from runcom/refactor-server-to-use-daemon-service-followup
Refactor server to use the daemon as a service
2015-05-12 10:27:43 -07:00
John Howard
b3bca3afc9 Windows: Start of daemon config refactor
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-12 09:50:32 -07:00
Sebastiaan van Stijn
d0459abe6e Merge pull request #12362 from ahmetalpbalkan/logs/since
Add --since argument to docker logs cmd
2015-05-12 09:40:16 -04:00
Jörg Thalheim
2cb23527e4 zfs: update filesystem cache on filesystem creation/deletion
Previously the cache was only updated once on startup, because the graph
code only check for filesystems on startup. However this breaks the API as it
was supposed and so unit tests.

Fixes #13142

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-12 13:06:41 +02:00
Qiang Huang
a8250a0b20 Remove redundant warning
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-12 18:02:30 +08:00
Sebastiaan van Stijn
a5007e5737 Merge pull request #10786 from estesp/add-goroutine-debug
Add capability for goroutine dumping on SIGQUIT/USR1
2015-05-11 21:20:44 -04:00
Victor Vieux
52c3bb6a0e fallback to interface with docker inspect
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-11 17:39:21 -07:00
Phil Estes
95fcf76cc6 Add SIGUSR1 handler for dumping stack/goroutine traces
Add handler for SIGUSR1 based on feedback regarding when to dump
goroutine stacks.  This will also dump goroutine stack traces on SIGQUIT
followed by a hard-exit from the daemon.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-05-12 10:09:23 +10:00
Tibor Vass
e7568ed227 Merge pull request #9411 from Mic92/features/zfs-rebased
zfs-utils based zfs graph driver
2015-05-11 16:53:17 -07:00
Sven Dowideit
c49695f976 Merge pull request #13137 from SvenDowideit/need-more-sudo
Need more sudo
2015-05-12 09:07:55 +10:00
Sven Dowideit
c5e93d0950 Need more sudo
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-11 23:07:22 +00:00
John Howard
78604a9f3f Windows: Don't pull in all of resolvconf
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-11 15:28:08 -07:00
Michael Crosby
7c8fca2ddb Bump to version 1.6.2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-11 15:05:16 -07:00
Michael Crosby
376188dcd3 Update libcontainer to 227771c8f611f03639f0ee
This fixes regressions for docker containers mounting into
/sys/fs/cgroup.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-11 15:05:07 -07:00
Sven Dowideit
34b9769538 Merge pull request #13134 from SvenDowideit/dhe-1.0.1-release
DHE 1.0.1 release
2015-05-12 07:34:30 +10:00
Sven Dowideit
38af208da1 DHE 1.0.1 release
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-11 21:23:56 +00:00
Jessie Frazelle
a47fb5edca Merge pull request #13132 from LK4D4/fix_race_kill
Fix race between execdriver.Kill and execdriver.Run
2015-05-11 14:01:07 -07:00
Alexander Morozov
ca7219f5da Fix race between execdriver.Kill and execdriver.Run
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-11 13:23:50 -07:00
Jessie Frazelle
8cc93856e3 Merge pull request #13074 from runcom/11824-short-link-if-equals-alias
Allow links to be specified with only the name if it matches the alias
2015-05-11 13:18:29 -07:00
Antonio Murdaca
c6e6223ed7 Allow links to be specified with only the name if this matches the alias
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-11 21:50:47 +02:00
Shishir Mahajan
98277f3cad Missing exec-opt[] option in CommandLine docs
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-05-11 15:41:50 -04:00
Michael Crosby
e66ad40c4e Merge pull request #12994 from Microsoft/10662-fixinvocation
Windows: Fix builder\dispatchers.go
2015-05-11 11:24:43 -07:00
Antonio Murdaca
e2acca67c8 Move container.WaitStop, AttachWithLogs and WsAttachWithLogs to daemon service in api server
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-11 19:56:41 +02:00
Alexander Morozov
5e063326a3 Merge pull request #13101 from bharaththiruveedula/13092-remove-unwanted-locks
Removing extra locks for Pause and Unpause functions
2015-05-11 10:54:39 -07:00
Jessie Frazelle
92344602ea Merge pull request #13091 from LK4D4/generate_caps
Generate caps
2015-05-11 10:42:59 -07:00
Ahmet Alp Balkan
cb9a6b9aed Add --since argument to docker logs cmd
Added --since argument to `docker logs` command. Accept unix
timestamps and shows logs only created after the specified date.

Default value is 0 and passing default value or not specifying
the value in the request causes parameter to be ignored (behavior
prior to this change).

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-10 20:42:14 +00:00
Sebastiaan van Stijn
4d6720bfbb Merge pull request #13111 from gianlucaborello/fix-mac-documentation
Correctly document MAC address generation
2015-05-10 13:43:27 -04:00
Alexander Morozov
13064646a6 Merge pull request #13102 from duglin/MissingOK
Add missing "ok" on "comma ok" idiom in test util
2015-05-10 09:22:44 -07:00
Gianluca Borello
e324f51e5b Default MAC address generation is not random and should be stated in the documentation.
Signed-off-by: Gianluca Borello <g.borello@gmail.com>
2015-05-10 08:11:26 -07:00
Qiang Huang
a2f39e7754 Fix oom kill disable issue
It should not be hard limit, we should only check oom kill disable
when user using it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-10 14:55:00 +08:00
Bharath Thiruveedula
8c1ef5ceaf Removing extra locks for Pause and Unpause functions
Signed-off-by: Bharath Thiruveedula <bharath_ves@hotmail.com>
2015-05-10 00:16:54 +05:30
Alexander Morozov
340fd140e6 Merge pull request #12988 from Mashimiao/remove-unused-container-functions
cleanup: remove unneeded locks
2015-05-09 09:42:27 -07:00
Alexander Morozov
c5710c7318 Merge pull request #13093 from tianon/writeflusher
Move WriteFlusher out of utils into ioutils
2015-05-09 09:39:17 -07:00
Alexander Morozov
61cb6012e6 Merge pull request #13095 from Microsoft/10662-pkgrexec
Windows: reexec pkg supported
2015-05-09 09:38:42 -07:00
Doug Davis
006c066b6c Fix RUN err msg (again)
Previous fix used %q which incorrectly go-escaped things. For example:

```
RUN echoo A \& B	C
```
would result in the user seeing:
```
INFO[0000] The command '/bin/sh -c echoo A \\& B\tC' returned a non-zero code: 127
```
Note the double-\ and the \t instead of a tab character

The testcase had to double escape things due to logrus getting in the way
but I'm going to fix that in another PR because its a change to the UX.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-09 09:22:30 -07:00
Doug Davis
dd4693f67c Add missing "ok" on "common ok" idiom in test util
w/o this the "ok" we're checking is from the previous type assertion.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-09 05:56:10 -07:00
Sebastiaan van Stijn
7699cee247 Merge pull request #12180 from Mashimiao/add-cpuperiod-and-cpuquota-support
add cpu.cfs_period_us  support
2015-05-08 22:32:09 -04:00
Ma Shimiao
bcc24ec8ad cleanup remove unneeded locks
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-05-09 10:06:53 +08:00
Ma Shimiao
dccb8b5c33 add cpu.cfs_period_us support
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-05-09 10:02:46 +08:00
John Howard
64715c4f33 Windows: reexec pkg supported
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-08 14:15:53 -07:00
Brian Goff
38b5c7266a Fix error message on firewalld init
If firewalld is not installed (or I suppose not running), firewalld was
producing an error in the daemon init logs, even though firewalld is not
required for iptables stuff to function.
The firewalld library code was also logging directly to logrus instead
of returning errors.

Moved logging code higher up in the stack and changed firewalld code to
return errors where appropriate.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-08 15:51:44 -04:00
John Howard
4d2f6fbde0 Windows: Fix builder\dispatchers.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-08 11:45:08 -07:00
Michael Crosby
3697dddc0d Merge pull request #12978 from Microsoft/10662-containerexeccreate
Windows: Split ContainerExecCreate
2015-05-08 11:38:03 -07:00
Tianon Gravi
223d6de728 Move WriteFlusher out of utils into ioutils
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-08 12:33:33 -06:00
Doug Davis
769df832a3 Fix random errors in DockerSuite.TestNetworkNat
I believe this was failing because 'nc' wouldn't show the data
it received sometimes. So intead of looking for that data we now
look for the output of the echo that comes after the nc command
successfully runs

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-08 10:59:26 -07:00
Alexander Morozov
a559c1145a Generate capabilityList automatically
Generation based on CAP_LAST_CAP, I hardcoded
capability.CAP_BLOCK_SUSPEND as last for systems which has no
/proc/sys/kernel/cap_last_cap

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-08 09:40:05 -07:00
Alexander Morozov
5a2d592c27 Update github.com/syndtr/gocapability to 66ef2aa7a23ba682594e2b6f74cf40c0692b49fb
It adds List function for listing all supported caps

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-08 09:22:37 -07:00
Jörg Thalheim
bad25ccf97 zfs: retrieve all filesystems on startup at once
The docker graph call driver.Exists() on initialisation for each filesystem in
the graph. This results will results in a lot `zfs get all` commands. To reduce
this, retrieve all descend filesystem at startup and cache it for later checks

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:49:39 +02:00
Jörg Thalheim
11e9167a6b zfs: improve performance by using legacy mounts
instead of let zfs automaticly mount datasets, mount them on demand using mount(2).
This speed up this graph driver in 2 ways:
- less zfs processes needed to start a container
- /proc/mounts get smaller, so zfs userspace tools has less to read (which can
  a significant amount of data as the number of layer grows)

This ways it can be also ensured that the correct mountpoint is always used.

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:49:39 +02:00
Jörg Thalheim
ee00f07ea6 zfs: replace c for /proc/mounts parsing with go
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:49:39 +02:00
Jörg Thalheim
30f3bd643d integration: add variable to set storage options for testing
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:49:39 +02:00
Jörg Thalheim
dd614b5e34 zfs: refactor error handling
thanks to @calavera

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:48:20 +02:00
Jörg Thalheim
a25195d86c zfs: add myself to MAINTAINERS
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:48:20 +02:00
Jörg Thalheim
bdf784ae4a docs: move zfs.fsname option to storage option section
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:48:20 +02:00
Jörg Thalheim
bacecabf3b zfs: revert to NaiveGraphDriver for the moment
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:48:20 +02:00
Jörg Thalheim
d5151ca8ab Implement Docker on ZFS
Signed-off-by: Arthur Gautier <baloo@gandi.net>
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-05-08 17:48:20 +02:00
Alexander Morozov
23abd51ef1 Merge pull request #13071 from tianon/explicit-vendor
Update "hack/vendor.sh" to be more explicit
2015-05-08 08:22:17 -07:00
Brian Goff
af9dac9627 Merge pull request #13069 from runcom/dry-run-test
API tests - Container create with Hostname, Domainname and Network
2015-05-07 22:07:41 -04:00
Jessie Frazelle
fe3becee34 Merge pull request #12422 from wlan0/logopts
add log opts flag to pass in logging options
2015-05-07 18:10:04 -07:00
Michael Crosby
b94107c4d8 Merge pull request #13080 from jfrazelle/fix-tests-where-requires-libcontainerr-security
fix lxc because it doesnt have the hardened libcontainer stuff
2015-05-07 18:07:27 -07:00
Jessie Frazelle
128a07b512 Merge pull request #13027 from runcom/fix-typo-reference-remote-api
Fix typo in the api remote reference for links
2015-05-07 17:53:21 -07:00
Jessica Frazelle
52118df432 fix lxc because it doesnt have the hardened libcontainer stuff
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-07 17:40:37 -07:00
Jessie Frazelle
47fbe76a7e Merge pull request #13077 from duglin/MoveCommands
Make list of commands for help less static
2015-05-07 17:35:54 -07:00
Jessie Frazelle
6b6a26c769 Merge pull request #11516 from coolljt0725/add_show_error_set_some_flag_in_container_netmode
add support --net=container with --mac-address, --add-host error out
2015-05-07 17:13:32 -07:00
Jessie Frazelle
de32f5c431 Merge pull request #11802 from hqhq/hq_add_blkio_weight
add blkio.weight support
2015-05-07 17:10:39 -07:00
Jessie Frazelle
982402f4e0 Merge pull request #11831 from cellpjs/patch-1
Remove mkimage-unittest.sh
2015-05-07 17:07:56 -07:00
Jessie Frazelle
e03ac8d5b9 Merge pull request #12175 from dqminh/fix-allocate-port
#12148: sort ports mapping before allocating
2015-05-07 17:04:20 -07:00
Jessie Frazelle
f6fa579d52 Merge pull request #12270 from burnison/11294-shortidfallback
Only use fallback to short IDs when obvious.
2015-05-07 17:02:58 -07:00
Jessie Frazelle
d0bc0153c6 Merge pull request #12278 from duglin/12267-Wildcards
Fix for Daemon crashing when wildcards are used for COPY/ADD
2015-05-07 17:01:16 -07:00
Jessie Frazelle
d0cbaeb0d2 Merge pull request #12318 from aarondav/best-effort-iptables-lock
Do our best not to invoke iptables concurrently if --wait is unsupported
2015-05-07 17:00:26 -07:00
Jessie Frazelle
67c10e762e Merge pull request #12830 from Microsoft/10662-refactorforwindowsexecdriver
Windows: Fork execdrivers.go for Windows execdriver
2015-05-07 16:57:59 -07:00
Jessie Frazelle
0ed2013590 Merge pull request #12952 from sunyuan3/trunc
Verify the no-trunc option for the search operation
2015-05-07 16:52:46 -07:00
Jessie Frazelle
372977148d Merge pull request #12961 from hqhq/hq_remove_err_out
a few cleanups for client output
2015-05-07 16:51:56 -07:00
Jessie Frazelle
6a4c219615 Merge pull request #12970 from tianon/frozen-user-images
Allow download-frozen-image.sh to work on user images too
2015-05-07 16:50:49 -07:00
Jessie Frazelle
d34abea15b Merge pull request #12976 from Microsoft/10662-graphfirstchange
Windows: First fix for graph\graph.go
2015-05-07 16:50:20 -07:00
Jessie Frazelle
b1572fd0a4 Merge pull request #12986 from psankar/master
Added information about mailing lists
2015-05-07 16:49:14 -07:00
Tianon Gravi
b919dee834 Update "hack/vendor.sh" to be more explicit
Previously, we've taken advantage of the fact that libcontainer's `update-vendor.sh` is the same syntax as Docker's `vendor.sh` with some shell magic.  This changes that to copy libcontainer's dependencies into this file explicitly so that we can scale to more projects with varying methods of vendoring (assuming they don't use import re-writing, which screws up everyone).

We'll need to stay diligent in making sure this list matches what's in libcontainer's `update-vendor.sh` (minus the not-required codegangsta/cli dep), but that's a fair trade-off for being able to scale our dependency model better (and track new discrete dependencies more directly).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-07 17:43:11 -06:00
Tianon Gravi
6a1f862e40 Merge pull request #13032 from jfrazelle/nano-nano-nano
add nanorc to packaged builds
2015-05-07 17:35:03 -06:00
Jessie Frazelle
b4dc101d74 Merge pull request #13062 from Microsoft/10662-nativedriver
Fix os.MkdirAll in native driver
2015-05-07 16:34:31 -07:00
David Calavera
404412282d Merge pull request #12777 from ZJU-SEL/fix_pull_import_errpromt
Fix error prompt for pull & import handler postImagesCreate.
2015-05-07 16:27:15 -07:00
Jessie Frazelle
b6448f25f2 Merge pull request #13065 from tianon/fix-build-deb-tilde-expansion
Fix '~' expansion in build-deb... (properly this time)
2015-05-07 16:24:33 -07:00
Jessie Frazelle
b4e8942367 Merge pull request #13076 from LK4D4/fix_api_daemon_order
Fix api servers creation and daemon start order
2015-05-07 16:23:44 -07:00
Doug Davis
4f00b1020e Make list of commands for help less static
Before this PR the list of commands that were printed for the help
text was statically put into the flags.Usage() function via main.init(). This
made it impossible to modify later on when we add new commands
via plugins.

This PR moves the list of commands (name & description) into a structure
that is sorted and printed dynamically by the Usage func.  This will allow
the code to add to the list of commands after the init() func is done
but before the help text is printed for the user.

This just moves code around - it should have no UX impact at all.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-07 16:22:06 -07:00
David Calavera
23193efd93 Merge pull request #13073 from jfrazelle/add_1.6.1_commits
Add 1.6.1 commits
2015-05-07 16:17:53 -07:00
Jessie Frazelle
237bd23af8 Merge pull request #13059 from burke/no-fsync-on-temp-archive
Remove fsync in archive.NewTempArchive
2015-05-07 16:16:52 -07:00
Jessie Frazelle
1efecc4c41 Merge pull request #13041 from hqhq/hq_fix_checkkernel
update recommended kernel in checkKernel
2015-05-07 16:15:12 -07:00
Jessica Frazelle
f66d225427 add nanorc to packaged builds
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-07 16:10:07 -07:00
Jessica Frazelle
2c2f6fd272 bump version back to 1.7.0-dev
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-07 15:42:36 -07:00
Alexander Morozov
08230703fd Fix api servers creation and daemon start order
* daemon creation wasn't parallel to request buffering
* it was possible that empty volume will be created in
  /var/run/docker.sock by some container

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-07 15:38:02 -07:00
Jessica Frazelle
5b1edfed9d Bump version to 1.6.1
Signed-off-by: Jessica Frazelle <jess@docker.com>
(cherry picked from commit 97cd073598)

Conflicts:
	VERSION
2015-05-07 15:01:32 -07:00
David Calavera
dc610864aa Merge pull request #13072 from jfrazelle/bump_v1.6.1
Bump v1.6.1
2015-05-07 14:59:23 -07:00
Michael Crosby
f25bbedc85 Allow libcontainer to eval symlink destination
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add tests for mounting into /proc and /sys

These two locations should be prohibited from mounting volumes into
those destinations.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-07 14:43:39 -07:00
Michael Crosby
2f54c1a352 Update libcontainer to 1b471834b45063b61e0aedefbb1
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-07 14:43:39 -07:00
Michael Crosby
a7a51306b1 Mask reads from timer_stats and latency_stats
These files in /proc should not be able to be read as well
as written to.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-07 14:42:23 -07:00
Michael Crosby
27ae108b4e Mount RO for timer_stats and latency_stats in proc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-07 14:42:23 -07:00
Michael Crosby
42c8c1b0b8 Mount /proc/fs as readonly
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-05-07 14:42:23 -07:00
Michael Crosby
d87da59c79 Prevent write access to /proc/asound
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	integration-cli/docker_cli_run_test.go
2015-05-07 14:42:23 -07:00
Jessie Frazelle
74bfa36753 Merge pull request #12165 from icecrime/optional_userland_proxy
Optional userland proxy
2015-05-07 14:01:16 -07:00
Alexander Morozov
93536cfa76 Merge pull request #13067 from burke/faster-commit-for-overlay
overlay: skip superfluous metadata sets on commit
2015-05-07 13:58:46 -07:00
Jessie Frazelle
e712b60e80 Merge pull request #13068 from tianon/swap-builder-verbosity
Switch verbosity in builder/*/generate.sh so that we get download progress for Go instead of the name of every single file extracted
2015-05-07 13:52:51 -07:00
Jessie Frazelle
2aa09b4f86 Merge pull request #13061 from tianon/install-update-message
Update "install.sh" warning to be more verbose
2015-05-07 13:38:27 -07:00
Tianon Gravi
fc9ff248c1 Update "install.sh" warning to be more verbose
See https://github.com/docker/docker/issues/12395#issuecomment-99941300 for some of the context on this one.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-07 14:20:40 -06:00
Burke Libbey
bc5503f46b overlay: skip superfluous metadata sets on commit
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-07 16:15:54 -04:00
Tianon Gravi
24d98c14a0 Switch verbosity in builder/*/generate.sh so that we get download progress for Go instead of the name of every single file extracted
Also, `curl` is smart enough to see when the consumer of the pipe is going slow that it should slow down the transfer, so this gives a reasonable indication of extraction progress too.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-07 14:15:35 -06:00
Tianon Gravi
297cd347a6 Fix '~' expansion in build-deb... (properly this time)
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-07 14:02:21 -06:00
John Howard
390f3c99d3 Fix os.MkdirAll in native driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-07 12:09:30 -07:00
Rajdeep Dua
80d73c838a Test Cases for API - Container create with Hostname, DomainName and NetworkMode
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-07 21:03:39 +02:00
Burke Libbey
ec66daebc2 Don't fsync on V2 registry push tempfile creation
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-07 14:49:38 -04:00
Fred Lifton
1e6565188d Merge pull request #13050 from SvenDowideit/dhe-docs-update
DHE documentation update sync.
2015-05-07 11:43:04 -07:00
Michael Crosby
1ab875b38b Merge pull request #13058 from bharaththiruveedula/13057-remove-SetDaemon-method
Removing the SetDaemon method
2015-05-07 10:41:41 -07:00
Alexander Morozov
4f25f21a97 Merge pull request #13044 from jpopelka/link-add
Fix firewalld callback.
2015-05-07 10:34:34 -07:00
Alexander Morozov
3d2cd92b2d Merge pull request #12966 from cpuguy83/cleanup_the_lxc_cleanup
Cleanup container reg for lxc special case
2015-05-07 10:19:46 -07:00
David Calavera
db26564864 Merge pull request #12965 from tianon/libcontainer-logrus
Update libcontainer and make it the source of truth on logrus version
2015-05-07 10:10:28 -07:00
Jessica Frazelle
97cd073598 Bump version to 1.6.1
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-05-07 10:07:01 -07:00
Burke Libbey
236dbc2e59 Remove Sync() call in NewTempArchive:
This makes the "Buffering to disk" part of `docker push` 70% faster in
my use-case (having already applied #12833).

fsync'ing here serves no valuable purpose: if the drive's operation is
interrupted, so it the program's, and this archive has no value other
than the immediate and transient one.

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-07 12:58:12 -04:00
Bharath Thiruveedula
94def48878 Removing the SetDaemon method
Signed-off-by: Bharath Thiruveedula <bharath_ves@hotmail.com>
2015-05-07 22:25:13 +05:30
David Calavera
d78755d159 Merge pull request #12822 from brahmaroutu/container_stop_api
restapi stop fails if ?t=int not present
2015-05-07 09:38:59 -07:00
David Calavera
a38d6b5755 Merge pull request #13037 from runcom/12607-no-strconv-atoi-err-check
Do not check and return strconv.Atoi error in api container restart
2015-05-07 09:29:10 -07:00
Srini Brahmaroutu
68e9c07850 Restapi for stop fails if ?t=int not present
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-05-07 15:43:50 +00:00
Sven Dowideit
59bfee2fa4 DHE documentation update
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-07 20:38:46 +10:00
Jiri Popelka
6e8cfd63fc Fix firewalld callback.
It needs to be called with same args as the one 4 lines above.

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
2015-05-07 10:08:49 +02:00
Tianon Gravi
443437f5ea Merge pull request #13038 from tianon/fix-build-deb
Fix build-deb
2015-05-06 22:12:15 -07:00
Qiang Huang
f133f11a7d add blkio.weight support
We can use this to control block IO weight of a container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-07 11:55:58 +08:00
Brian Goff
44cd599e29 Cleanup container reg for lxc special case
The lxc code here is doing the exact same thing on calling
execdriver.Terminate, so let's just use that.

Also removes some dead comments originally introduced
50144aeb42 but no longer relevant since we
have restart policies.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-06 23:01:46 -04:00
Qiang Huang
ceae5f54b3 update recommended kernel in checkKernel
We already changed docs: https://github.com/docker/docker/pull/10652
Should change code as well.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-07 10:11:02 +08:00
Fred Lifton
a1aff84480 Merge pull request #13036 from SvenDowideit/update-docker-hub-repo-documentation
Add a userguide to cover the uses of Hub before creating new reposito…
2015-05-06 18:02:23 -07:00
Sven Dowideit
9da3a848ab Add a userguide to cover the uses of Hub before creating new repositories
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-07 00:31:04 +00:00
Doug Davis
a592dce97b Merge pull request #13034 from icecrime/remove_insert_instruction
Remove unused Dockerfile instruction INSERT
2015-05-06 20:12:50 -04:00
Tianon Gravi
867eed8f35 Fix build-deb
This fixes the part of #12996 that I forgot. 👼

This also fixes a minor path issue (there's no `libexec` in Debian), and fixes a minor bug with the `debVersion` parsing.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-06 18:10:15 -06:00
Antonio Murdaca
74121a4211 Do not check and return strconv.Atoi error in api container restart, regression
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-07 01:49:16 +02:00
Arnaud Porterie
596e91638c Remove unused Dockerfile instruction INSERT
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-06 16:26:43 -07:00
jhowardmsft
e35b025aa6 Windows: Split ContainerExecCreate
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-06 16:19:27 -07:00
Alexander Morozov
4b4adae41c Merge pull request #13033 from icecrime/12715_carry
Logs with follow=1 immediately send HTTP response
2015-05-06 15:42:48 -07:00
Alexander Morozov
f65e65b0c9 Merge pull request #12980 from Microsoft/10662-filepathimageimage
Windows: Fix filepath vs path in image.go
2015-05-06 15:02:10 -07:00
Alexander Morozov
7d38d33f01 Merge pull request #12977 from Microsoft/10662-graphloadfilepath
Windows: Filepath in graph\load.go
2015-05-06 15:01:49 -07:00
Anthony Baire
589de35651 Logs with follow=1 immediately send HTTP response
Signed-off-by: Anthony Baire <Anthony.Baire@irisa.fr>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-06 14:39:45 -07:00
Jessie Frazelle
54a1bb07fa Merge pull request #13018 from mbentley/nanorc-syntax
Added nanorc for Dockerfiles
2015-05-06 14:23:20 -07:00
Jessie Frazelle
10f4bf514d Merge pull request #12878 from cpuguy83/move_chunked_encoding_test_to_from_integration
Move ChunkedEncoding from integration
2015-05-06 13:59:13 -07:00
Antonio Murdaca
72a0272a62 Fix typo in the api remote reference for links
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-06 22:08:10 +02:00
Brian Goff
f9b20ad9e4 Merge pull request #12999 from duglin/BadRUNerrMsg
Fix RUN's error msg when it fails
2015-05-06 15:49:24 -04:00
Alexander Morozov
71c1a7ea7f Merge pull request #13017 from cpuguy83/12859_fix_lxc_wait_exitcodes
Fix LXC stop signals
2015-05-06 11:21:44 -07:00
Tianon Gravi
ca8fa6e46d Allow download-frozen-image.sh to work on user images too
To account for "/" not working in filenames, we replace it with "_" for our temporary files (that exist only to emulate Bash 4's associative arrays in Bash 3).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-06 12:05:17 -06:00
Brian Goff
7c574b9e9d Move ChunkedEncoding from integration
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-06 13:00:17 -04:00
Matt Bentley
76bc44fb91 Added nanorc for Dockerfiles
Signed-off-by: Matt Bentley <matt@docker.com>
2015-05-06 12:41:11 -04:00
Brian Goff
d2c4ee37c6 Fix LXC stop signals
`lxc-stop` does not support sending arbitrary signals.
By default, `lxc-stop -n <id>` would send `SIGPWR`.
The lxc driver was always sending `lxc-stop -n <id> -k`, which always
sends `SIGKILL`. In this case `lxc-start` returns an exit code of `0`,
regardless of what the container actually exited with.
Because of this we must send signals directly to the process when we
can.

Also need to set quiet mode on `lxc-start` otherwise it reports an error
on `stderr` when the container exits cleanly (ie, we didn't SIGKILL it),
this error is picked up in the container logs... and isn't really an
error.

Also cleaned up some potential races for waitblocked test.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-06 11:56:48 -04:00
Brian Goff
a242ceaa09 Merge pull request #12975 from Microsoft/10662-graphexportfilepath
Windows: graph\export.go filepath fixes
2015-05-05 21:44:57 -04:00
Vincent Batts
2281d6c266 Merge pull request #12917 from jfrazelle/add-rpm
Add RPM for centos-7, fedora-20, fedora-21
2015-05-05 17:31:21 -07:00
Doug Davis
54662eae10 Fix RUN's error msg when it fails
When RUN returns with a non-zero return code it prints the command
that was executed as a Go []string:
```
INFO[0000] The command &{[/bin/sh -c noop a1 a2]} returned a non-zero code: 127
```

instead it should look like this:
```
INFO[0000] The command "/bin/sh -c noop a1 a2" returned a non-zero code: 127
```

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-05 16:08:41 -07:00
Jessie Frazelle
b5d68944f4 Merge pull request #13004 from duglin/FixBuilderStepMsg
Fix issue where build steps are duplicated in the output
2015-05-05 16:06:50 -07:00
Jessica Frazelle
18beb55611 Add rpm for centos-6, centos-7, fedora-20, fedora-21
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-05 16:05:30 -07:00
Doug Davis
08b7f30fcd Fix issue where build steps are duplicated in the output
This fixes an issue where the build output for the "Steps" would look like:
```
Step 1: RUN echo hi echo hi
```
instead of
```
Step 1: RUN echo hi
```

Also, I noticed that there were no checks to make sure invalid Dockerfile
cmd flags were caught on cmds that didn't use cmd flags at all. They would
have been caught on the cmds that had flags, but cmds that didn't bother
to add a new code for flags would have just ignored them.  So, I added
checks to each cmd to flag it.

Added testcases for issues.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-05 15:28:42 -07:00
moxiegirl
78c70cc364 Merge pull request #13003 from moxiegirl/machine-branch-change
Updating branch for machine docs
2015-05-05 14:49:44 -07:00
Arnaud Porterie
e960e4bb12 Merge pull request #11844 from jbarbier/cgroup-parent-42
Adding cgroup-parent option for docker build
2015-05-05 14:46:47 -07:00
Mary Anthony
8c9d67921a Updating branch for machine docs
Signed-off-by: Mary Anthony <mary@docker.com>
2015-05-05 14:33:31 -07:00
Sebastiaan van Stijn
f0a8dfd29e Merge pull request #12993 from psftw/support-tweak
Remove blanket "supported" language.
2015-05-05 16:03:02 -04:00
David Calavera
6bb596219f Merge pull request #12996 from tianon/abri-à-vélo
Replace "docker-core" with "docker-engine" in "build-deb"
2015-05-05 10:43:15 -07:00
Patrick Devine
878dcb89f3 Make a docker-in-docker dynamic binary and add RPM target
This change adds a new docker-in-docker dynamic binary make target which
builds a centos container for creating the dynamically linked binary.
To use it, you first must create the static binary and then call the
dind-dynbinary target.  You can call it like:

$ hack/make.sh binary dind-dynbinary rpm

This would then package the dynamic binary into the rpm after having
created it in the centos build container.  Unfortunately with this approach
you can't create the rpms and the debs with the same command.  They have to
be created separately otherwise the wrong version (static vs. dynamic) gets
packaged.

Various RPM fixes including:
  - Adding missing RPM dependencies.
  - Add sysconfig configuration files to the RPM.
  - Add an epoch to silence the fpm warning.
  - Remove unnecessary empty package.

Signed-off-by: Patrick Devine <patrick.devine@docker.com>
Signed-off-by: Chad Metcalf <chad@docker.com>
2015-05-05 10:01:39 -07:00
Alexander Morozov
77266a67e0 Merge pull request #12947 from runcom/11577-readonly-special-file-if-readonlyfs
Make /etc/hosts, /etc/resolv.conf, /etc/hostname read only if --read-only enabled
2015-05-05 09:45:24 -07:00
Alexander Morozov
e894a901db Merge pull request #12679 from adcaes/12607-remove-error-check
Add intValue and use it to get timeout form param in postContainersRestart
2015-05-05 09:38:45 -07:00
Tianon Gravi
5e563d1708 Replace "docker-core" with "docker-engine" in "build-deb"
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-05 10:11:59 -06:00
Peter Salvatore
3efc083d4a Remove blanket "supported" language.
Signed-off-by: Peter Salvatore <peter@psftw.com>
2015-05-05 11:03:53 -04:00
Lei Jitang
0e08e9aca1 Add support --net=container with --mac-address,--add-host error out
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-05 19:28:40 +08:00
Lei Jitang
101f982059 Refactor the code of checking conflict option with netmode.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-05 19:23:18 +08:00
Qiang Huang
5a6db4fd44 a few cleanups for client output
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-05 15:59:17 +08:00
Sankar சங்கர்
c7ca73c830 Added information about mailing lists
Signed-off-by: Sankar சங்கர் <sankar.curiosity@gmail.com>
2015-05-05 13:21:24 +05:30
Adria Casas
a2c76912e0 Rename int64Value to int64ValueOrZero.
Signed-off-by: Adria Casas <adriacasas88@gmail.com>
2015-05-05 08:54:28 +02:00
Tibor Vass
91fb4d672a Merge pull request #10766 from cpuguy83/stats_pull_once
Allow pulling stats once and disconnecting.
2015-05-04 22:28:01 -07:00
Tibor Vass
f838d44283 Merge pull request #12979 from Microsoft/10662-filepathgraphpush
Windows: Fix filepath vs path in push.go
2015-05-04 22:25:13 -07:00
Fred Lifton
677b962642 Merge pull request #12981 from SvenDowideit/marc-merlin-spelling-fix
spelling fix from Marc MERLIN
2015-05-04 17:53:37 -07:00
Yuan Sun
6e8aa4e588 Verify the no-trunc option for the search operation.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-05-05 08:51:13 +08:00
Sven Dowideit
bba5fd8caa spelling fix from Marc MERLIN
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-05 00:38:41 +00:00
John Howard
1c3b697d60 Windows: Fix filepath vs path in image.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 16:23:17 -07:00
Fred Lifton
77183ed760 Merge pull request #12890 from SvenDowideit/update-docker-hub-accounts-documentation
Update the Docker Hub account, org and group documentation and images
2015-05-04 16:23:08 -07:00
John Howard
3b2c8f69fd Windows: Fix filepath vs path in push.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 16:18:23 -07:00
Arnaud Porterie
44de5fecce Add DOCKER_USERLANDPROXY test variable
Add an convenient way to switch --userland-proxy on and off in
integration tests.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-04 16:07:51 -07:00
Arnaud Porterie
f42348e18f Add --userland-proxy daemon flag
The `--userland-proxy` daemon flag makes it possible to rely on hairpin
NAT and additional iptables routes instead of userland proxy for port
publishing and inter-container communication.

Usage of the userland proxy remains the default as hairpin NAT is
unsupported by older kernels.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-04 16:07:45 -07:00
John Howard
bb1ecde164 Windows: Filepath in graph\load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 15:14:39 -07:00
John Howard
b30f14f06d Windows: First fix for graph\graph.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 15:06:51 -07:00
John Howard
377ed712d3 Windows: graph\export.go filepath fixes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 14:56:23 -07:00
wlan0
dca9e02b15 Add log opts flag to pass in logging options
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-05-04 14:39:48 -07:00
Vincent Batts
56c9917815 Merge pull request #12190 from rhvgoyal/deferred-removal
Devicemapper: Provide deferred device removal capability
2015-05-04 14:22:52 -07:00
Phil Estes
980c0e8c3b Merge pull request #12948 from runcom/api-tests-container-delete
Add tests for API container delete
2015-05-04 17:08:52 -04:00
Antonio Murdaca
8771cafab6 Add tests for API container delete
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-04 22:41:57 +02:00
Phil Estes
3fcf387d52 Merge pull request #12718 from Microsoft/10662-mkdirall
Windows: Volume path aware mkdirall
2015-05-04 15:51:56 -04:00
David Calavera
0a2ccb1cb5 Merge pull request #12769 from calavera/git_build_fragment
Use git url fragment to specify build reference and dir context.
2015-05-04 12:48:24 -07:00
mauriyouth
7d371c0b47 Make /etc/hosts, /etc/resolv.conf, /etc/hostname read only if --read-only is enable
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-04 21:30:52 +02:00
Michael Crosby
f93cbd2448 Merge pull request #12967 from runcom/add-self-to-maintainers
Add runcom to maintainers.people
2015-05-04 12:00:42 -07:00
Tibor Vass
87a0ca5283 Merge pull request #12954 from vdemeester/11595-pkg-ioutils-coverage
More test on pkg/ioutils (coverage)
2015-05-04 14:57:58 -04:00
Arnaud Porterie
9c32cd1cef Merge pull request #10775 from duglin/BuilderFlags
Add support for Dockerfile CMD options
2015-05-04 11:39:09 -07:00
Antonio Murdaca
ea6649e701 Add runcom to maintainers.people
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-04 20:26:11 +02:00
Vincent Demeester
815b472a02 Add more ioutils tests.
Closes #11595

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-05-04 19:56:10 +02:00
Jessie Frazelle
0c1c272687 Merge pull request #12865 from larsks/bug/12864
journald log driver: use CONTAINER_ID field for container id
2015-05-04 10:53:58 -07:00
Phil Estes
4895a887e2 Merge pull request #12937 from runcom/daemon-as-a-service
Refactor server to use daemon as the service layer in controllers
2015-05-04 13:03:28 -04:00
Tianon Gravi
80a895142e Update libcontainer and make it the source of truth on logrus version
To help avoid version mismatches between libcontainer and Docker, this updates libcontainer to be the source of truth for which version of logrus the project is using.  This should help avoid potential incompatibilities in the future, too. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-04 11:02:44 -06:00
Phil Estes
24bd3db0b5 Merge pull request #12939 from draghuram/history_test
Adding test for "GET /images/(name)/history" API.
2015-05-04 12:58:43 -04:00
Tibor Vass
8ac8c2af60 Merge pull request #12936 from tianon/docker-dev
Rename development builds to be in the "docker-dev" repo instead of "docker"
2015-05-04 12:55:46 -04:00
Alexander Morozov
4f5272320c Merge pull request #12958 from Mashimiao/cleanup-container-functions
Cleanup: move container's functions to its own file
2015-05-04 09:36:55 -07:00
David Calavera
49fd83a25e Use git url fragment to specify reference and dir context.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-04 09:28:06 -07:00
Sebastiaan van Stijn
ac324e5e52 Merge pull request #11034 from HuKeping/oom_kill_disable
enable cgroups memory.oom_control
2015-05-04 11:53:05 -04:00
unclejack
2e49281bd0 Merge pull request #12903 from rhvgoyal/disable-discards
devmapper: Disable mount option "discard" by default
2015-05-04 18:35:25 +03:00
Tibor Vass
a8d73339f2 Merge pull request #12953 from sunyuan3/404
Verifiy status Codes 404 when no such image.
2015-05-04 11:10:07 -04:00
Brian Goff
f3023a93d1 Allow pulling stats once and disconnecting.
Adds a `stream` query param to the stats API which allows API users to
only collect one stats entry and disconnect instead of keeping the
connection alive to stream more stats.

Also adds a `--no-stream` flag to `docker stats` which does the same

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-04 10:49:13 -04:00
unclejack
56f7da34fc Merge pull request #12944 from tianon/fsnotify-1.2.0
Update fsnotify to 1.2.0
2015-05-04 16:57:45 +03:00
Ma Shimiao
1be7a10b89 cleanup: move container's functions to its file
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-05-04 21:37:44 +08:00
unclejack
175339ffb6 Merge pull request #12943 from tianon/go-patricia-v2
Update go-patricia to 2.1.0
2015-05-04 16:28:03 +03:00
HuKeping
a4a924e1b6 Feature: option for disable OOM killer
Add cgroup support for disable OOM killer.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-04 21:11:29 +08:00
Yuan Sun
9eefd2c17d Verifiy status Codes 404 when no such image
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-05-04 15:39:40 +08:00
Sven Dowideit
5cec69a7b3 Update the Docker Hub account, org and group documentation and images
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-05-04 00:37:54 +00:00
James Turnbull
fe221852b7 Merge pull request #12950 from thieman/tnt-riak-ssh-reference
Remove stale reference to previous SSH instructions
2015-05-03 15:42:38 -04:00
Travis Thieman
b40a5eeec8 Remove stale reference to previous SSH instructions
Signed-off-by: Travis Thieman <travis.thieman@gmail.com>
2015-05-03 14:15:17 -04:00
Doug Davis
15313dfdf3 Merge pull request #12735 from jmzwcn/patch-1
Remove empty line after client.CmdInspect docstring
2015-05-03 11:10:14 -04:00
Doug Davis
e8bbd87ba8 Merge pull request #12888 from jmzwcn/patch-3
`docker images` friendly duration gets unfriendly after a while
2015-05-03 11:09:25 -04:00
Daniel Zhang
28ea4a63d0 docker images friendly duration gets unfriendly after a while
fix #12852
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2015-05-03 21:19:18 +08:00
jmzwcn
28547a1a3a Remove empty line after client.CmdInspect docstring #12706
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>

Remove empty line after client.CmdInspect docstring

fix #12706
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>

Remove empty line after client.CmdInspect docstring

fix #12706
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2015-05-03 17:23:18 +08:00
Tianon Gravi
e1ccfabdc5 Update fsnotify to 1.2.0
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-02 23:28:15 -06:00
Tianon Gravi
b447fef7ec Update go-patricia to 2.1.0
This includes a fix for the minor v2 API change introduced by 341a37095f. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-02 23:25:57 -06:00
Raghuram Devarakonda
aaaa8bab0c Adding test for "GET /images/(name)/history" API.
Closes #12284.

Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-05-02 23:09:32 -04:00
Sebastiaan van Stijn
0ad6f90127 Merge pull request #12893 from vdemeester/12892-fix-labels-documentation
Fixing examples given for labels
2015-05-02 22:29:08 -04:00
Sebastiaan van Stijn
b58f48ae42 Merge pull request #12922 from tianon/complete-repos-on-pull-all
Only complete repos with "docker pull -a"
2015-05-02 22:19:37 -04:00
Alexander Morozov
ec534042aa Merge pull request #12941 from runcom/unused-return-error
Remove unused error return
2015-05-02 09:12:59 -07:00
Antonio Murdaca
4aff563282 Remove unused error return
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-02 15:57:57 +02:00
Antonio Murdaca
c7cfdb65aa Refactor server to use daemon as the service layer in controllers
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-02 03:12:58 +02:00
Tianon Gravi
a4af8ad869 Rename development builds to be in the "docker-dev" repo instead of "docker"
See https://github.com/docker-library/docker/issues/2 for some of the context around this; essentially, we're looking to create an official `docker` image that includes the Docker CLI (and the dependencies necessary for easy Docker-in-Docker), but it makes sense to use the `docker` namespace for that image.  The `docker-dev` official image is already builds of Docker's own `Dockerfile` (but specifically of releases), so this seemed like a good fit. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-01 18:28:08 -06:00
Jessie Frazelle
3ea59f8991 Merge pull request #12932 from tianon/finally-remove-archive-tar-copy
Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
2015-05-01 15:43:13 -07:00
Alexander Morozov
393678474f Merge pull request #12924 from runcom/provide-struct-to-cli-stream
Provide a struct to configure cli streaming
2015-05-01 15:10:58 -07:00
Tianon Gravi
576985a1dc Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
IT'S ABOUT TIME. 🎉

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-01 16:01:10 -06:00
Jessie Frazelle
1f2f3db1e3 Merge pull request #12720 from DarianAnjuhal/fix-ensure-dockerinit
TestDiffEnsureDockerinitFilesAreIgnored is too long
2015-05-01 14:52:34 -07:00
Jessie Frazelle
4d88bf3ecb Merge pull request #12930 from tianon/build-deb-stretch
Add "debian:stretch" as another build-deb target
2015-05-01 14:42:19 -07:00
Michael Crosby
e6d3ebd939 Merge pull request #12929 from tianon/dockerignore-fffff
Remove hacky "cp .../Dockerfile.build ." in "build-deb"
2015-05-01 14:32:26 -07:00
Michael Crosby
ab74b327c6 Merge pull request #12928 from LK4D4/firewalld_race
Fix race in FirewalldInit
2015-05-01 14:23:47 -07:00
Tianon Gravi
d317b7c891 Add "debian:stretch" as another build-deb target
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-01 15:03:08 -06:00
Tianon Gravi
9f5730e131 Remove hacky "cp .../Dockerfile.build ." in "build-deb"
Turns out that `-f` on a file that's in `.dockerignore` actually does work.  No idea why it wasn't when I was doing this before, but oh well! 🤘

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-01 14:45:00 -06:00
Alexander Morozov
a05bcd12c4 Fix race in FirewalldInit
It was possible that signalHandler won't start because connections is
not assigned.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-05-01 13:35:54 -07:00
Antonio Murdaca
d9639409fd Provide a struct to configure cli streaming
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-01 20:23:44 +02:00
Michael Crosby
e1df16b3a3 Merge pull request #12921 from hqhq/hq_fix_rmlink
fix docker rm name issue
2015-05-01 11:15:25 -07:00
Tianon Gravi
380b873752 Only complete repos with "docker pull -a"
With this, `docker pull deb<tab>` will show all `debian:*` tags, as before, but `docker pull -a deb<tab>` will complete directly to just `debian`. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-01 10:04:24 -06:00
moxiegirl
949b929a32 Merge pull request #12882 from kostickm/12824-uninstall-docs
Docs adding uninstall instructions
2015-05-01 08:54:59 -07:00
Megan Kostick
5eee4058fe Docs adding uninstall instructions
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-05-01 08:10:56 -07:00
Qiang Huang
79f13d1497 fix docker rm name issue
Addresses https://github.com/docker/docker/issues/12308

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-01 22:26:40 +08:00
moxiegirl
7e864a57bc Merge pull request #12915 from moxiegirl/implement-github-ignores
Adding support for GITHUB IGNORES to the engine Dockerfile
2015-05-01 06:29:27 -07:00
Vivek Goyal
04adaaf1ee devmapper: Disable mount option "discard" by default
Right now devicemapper mounts thin device using online discards by default
and passes mount option "discard". Generally people discourage usage of
online discards as they can be a drain on performance. Instead it is 
recommended to use fstrim once in a while to reclaim the space.

In case of  containers, we recommend to keep data volumes separate. So
there might not be lot of rm, unlink operations going on and there might
not be lot of space being freed by containers. So it might not matter
much if we don't reclaim that free space in pool.

User can still pass mount option explicitly using dm.mountopt=discard to
enable discards if they would like to.

So this is more like setting the containers by default for better performance
instead of better space efficiency in pool. And user can change the behavior
if they don't like default behavior.

Reported-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-05-01 09:16:31 -04:00
Tibor Vass
79d086c47d Merge pull request #12772 from Microsoft/10662-moveworkdirchecktoserver
Windows: Move workdir check daemon-side
2015-05-01 00:24:40 -04:00
Tibor Vass
abf1a14bfe Merge pull request #12716 from Microsoft/10662-defaultlistener
Windows: Change default listener to HTTP
2015-05-01 00:11:54 -04:00
jhowardmsft
cbf9a64cb5 Windows: Change default listener to HTTP
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
2015-04-30 19:49:45 -07:00
Michael Crosby
66077a9d69 Merge pull request #12767 from Microsoft/10662-commitdefertarclose
Windows: Commit() rwTar defer close
2015-04-30 18:06:09 -07:00
Tibor Vass
e9c9682333 Merge pull request #12829 from Microsoft/10662-execdriver-driver-refactor
Windows: Start refactor execdriver/driver.go
2015-04-30 20:36:10 -04:00
Michael Crosby
6b42d72d86 Merge pull request #12831 from Microsoft/10662-nolxconwindows
Windows: Factor out LXC
2015-04-30 17:25:15 -07:00
Michael Crosby
d2e380b687 Merge pull request #12841 from Mashimiao/use-CustomSize-to-replace-intToString
use CustomSize replace intToString
2015-04-30 17:24:41 -07:00
moxiegirl
7e7b6a20bd Merge pull request #12901 from hqhq/hq_fix_test_comment
fix comments for test certain tests
2015-04-30 17:08:23 -07:00
Michael Crosby
5221fd2ba5 Merge pull request #12900 from gaurav-gosec/master
Make use of iptablesPath variable which has the path of iptables, instea...
2015-04-30 16:12:03 -07:00
Michael Crosby
6bb1986e7f Merge pull request #12914 from duglin/FixCPtext
Don't wrap 'cp' help too soon.
2015-04-30 16:05:20 -07:00
Tibor Vass
648bf6a446 Merge pull request #12909 from runcom/12907-fix-TestApiImagesDelete-net-none-build
Fix TestApiImagesDelete for --net none build
2015-04-30 18:22:04 -04:00
Mary Anthony
51977a2307 Adding support for GITHUB IGNORES to the engine Dockerfile
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-30 15:21:05 -07:00
Doug Davis
68ee5bdf96 Don't wrap 'cp' help too soon.
Minor thing but docker cp --help was:
Copy files/folders from a PATH on the container to a HOSTDIR on the host
running the command. Use '-' to write the data
as a tar file to STDOUT.

This changes it to:
Copy files/folders from a PATH on the container to a HOSTDIR on the host
running the command. Use '-' to write the data as a tar file to STDOUT.

The \n made the output look funky.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-30 14:43:14 -07:00
John Howard
10e2dbf375 Windows: Factor out LXC
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:28:35 -07:00
John Howard
71bfb93678 Windows: Fork execdrivers.go for Windows execdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:22:30 -07:00
John Howard
b255c565ca Windows: Start refactor execdriver/driver.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:21:04 -07:00
John Howard
03eb0d065d Windows: Move workdir check daemon-side
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:16:45 -07:00
Michael Crosby
d5ebb60bdd Allow libcontainer to eval symlink destination
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add tests for mounting into /proc and /sys

These two locations should be prohibited from mounting volumes into
those destinations.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-30 14:08:02 -07:00
Michael Crosby
83c5131acd Update libcontainer to 1b471834b45063b61e0aedefbb1
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-30 14:07:52 -07:00
John Howard
f9c7772b83 Windows: Commit() rwTar defer close
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 12:17:33 -07:00
jhowardmsft
86d1223a29 Windows: mkdirall volume path aware
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
2015-04-30 11:59:42 -07:00
Antonio Murdaca
5c86f311c8 Fix TestApiImagesDelete for --net none build
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-30 20:49:28 +02:00
Alexander Morozov
72e9e12fa0 Merge pull request #12592 from Mic92/dockerfile
Dockerfile: download go libraries before copy vendor
2015-04-30 10:29:01 -07:00
Michael Crosby
b6a9dc399b Mask reads from timer_stats and latency_stats
These files in /proc should not be able to be read as well
as written to.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-30 10:25:26 -07:00
moxiegirl
cacf90c963 Merge pull request #12857 from nikolas/patch-1
Remove incorrect option in docker install command
2015-04-30 09:35:20 -07:00
Tibor Vass
0d0b42547e Merge pull request #12771 from runcom/say-bye-to-engine
Remove engine
2015-04-30 12:18:16 -04:00
Brian Goff
fc9033a9c8 Merge pull request #12664 from Mashimiao/sysinfo-support-ipv4_forward-check
sysinfo: add IPv4Forwarding check
2015-04-30 11:44:44 -04:00
Brian Goff
1eb4e96f21 Merge pull request #12837 from mavenugo/integ
A few more Integration tests to test Networking related daemon flags
2015-04-30 11:12:43 -04:00
Lars Kellogg-Stedman
869ecba652 journald log driver: use CONTAINER_ID field for container id
This patch modifies the journald log driver to store the container ID in
a field named CONTAINER_ID, rather than (ab)using the MESSAGE_ID field.
Additionally, this adds the CONTAINER_ID_FULL field containing the
complete container ID and CONTAINER_NAME, containing the container name.

When using the journald log driver, this permits you to see log messages
from a particular container like this:

    # journalctl CONTAINER_ID=a9238443e193

Example output from "journalctl -o verbose" includes the following:

    CONTAINER_ID=27aae7361e67
    CONTAINER_ID_FULL=27aae7361e67e2b4d3864280acd2b80e78daf8ec73786d8b68f3afeeaabbd4c4
    CONTAINER_NAME=web

Closes: #12864
Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
2015-04-30 10:42:27 -04:00
Gaurav
1d5f1bb0f5 Make use of iptablesPath variable which has the path of iptables, instead of using string iptables directly
Signed-off-by: Gaurav <gaurav.gosec@gmail.com>
2015-04-30 18:22:12 +05:30
Vincent Demeester
424a544bb5 Fixing examples given for labels
Fixes #12892

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-30 09:48:54 +02:00
Qiang Huang
987e221607 fix comments for test certain tests
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-30 15:40:48 +08:00
Daniel, Dao Quang Minh
cd2b019214 sort ports mapping before allocating
prioritize the ports with static mapping before dynamic mapping. This removes
the port conflicts when we allocate static port in the reserved range
together with dynamic ones.
When static port is allocated first, Docker will skip those when determining
free ports for dynamic ones.

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-04-30 02:18:04 +00:00
Antonio Murdaca
f7e417ea5e Remove integration tests and port them to integration-cli
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-30 01:35:16 +02:00
Antonio Murdaca
531f4122bd Remove engine mechanism
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-30 01:35:16 +02:00
Sebastiaan van Stijn
029cbc1004 Merge pull request #12574 from ahmetalpbalkan/docs/systemd-dir
docs: Add more places docker.service can be at
2015-04-29 19:07:58 -04:00
Ahmet Alp Balkan
c0a1b2d6e9 docs: Add more places docker.service can be at
More systemd goodness. Documenting where `docker.service` lives under Ubuntu 15.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-29 22:39:48 +00:00
Phil Estes
2c4fe2aba3 Merge pull request #12439 from Mashimiao/add-err-check-before-getting-term
Add error check before getting term
2015-04-29 17:57:01 -04:00
Aaron Davidson
c271c61fee Do our best not to invoke iptables concurrently if --wait is unsupported
We encountered a situation where concurrent invocations of the docker daemon on a machine with an older version of iptables led to nondeterministic errors related to simultaenous invocations of iptables.

While this is best resolved by upgrading iptables itself, the particular situation would have been avoided if the docker daemon simply took care not to concurrently invoke iptables. Of course, external processes could also cause iptables to fail in this way, but invoking docker in parallel seems like a pretty common case.

Signed-off-by: Aaron Davidson <aaron@databricks.com>
2015-04-29 14:40:25 -07:00
Madhu Venugopal
1c073ec176 Moved explicit cleanups into defered action
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 11:41:13 -07:00
Jessie Frazelle
d716f22aad Merge pull request #12875 from runcom/remove-cfatal-in-goroutine-integration-cli
c.Fatal won't fail and exit test inside a goroutine
2015-04-29 10:47:17 -07:00
Alexander Morozov
6c46c9c839 Merge pull request #11526 from mizzy/append-drop-rule-not-insert
Append DROP rule with --icc=false, not insert
2015-04-29 10:28:11 -07:00
Madhu Venugopal
dd0666e64f Integration Tests for --icc=false & container Linking using --expose
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 10:16:31 -07:00
Jessie Frazelle
53bef64804 Merge pull request #10427 from jfrazelle/option-to-disable-systemd-cgroups
Option to configure cgroup manager (adds --exec-opt)
2015-04-29 10:00:41 -07:00
Madhu Venugopal
ba11929ebd Integration tests for --ip daemon option
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 09:55:49 -07:00
Madhu Venugopal
0e254411b1 Integration tests for --fixed-cidr daemon config
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 09:55:42 -07:00
Madhu Venugopal
9c325c3f54 Integration tests for --bip daemon flag
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 09:55:34 -07:00
Madhu Venugopal
f3f5ff9d83 Integration tests for --bridge daemon flag
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-29 09:55:25 -07:00
Doug Davis
44f8c44e5f Merge pull request #12840 from vdemeester/11598-pkg-fileutils-tests
Add coverage on pkg/fileutils
2015-04-29 11:15:57 -04:00
Antonio Murdaca
4203230cbb c.Fatal won't fail and exit test inside a goroutine, errors should be handled outside with a channel
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-29 17:02:22 +02:00
Vincent Demeester
8454e1a3b2 Add coverage on pkg/fileutils
Should fix #11598

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-29 16:27:12 +02:00
Doug Davis
534ed8c2d4 Remove use of "DEBUG" env var from CLI and decouple DEBUG from --log-level
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-29 06:20:33 -07:00
Brian Goff
f2f8e4c5c9 Merge pull request #12870 from coolljt0725/fix_rename_help
Fix docker rename help not consistent with other commands
2015-04-29 09:14:03 -04:00
Lei Jitang
0e752adf55 Fix docker rename help not consistent with other commands
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-29 19:37:20 +08:00
Ma Shimiao
8a2f899286 use CustomSize replace intToString
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-29 08:30:25 +08:00
Brian Goff
d2f0b9ed97 Merge pull request #11190 from cyphar/expose-path-sanitisation-wrappers
Expose the getResourcePath and getRootResourcePath wrappers.
2015-04-28 18:45:36 -04:00
Jessie Frazelle
f80300e9cf Merge pull request #12789 from LK4D4/daemon_suite
Implement daemon suite for integration-cli
2015-04-28 15:30:36 -07:00
David Calavera
cfa3a080c6 Merge pull request #12820 from runcom/yet-another-sockRequest-refactor
Expose whole Response struct in sockRequestRaw
2015-04-28 13:26:30 -07:00
Jessie Frazelle
4676ff3fd7 Merge pull request #12245 from buddhamagnet/dockerignore-ignores
Add support for exclusion rules in dockerignore
2015-04-28 11:28:46 -07:00
buddhamagnet
6fd8e485c8 add support for exclusion rules in dockerignore
Signed-off-by: Dave Goodchild <buddhamagnet@gmail.com>
2015-04-28 18:56:45 +01:00
nikolas
f04837cf80 Remove incorrect option in docker install command
The `-N` option is not compatible with the `-O` option of wget (see the man page).

The example command now matches the example in the script on http://get.docker.com/.

Signed-off-by: Nik Nyby <nikolas@gnu.org>
2015-04-28 13:27:04 -04:00
moxiegirl
dde5ff2872 Merge pull request #12644 from psftw/official-repos-rewrite
Rewrite Official Repos page.
2015-04-28 08:57:29 -07:00
moxiegirl
6113eab174 Merge pull request #12814 from vbatts/vbatts-rhel_updates
RHEL updates
2015-04-28 08:51:35 -07:00
Alexander Morozov
868d5dca74 Merge pull request #12844 from hqhq/hq_fix_inspect_format
fix a minor inspect format issue
2015-04-28 08:50:52 -07:00
Vincent Batts
9b365e0845 rhel.md: adding link to most recent issue
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-28 11:28:33 -04:00
Vincent Batts
179b6ddc35 rhel.md: bump the kernel version for RHEL6
Closes #9856

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-28 11:28:33 -04:00
Vincent Batts
ed40c0a9a4 rhel.md: update RHEL6 from 6.5 to 6.6
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-28 11:28:23 -04:00
Doug Davis
a8e871b0bb Add support for Dockerfile CMD options
This adds support for Dockerfile commands to have options - e.g:
   COPY --user=john foo /tmp/
   COPY --ignore-mtime foo /tmp/

Supports both booleans and strings.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-28 05:28:46 -07:00
Phil Estes
67da055ceb Merge pull request #12826 from cpuguy83/12825_fix_leftover_container_json
Fix undead containers
2015-04-28 08:11:40 -04:00
moxiegirl
6ac481296d Merge pull request #12723 from moxiegirl/carry-11296
Integrating Windows Testing Material
2015-04-28 04:56:17 -07:00
Qiang Huang
c7812f01c7 fix a minor inspect format issue
Before, inspect cont1 cont2 shows:
[{
    xxx
}
,{
    xxx
}
]
After, it shows:
[
{
   xxx
}
,{
    xxx
}
]

Because `func (*Encoder) Encode` always followed by a newline character,
so it's difficult to put '}' and ']' one the same line.

To get symmetry, above is our choice.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-28 18:51:04 +08:00
Peter Salvatore
8f52eb7b82 Rewrite Official Repositories page.
The existing page is focused on listing a set of requirements for
proposing a new repository.  This information has become outdated and is
duplicated in the `docker-library/official-images` and
`docker-library/docs` GitHub repositories.  This PR rewrites the
Official Repositories page to describe what they actually are, and
defers to GitHub/IRC for the subset of users that are interested in
contributing.  I also removed the requirement to contact
partners@docker.com and made it optional to reduce the barrier to entry.

Signed-off-by: Peter Salvatore <peter@psftw.com>
2015-04-28 00:37:17 -04:00
Jessica Frazelle
af8efab756 add initial docs for windows client testing
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)

docs: crop and optimize images

Cropped and optimized images.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Testing and updating the Windows material

Signed-off-by: Mary Anthony <mary@docker.com>

checkpoint

Signed-off-by: Mary Anthony <mary@docker.com>

Fitting the Windows specific material into the contributor guide

Signed-off-by: Mary Anthony <mary@docker.com>

Entering James comments

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-27 21:21:53 -07:00
Sebastiaan van Stijn
779939e334 Merge pull request #12817 from WeiZhang555/man
improve docker man page
2015-04-27 22:59:11 -04:00
Doug Davis
82daa43844 Fix for Daemon crashing when wildcards are used for COPY/ADD
in the filename and the command itself

Closes #12267

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-27 19:09:57 -07:00
Jessica Frazelle
2afcd10202 option to configure cgroups
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-27 17:50:39 -07:00
moxiegirl
aebeefa886 Merge pull request #12798 from dnephin/add_missing_docs_about_labels
Add missing API docs about filtering by label
2015-04-27 17:37:10 -07:00
Jessica Frazelle
d4bbbe58dd Add docs for --exec-opt and setting native.cgroupdriver.
update man pages.
update bash completion.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
2015-04-27 17:04:28 -07:00
moxiegirl
9018f873c8 Merge pull request #12796 from moxiegirl/add-to-docs-maintainers
Adding James and theJeztah to the list
2015-04-27 16:32:15 -07:00
Alexander Morozov
57464c32b9 Implement daemon suite for integration-cli
For creating and stopping test daemons automatically.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-27 15:48:29 -07:00
Brian Goff
a07e963526 Merge pull request #11882 from hqhq/hq_warn_device_cg
add devices cgroup check as hard requirement
2015-04-27 18:42:57 -04:00
moxiegirl
13895173eb Merge pull request #12801 from thewtex/doc-test-ubuntu
Do Debian installation verification with hello-world image.
2015-04-27 15:09:25 -07:00
Phil Estes
0153edcda1 Merge pull request #12828 from tdmackey/trivial-spelling
trivial: typo cleanup
2015-04-27 17:05:46 -04:00
Tibor Vass
62a85fe202 Merge pull request #12794 from runcom/small-cleaning
Small if err cleaning
2015-04-27 17:02:27 -04:00
Brian Goff
c3c08f76be Fix undead containers
When a container has errors on removal, it gets flagged as dead.
If you `docker rm -f` a dead container the container is dereffed from
the daemon and doesn't show up on `docker ps` anymore... except that the
container JSON file may still be lingering around and becomes undead
when you restart the daemon.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-27 16:45:51 -04:00
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07:00
Daniel Antlinger
50868b2c57 fixed TestDiffEnsureDockerinitFilesAreIgnored is too long #12672
Signed-off-by: Daniel Antlinger <d.antlinger@gmx.at>
2015-04-27 13:24:15 -07:00
Brian Goff
2f513db31d Merge pull request #12719 from fntlnz/12675-test-events-emit
Parallelize TestEventsLimit
2015-04-27 16:02:33 -04:00
Antonio Murdaca
844538142d Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 21:50:33 +02:00
Lorenzo Fontana
40779b28bb Parallelize TestEventsLimit
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-04-27 21:14:00 +02:00
Jessie Frazelle
531ec3cac9 Merge pull request #12532 from ankushagarwal/eliminate-json-marshal
Eliminate json.Marshal from graph/export.go and volumes/volume.go
2015-04-27 13:54:20 -05:00
Tibor Vass
572ba9cb40 Merge pull request #12333 from Mashimiao/clean-up-viz
Clean up viz code
2015-04-27 14:13:03 -04:00
Matt McCormick
b6cfe7ca07 Do Debian installation verification with hello-world image.
The hello-world image is recommended as a verification image and it is smaller
than Ubuntu.

Signed-off-by: Matt McCormick <matt.mccormick@kitware.com>
2015-04-27 13:53:30 -04:00
David Calavera
f9c27bda1e Merge pull request #12819 from Microsoft/10662-volumesrefactor
Windows: Refactor volumes
2015-04-27 10:25:41 -07:00
Tibor Vass
4ddd448490 Merge pull request #12793 from runcom/bye-unmarshal
Replace json.Unmarshal() with json.Decoder().Decode()
2015-04-27 13:19:43 -04:00
Brian Goff
97b35bab81 Merge pull request #12818 from Microsoft/10662-nocontainercheckonwindows
Windows: Info no containerized check
2015-04-27 12:56:28 -04:00
Antonio Murdaca
bb1c576eb3 Expose whole Response struct in sockRequestRaw
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 18:49:00 +02:00
John Howard
ba1725a94e Windows: Refactor volumes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-27 09:27:15 -07:00
Brian Goff
6856c69c41 Merge pull request #12807 from jmzwcn/patch-2
Remove dead code from daemon/daemon.go
2015-04-27 12:10:30 -04:00
Alexander Morozov
5305e675b5 Merge pull request #12809 from runcom/remove-cfatal-goroutine-attachws
Remove c.Fatal from goroutine in TestGetContainersAttachWebsocket
2015-04-27 08:59:47 -07:00
Jessie Frazelle
9f684c8592 Merge pull request #12714 from noxiouz/fix_race_stats_collector
statsCollector: fix data race in run()
2015-04-27 10:57:56 -05:00
Alexander Morozov
02d73d910f Merge pull request #12799 from aidanhs/aphs-fix-net-container-deadlock
Prevent deadlock on --net=container:<self>
2015-04-27 08:46:22 -07:00
John Howard
ab97303cae Windows: Info no containerized check
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-27 08:38:01 -07:00
Phil Estes
8ec22ae87d Merge pull request #12803 from ZJU-SEL/remove_useless_export_httpcall
remove useless http call from export
2015-04-27 11:33:13 -04:00
Zhang Wei
29f379ea6e improve docker man page
fix issue #12708:
"docker man page is misleading about format of commands"

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-04-27 23:27:35 +08:00
Brian Goff
8dc07af52f Merge pull request #12783 from duglin/Issue12763-LinkedEnvs
A fix for = in env values in linked containers
2015-04-27 10:50:14 -04:00
Doug Davis
325c0404c8 Merge pull request #12616 from cpuguy83/remove_uneeded_sleeps
remove some uneeded sleeps in tests
2015-04-27 10:42:40 -04:00
Brian Goff
9e0ffae864 remove some uneeded sleeps in tests
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-27 10:14:29 -04:00
Aidan Hobson Sayers
f30d1c1835 Prevent deadlock on attempt to use own net
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
2015-04-27 14:57:37 +01:00
Antonio Murdaca
c7b2632dc8 Remove c.Fatal from goroutine in TestGetContainersAttachWebsocket
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 13:56:55 +02:00
jmzwcn
accbbfeae4 Remove dead code from daemon/daemon.go
fix #12492
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
2015-04-27 15:50:47 +08:00
He Simei
6d9439c627 remove useless http call from export
Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-27 12:41:03 +08:00
Jinsoo Park
f930c86cb1 add library files for socat in mkimage-unittest.sh
in https://docs.docker.com/articles/ambassador_pattern_linking/
svendowideit/ambassador images is from docker-ut built using this script
and uses socat but socat complains as follows
socat: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
socat: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
socat: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
socat: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/usr/lib/x86_64-linux-gnu/lib{crypto,ssl}.so* lib are symlinks so removing -P option from cp
adding libreadline.so and libtinfo.so

Signed-off-by: Jinsoo Park <cellpjs@gmail.com>

update libssl.so path

Signed-off-by: Jinsoo Park <cellpjs@gmail.com>

Remove mkimage-unittest.sh

Signed-off-by: Jinsoo Park <cellpjs@gmail.com>
2015-04-26 23:35:19 -04:00
Daniel Nephin
cfd0f53b03 Add missing API docs about filtering by label.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-04-26 15:36:01 -04:00
moxiegirl
6cba3109c2 Merge pull request #12787 from epc/copyedits
Copy edits for typos
2015-04-26 10:40:18 -07:00
Mary Anthony
ba79f0ca1f Adding James and theJeztah to the list
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-26 10:32:43 -07:00
Antonio Murdaca
26543e0309 Replace json.Unmarshal with json.Decoder().Decode()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-26 15:02:01 +02:00
David Calavera
92f4bd59ce Merge pull request #12734 from sergey-alekseev/sergey-alekseev-patch-1
Fix documentation typo in articles/basics.md
2015-04-25 20:33:55 -07:00
Alexander Morozov
fefb836766 Merge pull request #12728 from HuKeping/addtest
Add test for REST API container rename
2015-04-25 17:01:10 -07:00
Nathan LeClaire
9dbe12b792 Migrate integration test to new method
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 17:12:01 -04:00
Marianna
a8dfafc986 Make the docs for --cgroup-parent better
Signed-off-by: Marianna <mtesselh@gmail.com>
2015-04-25 16:35:28 -04:00
Nathan LeClaire
65aba0c9d6 Add dep to test
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 15:25:52 -04:00
Nathan LeClaire
f039c699a4 Fix gofmt
Mischevious comma is mischevious

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-04-25 15:25:52 -04:00
Marianna
f40dd69c97 Add test for cgroup parent flag for build
Signed-off-by: Marianna <mtesselh@gmail.com>
2015-04-25 15:25:52 -04:00
Julien Barbier
81897adcee Adding doc
Signed-off-by: Julien Barbier <write0@gmail.com>
2015-04-25 15:25:51 -04:00
Julien Barbier
bb41193998 Happy birthday Docker! cgroup-parent option for docker build. Thanks to Michael, Nathan and Jessie for their support! #42
Signed-off-by: Julien Barbier <write0@gmail.com>
2015-04-25 15:25:51 -04:00
Ed Costello
fa9299f4c0 Copy edits for typos
Signed-off-by: Ed Costello <epc@epcostello.com>
2015-04-25 15:01:05 -04:00
Alexander Morozov
b5ccfca565 Merge pull request #12784 from duglin/RaceCommit
Fix race condition in API commit test
2015-04-25 10:03:03 -07:00
Doug Davis
cd4f507b42 Fix race condition in API commit test
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-25 05:46:47 -07:00
Doug Davis
bc149be69c A fix for = in env values in linked containers
Closes: #12763

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-25 04:42:43 -07:00
Hu Keping
8f752ffeaf Add test for REST API container rename
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-25 17:19:57 +08:00
Sergey Alekseev
2188c8d2f4 Fix documentation typo in articles/basics.md
Signed-off-by: Sergey Alekseev <sergey.alekseev.minsk@gmail.com>
2015-04-25 11:32:17 +03:00
Alexander Morozov
272e612b65 Merge pull request #12744 from vdemeester/11603-pkg-archive-test-coverage-2
Add coverage on pkg/archive (related to #11603)
2015-04-24 22:12:01 -07:00
Phil Estes
6e9a6f5396 Merge pull request #12765 from LK4D4/registry_suite
Implement DockerRegistrySuite in integration-cli
2015-04-24 23:05:29 -04:00
He Simei
daad696e09 Fix error prompt for pull & import handler postImagesCreate.
Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-25 09:10:32 +08:00
Jessie Frazelle
c3ef6df9c3 Merge pull request #12699 from vbatts/vbatts-init_mnt_ns
contrib/init: unshare mount namespace for inits
2015-04-24 17:52:11 -07:00
Jessie Frazelle
9ad7145dae Merge pull request #12775 from Microsoft/12774-fixtypo
Fixed typo 'configuring'
2015-04-24 17:21:40 -07:00
John Howard
ae9905ef9c Fixed typo 'configuring'
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-24 16:52:32 -07:00
Ankush Agarwal
29a3bbf2b3 Eliminate json.Marshal from graph/export.go and volumes/volume.go
Fixes #12531
Fixes #12530

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-24 15:40:21 -07:00
Alexander Morozov
602fd4e14b Merge pull request #12764 from LK4D4/not_protect_dangling
Not protect dangling images for integration-cli
2015-04-24 14:19:55 -07:00
Alexander Morozov
f696b1071a Implement DockerRegistrySuite in integration-cli
To avoid manually creating and destroying registrys in tests.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 14:17:00 -07:00
Brian Goff
aa064621dd Merge pull request #12762 from ibuildthecloud/export-restart-parse
Expose ParseRestartPolicy
2015-04-24 16:30:18 -04:00
Alexander Morozov
9bea123bdd Not protect dangling images for integration-cli
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 13:16:51 -07:00
Brian Goff
b76bbae413 Merge pull request #12755 from LK4D4/use_f_for_remove
Use -f for rm instead of kill before
2015-04-24 15:34:38 -04:00
Darren Shepherd
366ee6bdfa Expose ParseRestartPolicy
ParseRestartPolicy is useful function for third party go programs to use
so that they can parse the restart policy in the same way that Docker
does

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-04-24 12:23:54 -07:00
Alexander Morozov
887ad57cfa Use -f for rm instead of kill before
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 11:55:54 -07:00
Brian Goff
03719be830 Merge pull request #12754 from LK4D4/carry_12707
fix runtime issue for TestEventsFilterContainer
2015-04-24 14:36:58 -04:00
Doug Davis
700056cd4c Merge pull request #12753 from LK4D4/remove_all_images
Implement teardown removeAllImages
2015-04-24 14:16:04 -04:00
Anton Tiurin
11a5f1af01 statsCollector: fix data race in run()
statsCollector.publishers must be protected to prevent
modifications during the iteration in run().
Being locked for a long time is bad, so pairs of containers &
publishers (pointers) are copied to release the lock fast.

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-04-24 21:07:48 +03:00
Daniel Antlinger
07795c3f5d fix runtime issue for TestEventsFilterContainer
Signed-off-by: Daniel Antlinger <d.antlinger@gmx.at>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:48:40 -07:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Alexander Morozov
790c63a5ef Merge pull request #12502 from calavera/shallow_git_history
Shallow clone using git to build images.
2015-04-24 10:16:01 -07:00
David Calavera
1cfb307d70 Remove duplicated git clone logic.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:45 -07:00
David Calavera
8bd5a95e1e Document the extra depth argument in git contexts.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:39 -07:00
David Calavera
3117bf3ef5 Test that we set the right arguments for git cloning depending on the transport.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
David Calavera
9fb7204a41 Do not try to shallow git history when the protocol doesn't allow it.
This only happens with the old git http dumb protocol, but that's what we use in our integration tests.
We check the Content-Type header advertised in http requests to make sure the http transport is the git smart transport:

See this commit as a reference:
4656bf47fc

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
David Calavera
36fbf4b864 Shallow clone using git to build images.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-24 09:39:38 -07:00
Phil Estes
310fc37fe7 Merge pull request #12678 from vdemeester/fix-advanced-contributing-doc
Documentation: fix the design proposal link in advanced contribution page
2015-04-24 11:12:36 -04:00
Vincent Demeester
c21d408ad2 Add coverage on pkg/archive
Add tests on:
- changes.go
- archive.go
- wrap.go

Should fix #11603 as the coverage is now 81.2% on the ``pkg/archive``
package. There is still room for improvement though :).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-24 17:03:33 +02:00
Aleksa Sarai
b7c3c0cb69 *: switch to Get(Root)?ResourcePath where appropriate
Several parts of the codebase didn't use the correct path sanitisation
wrappers. Now that the wrappers have been exposed, use those.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2015-04-25 00:10:29 +10:00
Aleksa Sarai
4377ebd6a7 *: expose getResourcePath and getRootResourcePath wrappers
Due to the importance of path safety, the internal sanitisation wrappers
for volumes and containers should be exposed so other parts of Docker
can benefit from proper path sanitisation.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2015-04-24 23:53:47 +10:00
Fred Lifton
300a12f9aa Merge pull request #12729 from SvenDowideit/dhe-documentation-master-pr
Dhe documentation master pr
2015-04-23 21:22:56 -07:00
Sven Dowideit
b0ad95daa8 Copy over the DHE documentation for release to docs.docker.com
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-04-24 12:39:58 +10:00
Sven Dowideit
493437616d make space for DHE menu item again
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-04-24 12:39:49 +10:00
Brian Goff
016a2d6d9d Merge pull request #12587 from coolljt0725/add_cpu_cfs_quota_to_build
Add cpu cfs quota to build
2015-04-23 21:28:46 -04:00
Lei Jitang
5f4fb8be00 Add cpu cfs quota to build
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-24 08:54:08 +08:00
Qiang Huang
667b1e220c simplify memory limit check
If memory cgroup is mounted, memory limit is always supported,
no need to check if these files are exist.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-24 08:43:44 +08:00
Ma Shimiao
66acef865d clean up viz code
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-24 08:38:14 +08:00
Qiang Huang
47e5acfbae add devices cgroup check and errors
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-24 08:37:59 +08:00
moxiegirl
09052a5572 Merge pull request #12712 from moxiegirl/carry-docs-update-9397
Removing firewalld info
2015-04-23 17:24:27 -07:00
Jessie Frazelle
9d94d91ea7 Merge pull request #12569 from kostickm/12449-check-statusCode
Fixing statusCode checks for sockRequest
2015-04-23 17:13:06 -07:00
Michael Crosby
c26695cf8a Merge pull request #12659 from dqminh/exec-interactive-hang
reuse same code for setting pipes in run/exec
2015-04-23 16:37:49 -07:00
Jessie Frazelle
2ebfc7c874 Merge pull request #12710 from runcom/bye-engine-from-graph
Remove engine/job from graph
2015-04-23 15:42:50 -07:00
Megan Kostick
c7845e27ee Fixing statusCode checks for sockRequest
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-23 15:35:56 -07:00
Fred Lifton
b830b823cd Merge pull request #12711 from Shopify/fix_doc
[docs] small markup fix
2015-04-23 15:07:46 -07:00
Daniel, Dao Quang Minh
ade8146aa8 reuse same code for setting pipes in run/exec
This also moves `exec -i` test to _unix_test.go because it seems to need a
pty to reliably reproduce the behavior.

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-04-23 21:54:21 +00:00
Antonio Murdaca
fa2c68a89e Remove engine/job from graph
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 23:36:29 +02:00
Alexander Morozov
96ef1bd29c Merge pull request #12709 from vdemeester/12705-remove-defer-deleteContainer
delete "defer deleteContainer" on tests
2015-04-23 14:34:23 -07:00
Florian Weingarten
55d1ac645c [docs] fix formatting issue
Signed-off-by: Florian Weingarten <flo@hackvalue.de>
2015-04-23 21:17:12 +00:00
Mary Anthony
b6d8b65e55 Removing firewalld info
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-23 14:04:36 -07:00
Tibor Vass
259effc6df Merge pull request #9397 from jpopelka/9395-firewalld
Firewalld support
2015-04-23 16:58:08 -04:00
Jessie Frazelle
6b8d8a5847 Merge pull request #12417 from hashneo/patch-1
What if authConfig or factory is Nill?
2015-04-23 13:54:47 -07:00
Jessie Frazelle
b31d154294 Merge pull request #12509 from runcom/12499-racy-TestEventsImageImport
Fix TestEventsImageImport racy
2015-04-23 13:28:43 -07:00
Vincent Demeester
c5ef2901d8 delete "defer deleteContainer" on tests
Since docker test suite is now using gocheck, ``defer
deleteContainer(…)`` is not needed anymore.

Fixes #12705

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-23 22:27:46 +02:00
Jessie Frazelle
59ae92d55c Merge pull request #12575 from brahmaroutu/integration_test7_12255
Move https tests as unit tests under client
2015-04-23 13:17:54 -07:00
Jessie Frazelle
68fc79f592 Merge pull request #12655 from jlhawn/fix_12281
Validate repo name before image pull
2015-04-23 13:12:12 -07:00
Alexander Morozov
799cf056e7 Merge pull request #11839 from brahmaroutu/template_11641
Allow go template to work properly with inspect …
2015-04-23 13:07:40 -07:00
Jessie Frazelle
052cba7278 Merge pull request #12674 from TomasTomecek/fix-v1-spec-typos
v1 spec: fix typos and formatting
2015-04-23 13:07:21 -07:00
Jessie Frazelle
036ade6c05 Merge pull request #12693 from runcom/fix-TestRenameStoppedContainer-race
Fix TestRenameStoppedContainer race
2015-04-23 13:04:36 -07:00
Jessie Frazelle
1492a7d7fd Merge pull request #12702 from LK4D4/good_ol_flushed
Return weird behaviour of returning json errors
2015-04-23 13:03:29 -07:00
Arnaud Porterie
c4914f071f Merge pull request #12577 from jfrazelle/actually-depreciate-rm
actually depreciate -rm insteam of --rm.. and a few others
2015-04-23 11:55:20 -07:00
Alexander Morozov
9ed5bfb083 Merge pull request #12636 from duglin/MoveConfig
Move CLI config processing out from under registry dir
2015-04-23 11:50:31 -07:00
Josh Hawn
18f4688385 Validate repo name before image pull
Checks for reserved 'scratch' image name.

fixes #12281

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-04-23 11:44:46 -07:00
Jessie Frazelle
03e77e5c8f Merge pull request #12690 from rajdeepd/dry-run-test
Container API Test with HostName
2015-04-23 11:32:47 -07:00
Jessie Frazelle
59acccb6f2 Merge pull request #12692 from cpuguy83/fix_commit_test
Fix race with TestContainerApiCommit
2015-04-23 11:31:27 -07:00
Brian Goff
2c70288ca6 Merge pull request #12703 from LK4D4/carry_12596
remove job from image_export
2015-04-23 14:27:59 -04:00
Srini Brahmaroutu
231d362db7 Allow go template to work properly with inspect
Closes #11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-23 18:25:18 +00:00
Alexander Morozov
d17f2baa81 Merge pull request #12646 from duglin/validateTests
Validate we're not using the old testing stuff
2015-04-23 11:23:20 -07:00
Jessie Frazelle
2345389975 Merge pull request #12687 from WeiZhang555/NotFound
refactor httpError() and add 404 "not found" mapping
2015-04-23 11:21:09 -07:00
Alexander Morozov
dcbf89d023 Merge pull request #12500 from tianon/fix-daemon-logic
Fix daemon start/stop logic in hack/make/* scripts
2015-04-23 11:20:33 -07:00
Vincent Batts
b6569b6b82 contrib/init: unshare mount namespace for inits
* openrc
* sysvinit-debian
* upstart

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-23 14:08:37 -04:00
Simei He
2a14b7dd35 remove job from image_export
Signed-off-by: He Simei <hesimei@zju.edu.cn>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-23 10:54:25 -07:00
Tianon Gravi
929af4c38d Fix daemon start/stop logic in hack/make/* scripts
From the Bash manual's `set -e` description:
(https://www.gnu.org/software/bash/manual/bashref.html#index-set)

> Exit immediately if a pipeline (see Pipelines), which may consist of a
> single simple command (see Simple Commands), a list (see Lists), or a
> compound command (see Compound Commands) returns a non-zero status.
> The shell does not exit if the command that fails is part of the
> command list immediately following a while or until keyword, part of
> the test in an if statement, part of any command executed in a && or
> || list except the command following the final && or ||, any command
> in a pipeline but the last, or if the command’s return status is being
> inverted with !. If a compound command other than a subshell returns a
> non-zero status because a command failed while -e was being ignored,
> the shell does not exit.

Additionally, further down:

> If a compound command or shell function executes in a context where -e
> is being ignored, none of the commands executed within the compound
> command or function body will be affected by the -e setting, even if
> -e is set and a command returns a failure status. If a compound
> command or shell function sets -e while executing in a context where
> -e is ignored, that setting will not have any effect until the
> compound command or the command containing the function call
> completes.

Thus, the only way to have our `.integration-daemon-stop` script
actually run appropriately to clean up our daemon on test/script failure
is to use `trap ... EXIT`, which we traditionally avoid because it does
not have any stacking capabilities, but in this case is a reasonable
compromise because it's going to be the only script using it (for now,
at least; we can evaluate more complex solutions in the future if they
actually become necessary).

The alternatives were much less reasonable.  One is to have the entire
complex chains in any script wanting to use `.integration-daemon-start`
/ `.integration-daemon-stop` be chained together with `&&` in an `if`
block, which is untenable.  The other I could think of was taking the
body of these scripts out into separate scripts, essentially meaning
we'd need two files for each of these, which further complicates the
maintenance.

Add to that the fact that our `trap ... EXIT` is scoped to the enclosing
subshell (`( ... )`) and we're in even more reasonable territory with
this pattern.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-23 11:31:16 -06:00
Doug Davis
ecccfa82aa Validate we're not using the old testing stuff
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:29:47 -07:00
Alexander Morozov
ec51ba01db Return weird behaviour of returning json errors
We need this, so client can get error from stream and not from status
code, which is already 200, because write to ResponseWriter was occured.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-23 10:27:37 -07:00
Doug Davis
bb9da6ba92 Move CLI config processing out from under registry dir
No logic changes should be in here, just moving things around.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:18:38 -07:00
Alexander Morozov
fa3e2dd45e Merge pull request #12691 from runcom/remove-deleteAllContainers-call
Remove deleteAllContainers call in test
2015-04-23 10:01:08 -07:00
Alexander Morozov
2351b87551 Merge pull request #12505 from ZJU-SEL/remove_job_from_push
remove job from push
2015-04-23 09:57:17 -07:00
Alexander Morozov
71ac5b7903 Merge pull request #12681 from hqhq/hq_fix_test_in_apiserver
fix test case name
2015-04-23 09:21:00 -07:00
Srini Brahmaroutu
05013f1250 Move https integration tests as unit tests under client
Addresses #12255
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-23 15:40:46 +00:00
Brian Goff
455d83939a Merge pull request #12683 from tristan0x/patch-1
Fix typo in builder reference
2015-04-23 11:12:49 -04:00
Antonio Murdaca
ee7a7b07e7 Remove deleteAllContainers call in test
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 16:32:50 +02:00
Antonio Murdaca
cd6cc45d52 Fix TestRenameStoppedContainer race
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 16:11:46 +02:00
Rajdeep Dua
fca4aea077 TestCase added for Container Create with HostName
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
2015-04-23 06:53:34 -07:00
Brian Goff
563708d78d Fix race with TestContainerApiCommit
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-23 09:45:06 -04:00
Simei He
d456401fe1 remove job from push
Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-23 21:21:56 +08:00
Doug Davis
1b4de6f2e8 Merge pull request #12579 from ZJU-SEL/remove_job_from_load
remove job from load
2015-04-23 08:20:37 -04:00
Doug Davis
d59ce5cd48 Merge pull request #12663 from Mashimiao/Move-setHostConfig-to-daemon-file
Move setHostConfig to daemon file
2015-04-23 07:43:42 -04:00
Doug Davis
f4cfaac519 Merge pull request #12680 from Mashimiao/fix-typo-push-test
push test: fix typo
2015-04-23 07:37:50 -04:00
Zhang Wei
ab42a3a23a refactor httpError() and add 404 "not found" mapping
When docker pull a non-existent repo, daemon will report "image xxx not found"
with an error code 500, which should be 404.
This commit add 404 "not found" mapping and refactor httpError function.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-04-23 19:37:47 +08:00
Simei He
70bb0d8ed7 remove job from load
Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-23 19:13:12 +08:00
Qiang Huang
a8d2fbe7b4 fix test case name
Name like this will never run by go test. And this test case won't
get PAAS.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-23 18:41:30 +08:00
Tristan Carel
47263c6514 Fix typo in builder reference
Signed-off-by: Tristan Carel <tristan.carel@gmail.com>
2015-04-23 12:10:47 +02:00
Ma Shimiao
62f91b1d34 push test: fix typo
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-23 16:50:41 +08:00
Vincent Demeester
1f7ba6f809 Fix the design proposal link in advanced contribution page
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-23 09:48:11 +02:00
Tomas Tomecek
d6c839cf0f v1 spec: fix typos and formatting
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2015-04-23 08:19:52 +02:00
Sven Dowideit
fdc5aa2043 Merge pull request #12599 from RickWieman/10673-make-headings-consistent
Makes headings in documentation consistent
2015-04-23 16:15:10 +10:00
Rick Wieman
6359326761 Makes headings in documentation consistent
Fixes #10673.

Signed-off-by: Rick Wieman <git@rickw.nl>
2015-04-23 07:41:30 +02:00
Ma Shimiao
05418df539 sysinfo: add IPv4Forwarding check
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-23 12:19:46 +08:00
Doug Davis
eae272f90e Merge pull request #12390 from hqhq/hq_fix_inspect
fix inspect format result
2015-04-22 23:06:13 -04:00
Ma Shimiao
dde0cc78bd Move setHostConfig to daemon file
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-23 10:23:02 +08:00
Brian Goff
6bacb4528e Merge pull request #12582 from ankushagarwal/add-docker-history-integration-test
Add integration test for history option
2015-04-22 22:09:01 -04:00
Brian Goff
60ad23a7b3 Merge pull request #12543 from vdemeester/11584-pkg-stdcopy-test-coverage
Add some stdcopy_test (coverage)
2015-04-22 22:03:15 -04:00
Qiang Huang
b0ef3194aa fix inspect format result
Currently `docker inspect -f` use json.Unmarshal() unmarshal
to interface, it will store all JSON numbers in float64, so
we use `docker inspect 4f0d73b75a0d | grep Memory` and
`docker inspect -f {{.HostConfig.Memory}} 4f0d73b75a0d` will
get different values.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-23 09:28:07 +08:00
Brian Goff
480d979c27 Merge pull request #12654 from jfrazelle/12135-docker-delete-multiple-tagged
add regression test for rmi multiple tags without f
2015-04-22 21:08:07 -04:00
Brian Goff
3872272170 Merge pull request #12406 from runcom/remove-job-container-inspect
Remove job from container_inspect
2015-04-22 21:05:15 -04:00
Jessie Frazelle
cc43263f8c Merge pull request #12652 from jfrazelle/update-contrib-docs-for-go-check
update contrib docs for gocheck
2015-04-22 17:47:22 -07:00
Doug Davis
5ea8dc376c Merge pull request #12649 from jlhawn/fix_pull_err_explosion
Correctly format API error on image pull
2015-04-22 20:28:24 -04:00
Alexander Morozov
3dc07162bd Merge pull request #12557 from rhatdan/journald
Add journald as a supported logger for containers
2015-04-22 17:20:10 -07:00
Jessie Frazelle
505788deb2 Merge pull request #10422 from cpuguy83/cleanup_daemon_volumes
Cleanup daemon/volumes
2015-04-22 17:13:47 -07:00
Sven Dowideit
b6702116be Merge pull request #12615 from moxiegirl/update-repository-links
Fixing a few links in registry
2015-04-23 10:02:02 +10:00
Sven Dowideit
84a9962a63 Merge pull request #12614 from ankushagarwal/ubuntu-docs
Add Configuring Docker article
2015-04-23 09:41:11 +10:00
Brian Goff
f3680e7494 Cleanup daemon/volumes
- Mount struct now called volumeMount
- Merged volume creation for each volume type (volumes-from, binds, normal
  volumes) so this only happens in once place
- Simplified container copy of volumes (for when `docker cp` is a
  volume)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-22 19:32:10 -04:00
Sven Dowideit
ce7e1a4d7e Merge pull request #12586 from ankushagarwal/image-digests
Add Image Digest doc in userguide/dockerimages
2015-04-23 09:23:23 +10:00
Jessie Frazelle
1d48cccc99 Merge pull request #10992 from cpuguy83/add_volume_mounting_for_cp
Make `docker cp` bind-mount volumes
2015-04-22 15:59:28 -07:00
Sven Dowideit
b2aca01d95 Merge pull request #12513 from allingeek/patch-1
builder.md - Changes to bring LABEL docs in line with 1.6 release.
2015-04-23 08:58:59 +10:00
Antonio Murdaca
4b9fe9c298 Remove job from container_inspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 00:58:13 +02:00
Sven Dowideit
20b1aa08f8 Merge pull request #12460 from moxiegirl/fix-carry-12383
Putting into our new format for cloud
2015-04-23 08:52:56 +10:00
Jessie Frazelle
3c9ae03a86 Merge pull request #12650 from LK4D4/carry_12472
remove execCreate & execStart from job
2015-04-22 15:32:14 -07:00
Alexander Morozov
7708ab5ce2 Merge pull request #12657 from dqminh/remove-unused-utils
remove unused utils
2015-04-22 15:23:57 -07:00
Daniel, Dao Quang Minh
71b5a754ce remove unused utils
Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-04-22 21:53:45 +00:00
Dan Walsh
b88b2fa72e Merge branch 'master' of github.com:docker/docker into journald
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-04-22 17:37:26 -04:00
Jessica Frazelle
28f5541b72 add regression test for rmi multiple tags without f
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-04-22 14:23:05 -07:00
Jessica Frazelle
7a525c6cb7 add integration test for error pull nonexistent
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-04-22 14:11:25 -07:00
Josh Hawn
fd4f7c4e5c Correctly format API error on image pull
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-04-22 14:11:25 -07:00
Alexander Morozov
29265448ec Merge pull request #12621 from LK4D4/test_push_interrupt_daemon
Run TestPushInterrupt on separate daemon
2015-04-22 14:05:37 -07:00
jianbosun
24425021d2 remove execCreate & execStart from job
Also removed the function ExecConfigFromJob

Signed-off-by: Sun Jianbo <wonderflow@zju.edu.cn>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-22 13:51:57 -07:00
Alexander Morozov
c09765ac43 Wait until all pushes are done in TestPushInterrupt
Background pushes affects other tests

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-22 13:36:43 -07:00
Jessica Frazelle
a09ab40f0d update contrib docs for gocheck
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-04-22 13:19:14 -07:00
Alexander Morozov
975e668722 Merge pull request #12588 from hqhq/hq_fix_cpuquota_warn
remove redundant warning
2015-04-22 13:07:21 -07:00
Ankush Agarwal
08150150bb Add integration test for history option
Parse the history output to locate the size fields and check
whether they are the correct format or not. Use Column name SIZE
to mark start and end indices of the size fields

Fixes #12578

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-22 12:22:01 -07:00
Jessie Frazelle
e3e1c2be42 Merge pull request #12376 from Mic92/refactor-hack
Refactor shellscripts
2015-04-22 12:12:44 -07:00
Brian Goff
6f94ca6d8b Merge pull request #12647 from duglin/FixTesting
Remove old testing stuff that slipped into master
2015-04-22 14:47:37 -04:00
Doug Davis
b4988d8d75 Remove old testing stuff that slipped into master
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-22 11:44:54 -07:00
Michael Crosby
614a9690e7 Mount RO for timer_stats and latency_stats in proc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-22 11:15:26 -07:00
Michael Crosby
545b440a80 Mount /proc/fs as readonly
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-22 11:15:17 -07:00
Michael Crosby
3162024e28 Prevent write access to /proc/asound
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	integration-cli/docker_cli_run_test.go
2015-04-22 11:14:46 -07:00
Brian Goff
901ae9aaea Merge pull request #12623 from peggyl/api-client-docs
Fix golint errors in docker/api/client
2015-04-22 14:09:23 -04:00
Tianon Gravi
5728426f27 Merge pull request #12637 from sublimino/patch-1
Add kali to install script
2015-04-22 11:05:13 -07:00
Jessie Frazelle
fd3b722928 Merge pull request #12634 from PeterDaveHello/patch-2
Use svg instead of png to get better image quality
2015-04-22 10:53:47 -07:00
Ankush Agarwal
9689aab5ec Update with @moxiegirl's patch and add direct config
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-22 10:36:38 -07:00
Antonio Murdaca
eeb8ceb9ed Fix TestEventsImageImport racy, fixes #12499
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-22 17:30:30 +02:00
Andrew Martin
2dd88af79b Add kali to install script
https://www.kali.org/ is a Debian derivative. This script completes
succesfully using the Debian install path

Signed-off-by: Andrew Martin <sublimino@gmail.com>
2015-04-22 14:56:00 +01:00
Peter Dave Hello
b121d94369 Use svg instead of png to get better image quality
Signed-off-by: Peter Dave Hello <hsu@peterdavehello.org>
2015-04-22 18:45:29 +08:00
Peggy Li
58065d0dd9 Fix golint errors in docker/api/client
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-04-22 00:14:23 -07:00
Gosuke Miyashita
90a8e45604 Append icc related iptables rules, not INSERT
Signed-off-by: Gosuke Miyashita <gosukenator@gmail.com>
2015-04-22 11:45:46 +09:00
Mary Anthony
54ff1dcb82 Fixing a few links in registry
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-21 18:36:37 -07:00
Ankush Agarwal
9424fc14bb Add Configuring Docker article [WIP]
Fixes #12088

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-21 17:49:29 -07:00
Qiang Huang
f3dc351697 remove redundant warning
And warning is not supposed to have a prefix WARNING.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-22 08:15:00 +08:00
Brian Goff
ccbb93e1cd Merge pull request #12611 from LK4D4/remove_eng_chain_pull
Remove chain of engine passing from builder to loadManifest
2015-04-21 19:19:56 -04:00
Arnaud Porterie
61854b171d Merge pull request #12511 from LK4D4/gocheck_suites
Gocheck suites
2015-04-21 15:42:33 -07:00
Vivek Goyal
ddc8acebec devmapper: Cancel deferred deactivation if device is reactivated
If device is being reactivated before it could go away and deferred 
deactivation is scheduled on it, cancel it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
4986ce7cfb devicemapper: Create a method to get device info with deferred remove field
Deferred reove functionality was added to library later. So in old version
of library it did not report deferred_remove field. 

Create a new function which also gets deferred_remove field and it will be
called only on newer version of library. 

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
20b38f427a devicemapper: Create helpers to cancel deferred deactivation
If a device has been scheduled for deferred deactivation and container
is started again and we need to activate device again, we need to cancel
the deferred deactivation which is already scheduled on the device.

Create a method for the same.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
66a53819ae devmapper: Export deferred removal status in status
This will help with debugging as one could just do "docker info" and figure
out of deferred removal is enabled or not.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
e37c7203bb devmapper: Use deferred removal
Make use of deferred removal of devices.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
15c158b207 devmapper: Provide a new parameter dm.deferred_device_removal
Provide a new command line knob dm.deferred_device_removal which will enable
deferred device deactivation if driver and library support it.

This patch also checks for library support and driver version.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
6964ab94be devicemapper: Add helper functions to allow deferred device removal
A lot of time device mapper devices leak across mount namespace which docker
does not know about and when docker tries to deactivate/delete device,
operation fails as device is open in some mount namespace.

Create a mechanism where one can defer the device deactivation/deletion
so that docker operation does not fail and device automatically goes
away when last reference to it is dropped.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Vivek Goyal
b3e29926ce make.sh: Define a new build tag libdm_no_deferred_remove
libdm started offering deferred remove functionality from version
1.02.89. As docker still builds against older libdm, define a tag
libdm_no_deferred_remove to determine whether we are compiling
against new libdm or older one and enable/disable deferred remove
functionality accordingly.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-21 18:14:59 -04:00
Alexander Morozov
a2f74aa4b4 Remove chain of engine passing from builder to loadManifest
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 14:55:23 -07:00
Mary Anthony
bc7a43cb44 Putting into our new format for cloud
Adding in Seb's comments
Updating with Fred's comments

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-21 14:48:48 -07:00
Fred Lifton
21c8d211e1 Merge pull request #12536 from mountkin/remove-unsupported-instructions-from-doc
Remove some unsupported instructions in the docs.
2015-04-21 14:08:31 -07:00
Alexander Morozov
7ba8c3b26f Merge pull request #12567 from brahmaroutu/integration_test6_12255
moving integration tests to graph unit tests
2015-04-21 13:58:02 -07:00
Brian Goff
725ea8c09e Merge pull request #12600 from LK4D4/remove_image_set
Remove image_set engine job
2015-04-21 16:51:46 -04:00
Brian Goff
b098a42559 Merge pull request #12564 from LK4D4/remove_jobs_trust
Remove engine from trust
2015-04-21 16:49:01 -04:00
Alexander Morozov
783dbcade3 Merge pull request #12609 from runcom/remove-not-needed-readHostConfig
Remove not needed call to container.readHostConfig()
2015-04-21 13:45:48 -07:00
Alexander Morozov
79a7fedcd8 Remove image_set engine job
It was unused

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 13:04:28 -07:00
Antonio Murdaca
a3c4801c92 Remove not needed call to container.readHostConfig()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-21 22:00:33 +02:00
Ankush Agarwal
a4676503d9 Add Image Digest doc in userguide/dockerimages
Fixes #12551

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-21 12:47:09 -07:00
Doug Davis
b807ac1115 Merge pull request #12601 from runcom/remove-job-image-get
Remove job image_get
2015-04-21 15:31:42 -04:00
Antonio Murdaca
d07fe18365 Remove job image_get
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-21 21:01:09 +02:00
Brian Goff
6f82613ded Merge pull request #12604 from runcom/remove-job-image-tarlayer
Remove job image_tarlayer
2015-04-21 14:53:54 -04:00
Antonio Murdaca
ba0017595e Remove job image_tarlayer
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-21 19:59:45 +02:00
Alexander Morozov
dc944ea7e4 Use suite for integration-cli
It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00
Alexander Morozov
6dcdf832a3 Add gocheck to vendored deps
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00
Dan Walsh
364287b741 Add journald as a supported logger for containers
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-04-21 12:57:54 -04:00
Alexander Morozov
371b39c26f Merge pull request #12598 from runcom/remove-writeJSONEnv
Remove writeJSONEnv, fixes #12597
2015-04-21 09:54:55 -07:00
Antonio Murdaca
27811355bd Remove writeJSONEnv
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-21 18:14:39 +02:00
James Turnbull
afd5636461 Merge pull request #12563 from kentoj/patch-1
Clarify data volume init with existing data
2015-04-21 08:57:22 -07:00
Jörg Thalheim
f731b01483 Dockerfile: download go libraries before copy vendor
When ever something vendor/ changes the go dependencies have to downloaded again,
which requires internet access and there for is potential slow. COPY and go install is much faster, while the git urls does not change not this often.

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-21 11:41:09 +02:00
Jessie Frazelle
17d5450bc3 Merge pull request #10736 from coolljt0725/add_cpu_limit
Add support cpu cfs_quota
2015-04-20 17:55:01 -07:00
Tianon Gravi
e562495d56 Merge pull request #12181 from inatatsu/enable-netgo-with-gccgo
Enable "netgo" library when we build with gccgo
2015-04-20 17:31:49 -07:00
Jessie Frazelle
47b703593e Merge pull request #12430 from icecrime/11551_carry
Add -H|--human command-line flag to `docker history`
2015-04-20 17:28:24 -07:00
Jessie Frazelle
82f75df9e9 Merge pull request #12457 from calavera/remove_engine_job_builder
Remove engine.Job from Builder.
2015-04-20 17:27:17 -07:00
Jessie Frazelle
874d64e690 Merge pull request #12517 from mavenugo/master
Enhanced port integration-cli tests
2015-04-20 17:26:48 -07:00
Jessie Frazelle
4bb8924b52 Merge pull request #12539 from WeiZhang555/httpError
change httpError logic
2015-04-20 17:26:09 -07:00
Jessica Frazelle
f3d4c33213 actually depreciate -rm, -sig-proxy, -name, seriously its been forever
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-04-20 17:20:23 -07:00
Jessie Frazelle
4a25c5d25b Merge pull request #12533 from ankushagarwal/gofmt-directory
gofmt 1.4.2  src directory
2015-04-20 17:02:43 -07:00
Jessie Frazelle
e1fd7e25de Merge pull request #12566 from fntlnz/remove-go1.3.3-support
Removed go1.3.3 support
2015-04-20 17:01:57 -07:00
Jessie Frazelle
df217120cd Merge pull request #12471 from coolljt0725/fix_weird_output_format
Fix weird terminal output format
2015-04-20 17:01:02 -07:00
Jessie Frazelle
fcacb1793e Merge pull request #12568 from duglin/TweakConfigPerms
Make .docker dir have 0700 perms not 0600
2015-04-20 16:33:10 -07:00
Jessie Frazelle
23ec4cab60 Merge pull request #12556 from icecrime/update_release_checklist
Update release checklist
2015-04-20 16:31:40 -07:00
Arnaud Porterie
a8253ec7e7 Early API version bump
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-20 15:52:26 -07:00
Arnaud Porterie
9838242db1 Merge pull request #9381 from lebauce/default-gateway
Proposal: Allow specifying a default gateway for bridge networking
2015-04-20 15:50:35 -07:00
Jessie Frazelle
d5dc565432 Merge pull request #12416 from ya7ya/patch-1
adding elementary OS to install script
2015-04-20 14:50:16 -07:00
Phil Estes
435643545c Merge pull request #12450 from brahmaroutu/integration_test3_12255
Port test from integration tests - test low memory on create
2015-04-20 17:27:17 -04:00
David Calavera
3b05005a12 Add flusher check to utils.WriteFlusher.
That way we can know when the stream has been flushed.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 14:25:45 -07:00
moxiegirl
27fc39fdc0 Merge pull request #12559 from moxiegirl/fix-12555-rnotes
Adding in 1.60 release notes
2015-04-20 14:18:48 -07:00
Doug Davis
bfeb98a236 Make .docker dir have 0700 perms not 0600
Thanks to @dmcgowan for noticing.

Added a testcase to make sure Save() can create the dir and then
read from it.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-20 14:16:50 -07:00
Lorenzo Fontana
92849fdcce Removed go1.3.3 support
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-04-20 23:09:08 +02:00
Srini Brahmaroutu
29c5596176 moving integration tests to graph unit tests
Addresses #12255
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-20 21:08:45 +00:00
Vincent Demeester
2ed4ed50be Add some stdcopy_test (coverage)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-20 22:58:22 +02:00
David Calavera
ae4063585e Remove engine.Job from builder.CmdBuildConfig.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 13:37:06 -07:00
David Calavera
9a2c009751 Remove engine.Job references from builder.CmdBuild
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-20 13:37:04 -07:00
Mary Anthony
1f4ef5192c Adding in 1.60 release notes
Updating with thaJetzah's comments
Adding in Fred's copy edits

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-20 13:31:22 -07:00
Kent Johnson
ff9f0134ae Clarify data volume init with existing data
Though I am not clear on the intent of the sentence if it means that existing data in the base image is copied into the new volume then the additions I propose make that more clear than the present language.

Signed-off-by: Kent Johnson <kentoj@gmail.com>
2015-04-20 14:24:40 -06:00
moxiegirl
f85eb4baad Merge pull request #12414 from draghuram/projectdoc
Improve documentation in "project" directory.
2015-04-20 13:16:20 -07:00
Alexander Morozov
08ef006d17 Merge pull request #12009 from duglin/AddConfig
Migrate .dockercfg to .docker/config.json and support for HTTP Headers
2015-04-20 13:12:17 -07:00
Doug Davis
18c9b6c645 Add .docker/config.json and support for HTTP Headers
This PR does the following:
- migrated ~/.dockerfg to ~/.docker/config.json. The data is migrated
  but the old file remains in case its needed
- moves the auth json in that fie into an "auth" property so we can add new
  top-level properties w/o messing with the auth stuff
- adds support for an HttpHeaders property in ~/.docker/config.json
  which adds these http headers to all msgs from the cli

In a follow-on PR I'll move the config file process out from under
"registry" since it not specific to that any more. I didn't do it here
because I wanted the diff to be smaller so people can make sure I didn't
break/miss any auth code during my edits.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-20 13:05:24 -07:00
Alexander Morozov
cfe7c9c1b2 Merge pull request #12561 from sergeyevstifeev/12549-fix-test-requires-network
Add missing testRequires(t, Network)
2015-04-20 12:58:30 -07:00
Alexander Morozov
9e50bf6270 Remove engine from trust
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 12:48:33 -07:00
Sergey Evstifeev
716e21be2b Add missing testRequires(t, Network)
Fixes #12552

Signed-off-by: Sergey Evstifeev <sergey.evstifeev@gmail.com>
2015-04-20 21:19:50 +02:00
Alexander Morozov
a7690076c9 Merge pull request #12453 from runcom/style-minor-fixes
Add minor stylistic fixes
2015-04-20 11:51:04 -07:00
Phil Estes
490a0bd697 Merge pull request #12545 from coolljt0725/remove_rudundant_enter
Remove redundant `\n` in daemon/daemon.go
2015-04-20 14:32:27 -04:00
Phil Estes
53edce79f1 Merge pull request #12554 from buddhamagnet/12553-cli-doc-correction
12553 fix typo
2015-04-20 14:30:51 -04:00
Phil Estes
f0016c5917 Merge pull request #12495 from LK4D4/apiserver_refactoring
Refactoring of api/server for reduce engine usage
2015-04-20 14:10:34 -04:00
Srini Brahmaroutu
1a35b16b08 Port test from integration tests
Addresses #12255
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-20 17:57:53 +00:00
buddhamagnet
cdd5d5e4c3 fix typo
Signed-off-by: buddhamagnet <buddhamagnet@gmail.com>
2015-04-20 18:56:21 +01:00
Raghuram Devarakonda
fcdb1fbfa1 Improve documentation in "project" directory.
Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-04-20 13:08:13 -04:00
Alexander Morozov
da7bca4496 Make all http handlers api.server.Server methods
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 09:45:31 -07:00
Zhang Wei
66239ab5c9 change httpError logic
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Signed-off-by: Zhang Wei <zhangwei198900@gmail.com>
2015-04-20 23:26:56 +08:00
Lei Jitang
dcc50e1d59 Add support cpu cfs quota
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-20 08:16:47 -07:00
Alexander Morozov
d9ed316522 Make API server datastructure
Added daemon field to it, will use it later for acces to daemon from
handlers

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 08:13:39 -07:00
Alexander Morozov
181fea24aa Make daemon initialization in main goroutine
It is simplifies code and lead to next refactoring step, where daemon
will be incorporated to some structure which represents API.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-20 08:13:39 -07:00
Alexander Morozov
b5584ec24a Merge pull request #12537 from hqhq/hq_remove_unused_function
remove unused function in server_unit_test.go
2015-04-20 07:51:53 -07:00
Alexander Morozov
d2ce1076a4 Merge pull request #12534 from Mashimiao/delete-unused-function-from-drive
clenaup: delete unused function getEnv
2015-04-20 07:50:06 -07:00
Lei Jitang
2d5ede67c0 Remove redundant '\n' in daemon.go and correct the warning messages for memory swap
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-20 22:00:03 +08:00
Sylvain Baubeau
acb6127c1a Allow specifying a default gateway for bridge networking
Signed-off-by: Sylvain Baubeau <sbaubeau@redhat.com>
2015-04-20 15:13:30 +02:00
Brian Goff
dacc0507f0 Merge pull request #12266 from HuKeping/rmjob-info
Remove Job from Info API
2015-04-20 07:10:57 -04:00
Jiri Popelka
379773905c Firewalld tests
Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
2015-04-20 13:02:09 +02:00
Jiri Popelka
b052827e02 React to firewalld's reload/restart
When firewalld (or iptables service) restarts/reloads,
all previously added docker firewall rules are flushed.

With firewalld we can react to its Reloaded() [1]
D-Bus signal and recreate the firewall rules.
Also when firewalld gets restarted (stopped & started)
we can catch the NameOwnerChanged signal [2].
To specify which signals we want to react to we use AddMatch [3].

Libvirt has been doing this for quite a long time now.

Docker changes firewall rules on basically 3 places.
1) daemon/networkdriver/portmapper/mapper.go - port mappings
   Portmapper fortunatelly keeps list of mapped ports,
   so we can easily recreate firewall rules on firewalld restart/reload
   New ReMapAll() function does that
2) daemon/networkdriver/bridge/driver.go
   When setting a bridge, basic firewall rules are created.
   This is done at once during start, it's parametrized and nowhere
   tracked so how can one know what and how to set it again when
   there's been firewalld restart/reload ?
   The only solution that came to my mind is using of closures [4],
   i.e. I keep list of references to closures (anonymous functions
   together with a referencing environment) and when there's firewalld
   restart/reload I re-call them in the same order.
3) links/links.go - linking containers
   Link is added in Enable() and removed in Disable().
   In Enable() we add a callback function, which creates the link,
   that's OK so far.
   It'd be ideal if we could remove the same function from
   the list in Disable(). Unfortunatelly that's not possible AFAICT,
   because we don't know the reference to that function
   at that moment, so we can only add a reference to function,
   which removes the link. That means that after creating and
   removing a link there are 2 functions in the list,
   one adding and one removing the link and after
   firewalld restart/reload both are called.
   It works, but it's far from ideal.

[1] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.Signals.Reloaded
[2] http://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-owner-changed
[3] http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
[4] https://en.wikipedia.org/wiki/Closure_%28computer_programming%29

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
2015-04-20 13:02:09 +02:00
Jiri Popelka
8301dcc6d7 Support for Firewalld
Firewalld [1] is a firewall managing daemon with D-Bus interface.

What sort of problem are we trying to solve with this ?

Firewalld internally also executes iptables/ip6tables to change firewall settings.
It might happen on systems where both docker and firewalld are running
concurrently, that both of them try to call iptables at the same time.
The result is that the second one fails because the first one is holding a xtables lock.
One workaround is to use --wait/-w option in both
docker & firewalld when calling iptables.
It's already been done in both upstreams:
b315c380f4
b3b451d6f8
But it'd still be better if docker used firewalld when it's running.

Other problem the firewalld support would solve is that
iptables/firewalld service's restart flushes all firewall rules
previously added by docker.
See next patch for possible solution.

This patch utilizes firewalld's D-Bus interface.
If firewalld is running, we call direct.passthrough() [2] method instead
of executing iptables directly.
direct.passthrough() takes the same arguments as iptables tool itself
and passes them through to iptables tool.
It might be better to use other methods, like direct.addChain and
direct.addRule [3] so it'd be more intergrated with firewalld, but
that'd make the patch much bigger.
If firewalld is not running, everything works as before.

[1] http://www.firewalld.org/
[2] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.passthrough
[3] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addChain
    https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addRule

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
2015-04-20 13:02:03 +02:00
Hu Keping
f4942ed864 Remove Job from Info API
Two main things
- Create a real struct Info for all of the data with the proper types
- Add test for REST API get info

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-20 18:14:06 +08:00
Shijiang Wei
49be84842e Remove some unsupported instructions in the docs.
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-04-20 16:48:17 +08:00
Ma Shimiao
e607bb49c4 clenaup: delete unused function getEnv
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-20 16:32:42 +08:00
Qiang Huang
641a7ec9ad remove unused function in server_unit_test.go
After engine refactor, some functions are no longer used.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-20 16:27:47 +08:00
Ankush Agarwal
edf541c22b gofmt whole directory
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-20 01:08:51 -07:00
Alexander Morozov
b7950b725b Merge pull request #12524 from RickWieman/12523-remove-redundant-else
Removes redundant else in registry/session.go
2015-04-19 22:08:50 -07:00
Rick Wieman
5f2b051ec5 Removes redundant else in registry/session.go
Fixes #12523

Signed-off-by: Rick Wieman <git@rickw.nl>
2015-04-19 23:58:55 +02:00
Brian Goff
24b89b7098 Merge pull request #12521 from runcom/else-nit
Refactor else branches
2015-04-19 16:36:39 -04:00
Doug Davis
b1d8ae3824 Merge pull request #12358 from ZJU-SEL/remove_job_from_tag
remove job from tag
2015-04-19 16:02:28 -04:00
moxiegirl
2e58350bd6 Merge pull request #12518 from moxiegirl/fix-12516-registry-doc
Docker Registry Server > Docker Registry
2015-04-19 07:14:09 -07:00
moxiegirl
547ded5df7 Merge pull request #12512 from ankushagarwal/document-binaries
Document the download location of Linux, Windows and Mac OS X binaries
2015-04-19 07:12:45 -07:00
Antonio Murdaca
8655214b3d Refactor else branches
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-19 15:32:54 +02:00
Madhu Venugopal
448a1a7139 Enhanced port integration-cli tests
THe port tests in integration-cli tests just for the port-mapping as
seen by Docker daemon. But it doesn't perform a more indepth testing by
checking for the exposed port on the host.

This change helps to fill that gap.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-04-19 06:15:23 -07:00
Brian Goff
89092252f0 Merge pull request #12432 from Mashimiao/optimize-code-to-clarify-loagic
change code to clarify logic
2015-04-19 07:39:24 -04:00
Simei He
99f6309b97 remove job from tag
Signed-off-by: Simei He <hesimei@zju.edu.cn>
2015-04-19 18:36:56 +08:00
Ankush Agarwal
99251f60c2 Document the download location of binaries
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-19 01:51:03 -07:00
Mary Anthony
7b2b7df386 Docker Registry Server > Docker Registry
Fixing registry index
Tested on beta and this redirect works

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-18 19:19:48 -07:00
Jeff Nickoloff
89df65be5d Update builder.md
Single value labels do not work in 1.6 and multi-label instructions only work when separated by non-EOL whitespace.
I also added an example snip from the inspect output with the labels that are included in this guide.

Signed-off-by: Jeff Nickoloff <jeff@allingeek.com>
2015-04-18 11:38:20 -07:00
moxiegirl
2bc3fb5149 Merge pull request #12508 from Mic92/docs-speedup
docs: speed up build by reducing build steps
2015-04-18 10:41:31 -07:00
Jörg Thalheim
bbe6df1288 docs: speed up build by reducing build steps
- should be also easier to maintain

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-18 13:28:52 +02:00
Doug Davis
c158cdbe6f Merge pull request #12438 from ourcolorfuldays/fixtypo
fix some typos
2015-04-18 07:17:55 -04:00
Arnaud Porterie
5fd378c0d1 Merge pull request #12466 from robertabbott/fix_dockerCmd
Removed unnecessary error output from dockerCmd
2015-04-17 15:15:34 -07:00
moxiegirl
a313b729e4 Merge pull request #12496 from moxiegirl/post-release-updates
Updates to Compose docs and ENV vars
2015-04-17 13:43:06 -07:00
Mary Anthony
3a88367241 Updates to Compose docs and ENV vars
- Compose teamhad forgotten some documentation
- Updated ENV for Distribution also
- Forgot one of the readability sections

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-17 13:08:57 -07:00
Brian Goff
055c6dbaef Merge pull request #12490 from LK4D4/carry_12396
remove job from pull and import
2015-04-17 15:26:30 -04:00
Brian Goff
9922122fd4 Merge pull request #12493 from kostickm/12491-update-message-graphdriver
Updated message severity in graphdriver
2015-04-17 14:53:45 -04:00
Megan Kostick
cdc63ce5d0 Updated message severity in graphdriver
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-17 10:56:12 -07:00
moxiegirl
d12a2d8aeb Merge pull request #12476 from pwaller/small-cl-improvement
Improve build cancelation description in CHANGELOG
2015-04-17 10:34:08 -07:00
moxiegirl
4492977437 Merge pull request #12484 from superseb/12367-jessie-instructions
Added Debian 8 note for adding backports
2015-04-17 10:16:53 -07:00
moxiegirl
ced638094f Merge pull request #12470 from zembutsu/patch-1
fix typo
2015-04-17 09:55:56 -07:00
Simei He
6e38a53f96 remove job from pull and import
Closes #12396

Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-17 09:55:02 -07:00
Alexander Morozov
d845932a52 Merge pull request #12486 from runcom/bye-builtins
Remove builtins
2015-04-17 09:52:43 -07:00
bobby abbott
621b601b3c Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd
method to reflect the change.

resolves #12355

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-17 09:11:14 -07:00
Sebastiaan van Steenis
37b9ce61ac Added Debian 8 note for adding backports
Signed-off-by: Sebastiaan van Steenis <mail@superseb.nl>
2015-04-17 16:32:28 +02:00
moxiegirl
ddc842ca2a Merge pull request #12436 from hqhq/hq_fix_inspect_doc
update docker-inspect man page
2015-04-17 06:57:12 -07:00
Antonio Murdaca
a0bf80fe03 Remove builtins
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-17 14:27:38 +02:00
Peter Waller
609fa93aa2 Improve build cancelation description in CHANGELOG
The existing text didn't explain what had changed.

(See #9774)

Signed-off-by: Peter Waller <p@pwaller.net>
2015-04-17 09:44:12 +01:00
bin liu
70f1910a8b fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2015-04-17 08:12:13 +00:00
Lei Jitang
05a8de4685 Fix weird terminal output format
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-17 15:28:12 +08:00
Masahito Zembutsu
3cdf94ed1a fix typo
Is this typo?

Signed-off-by: Masahito Zembutsu <m.zembutsu@gmail.com>
2015-04-17 16:06:54 +09:00
Doug Davis
5e40de9286 Merge pull request #12468 from icecrime/disable_test_pull_verified
Skip TestPullVerified
2015-04-17 02:31:01 -04:00
Doug Davis
d47f3707c5 Merge pull request #12465 from HuKeping/log-level
Change log severity for non-tlsverify bind
2015-04-17 02:10:47 -04:00
Hu Keping
b052f7a87c Change log severity for non-tlsverify bind
closes #12459

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-17 21:27:58 +08:00
Arnaud Porterie
9a4fa9c191 Skip TestPullVerified
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-16 23:05:47 -07:00
Doug Davis
5207b3eb2b Merge pull request #12446 from icecrime/please_go_away_testexp.tar
Always remove testexp.tar test file
2015-04-17 01:58:29 -04:00
Arnaud Porterie
4e356ee410 Improve export/import tests cleanup
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-16 22:10:55 -07:00
Qiang Huang
01548ed1dc update docker-inspect man page
- sort inspect out
 - update output fields
 - format output
 - add doc about go template
 - other minor fix

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-17 09:25:06 +08:00
moxiegirl
24af878358 Merge pull request #12455 from bfirsh/remove-registry-redirect
Remove registry redirect
2015-04-16 17:55:02 -07:00
Yahya
b57830aee4 adding elementary OS to install script
It's basically just an Ubuntu, I'm a total noob but I've tried it on elementary OS "Freya" and it worked

Signed-off-by: M Yahya <ya7yaz@gmail.com>
2015-04-17 02:02:22 +02:00
moxiegirl
b8530c6c5e Merge pull request #12383 from jdivock/patch-1 2015-04-16 14:45:36 -07:00
moxiegirl
2ba1244ad2 Merge pull request #12452 from moxiegirl/release-versions-set
Updating with final version from Stephen
2015-04-16 14:31:45 -07:00
moxiegirl
96b5a3f562 Merge pull request #12411 from sbasyal/patch-2
The link to issue 407 was broken
2015-04-16 13:32:02 -07:00
Phil Estes
4325cbb47c Merge pull request #12454 from jfrazelle/bump_version
Bump version
2015-04-16 16:27:34 -04:00
Jessica Frazelle
e79c77fb8d bump version to 1.6.0-dev
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-04-16 12:56:02 -07:00
Ben Firshman
4c6d5e3a25 Remove registry redirect
... it was causing an infinite redirect.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-04-16 12:54:56 -07:00
Jessica Frazelle
99d0413033 Bump version to v1.6.0
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

(cherry picked from commit 47496519da)
2015-04-16 12:45:02 -07:00
Jessie Frazelle
769acfec29 Merge pull request #11635 from jfrazelle/bump_v1.6.0
Bump v1.6.0
2015-04-16 12:31:02 -07:00
Antonio Murdaca
1c89c6ea2f Add minor stylistic fixes
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-16 21:22:32 +02:00
Michael Crosby
cb0644a196 Merge pull request #12428 from icecrime/1163_carry
Added documentation for functions
2015-04-16 11:43:29 -07:00
Mary Anthony
b4b21ff0a6 Updating with final version from Stephen
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-16 11:40:36 -07:00
Alexander Morozov
27edbd2868 Merge pull request #12407 from cpuguy83/move_integration_api_tests
Move some integration api tests
2015-04-16 11:40:29 -07:00
Jessica Frazelle
47496519da Bump version to v1.6.0
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
2015-04-16 11:38:05 -07:00
Mary Anthony
fdd21bf032 for 1.6
Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit f44aa3b1fb)
2015-04-16 11:37:59 -07:00
Jessie Frazelle
dfa5feab2f Merge pull request #12451 from moxiegirl/release-versions-set
doc fixes for 1.6
2015-04-16 11:35:46 -07:00
Mary Anthony
f44aa3b1fb for 1.6
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-16 11:33:49 -07:00
Brian Goff
308a23021d Move TestPostCreateNull to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:49:46 -04:00
Brian Goff
5dc02a2fa8 Move TestPostJsonVerify to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:49:28 -04:00
Brian Goff
23fa7d41d5 Move TestContainerApiCreate to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:49:10 -04:00
Brian Goff
f19061ccfd Move TestPostCommit to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:48:54 -04:00
Brian Goff
d9e4b14346 Move TestGetContainersTop to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:48:33 -04:00
Brian Goff
6f5b895bc7 Move SaveAndThenload to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:40:49 -04:00
Brian Goff
8232cc777e Make sockRequestRaw return reader, not []byte
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-16 13:40:49 -04:00
Alexander Morozov
5224151da9 Merge pull request #12350 from runcom/remove-job-restart
Remove job from restart
2015-04-16 10:27:43 -07:00
Antonio Murdaca
e41192a3f8 Remove job from restart
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-16 18:50:24 +02:00
Arnaud Porterie
ae5cf30c7c Add -H|--human flag to docker history
Add a flag to print sizes and dates in human readable format.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-16 08:38:18 -07:00
Dave Henderson
dcff07d03d Adding a verbose time option to output formatted timestamps
Fixes #11413

Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
2015-04-16 08:34:50 -07:00
Brian Goff
17ef617c77 Merge pull request #12431 from YanFeng-Adam/typo
Fix a typo in docker/daemon/state.go
2015-04-16 09:52:40 -04:00
Yan Feng
7e01ecc119 Fix a typo in docker/daemon/state.go
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-04-16 10:56:15 -04:00
Ma Shimiao
93cdb0071b optimize code to clarify logic
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-16 19:56:25 +08:00
Ma Shimiao
73bf9b5c19 add err check before getting term
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-16 17:46:32 +08:00
Mary Anthony
d928dad8c8 In with the old menu layout
Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit fe8fb24b53)
2015-04-15 21:34:50 -07:00
Mary Anthony
82366ce059 Adding environment variables for sub projects
Fixes issue #12186
Fixing variables per Jess

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit ef8b917fac)
2015-04-15 21:34:49 -07:00
Mary Anthony
6410c3c066 Updating with man pages for distribution
Went through the man pages to update for the
v2 instance. Checked against the commands.

Signed-off-by: Mary Anthony <mary@docker.com>
(cherry picked from commit b6d55ebcbc)
2015-04-15 21:34:49 -07:00
Michael Crosby
9231dc9cc0 Ensure state is destroyed on daemont restart
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit a5f7c4aa31)
2015-04-15 21:34:49 -07:00
Jessie Frazelle
1899b2f41a Merge pull request #12423 from crosbymichael/idkbutitworks
Ensure state is destroyed on daemont restart
2015-04-15 21:19:38 -07:00
Jason Smith
dc104ccb40 added documentation for functions
Signed-off-by: Jason Smith <jasonrichardsmith@gmail.com>
2015-04-15 19:28:01 -07:00
Sven Dowideit
ad5d655fb2 Merge pull request #12426 from moxiegirl/new-registry-menu
In with the old menu layout
2015-04-16 12:22:49 +10:00
Mary Anthony
fe8fb24b53 In with the old menu layout
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-15 19:02:01 -07:00
Brian Goff
de923f59b3 Merge pull request #12253 from calavera/remove_job_from_start_and_create
Remove engine.Job from Start and Create
2015-04-15 21:49:25 -04:00
Michael Crosby
a5f7c4aa31 Ensure state is destroyed on daemont restart
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-15 17:44:03 -07:00
Deng Guangxing
6a3f37386b Inspect show right LogPath in json-file driver
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
(cherry picked from commit acf025ad1b)
2015-04-15 17:37:43 -07:00
Alexander Morozov
83d809f3d2 Merge pull request #12388 from xiaods/issue-12373
client.StatusError don't be returned as a pointer
2015-04-15 17:34:38 -07:00
Steven Taylor
d1855c6cc0 What if authConfig or factory is Null?
Signed-off-by: Steven Taylor <steven.taylor@me.com>
2015-04-15 15:35:18 -07:00
Darren Shepherd
d9a0c05208 Change syslog format and facility
This patch changes two things

1. Set facility to LOG_DAEMON
2. Remove ": " from tag so that the tag + pid become a single column in
   the log

Signed-off-by: Darren Shepherd <darren@rancher.com>
(cherry picked from commit 05641ccffc)
2015-04-15 14:49:24 -07:00
Jessie Frazelle
2e4d36ed80 Merge pull request #12391 from ibuildthecloud/syslog-format
Change syslog format and facility
2015-04-15 14:47:12 -07:00
Sabin Basyal
6860c75b7b The link to issue 407 was broken
The link to issue 407 was broken. The old link was: https://github.com/docker/docker/issues/407%20kernel%20versions
The link must be: https://github.com/docker/docker/issues/407

Signed-off-by: Sabin Basyal <sabin.basyal@gmail.com>
2015-04-15 14:06:11 -07:00
Brian Goff
0c7b51089c Merge pull request #12412 from runcom/12410-fix-TestInitializeCannotStatPathFileNameTooLong
Fix TestInitializeCannotStatPathFileNameTooLong
2015-04-15 16:11:29 -04:00
Darren Shepherd
05641ccffc Change syslog format and facility
This patch changes two things

1. Set facility to LOG_DAEMON
2. Remove ": " from tag so that the tag + pid become a single column in
   the log

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-04-15 12:46:43 -07:00
Antonio Murdaca
7afb234741 Fix TestInitializeCannotStatPathFileNameTooLong
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-15 21:15:05 +02:00
Alexander Morozov
5b048ab2f2 Merge pull request #12369 from runcom/fix-links-graph-ref
Fix wrong graphdb refs paths purging
2015-04-15 11:34:58 -07:00
Brian Goff
f0c60f7085 Merge pull request #12387 from x1022as/inspect-logpath
Inspect show right LogPath in json-file driver
2015-04-15 14:28:39 -04:00
moxiegirl
2499baefdd Merge pull request #12399 from emirozer/master
closes #8945
2015-04-15 10:53:10 -07:00
Brian Goff
2ecccda162 Merge pull request #12139 from hqhq/hq_add_cpusest_mems2
add support for cpuset.mems
2015-04-15 13:29:43 -04:00
Deshi Xiao
bae3023eef client.StatusError don't be returned as a pointer
closes #12373

1. remove & from client.StatusError
2. remove * from Error method

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
2015-04-16 01:27:07 +08:00
David Calavera
767df67e31 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-15 10:22:07 -07:00
Jessica Frazelle
24cb9df189 try to modprobe bridge
Signed-off-by: Jessica Frazelle <jess@docker.com>
(cherry picked from commit b3867b8899)
2015-04-15 09:10:56 -07:00
Jessie Frazelle
ec4b0b1e27 Merge pull request #12382 from jfrazelle/modprobe-all-the-things-modules-for-the-modules-god
try to modprobe bridge
2015-04-15 08:45:00 -07:00
Jessica Frazelle
b3867b8899 try to modprobe bridge
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-15 07:19:37 -07:00
Emir Ozer
960de9c8dd closes #8945
Signed-off-by: Emir Ozer <emirozer@yandex.com>
2015-04-15 15:31:23 +02:00
Jörg Thalheim
6533cb973f hack/make/test-integration-cli: introduce MAKEDIR variable
- every execution of dirname costs time
- less repeating

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:44:14 +02:00
Jörg Thalheim
4d53a19528 hack: useless use of cat
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:14:14 +02:00
Jörg Thalheim
ac20568b0a hack: quote all parameters with variable interpolation
better safe then sorry. especially for rm

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:14:14 +02:00
Jörg Thalheim
23afce5f7f hack/make.sh: use SCRIPTDIR wherever possible
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:14:14 +02:00
Jörg Thalheim
6f812a4ec1 hack/make.sh: use bash internal $PWD
Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:14:14 +02:00
Deng Guangxing
acf025ad1b Inspect show right LogPath in json-file driver
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-04-15 11:51:24 +08:00
Qiang Huang
f8dc7e8754 Add cpuset-mems support for docker build
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-15 09:34:12 +08:00
Qiang Huang
8077b2fb80 add support for cpuset.mems
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-15 09:33:46 +08:00
Phil Estes
da697dbed6 Merge pull request #12360 from yestin/11601-supplement-tests-part-2
Improve test accuracy for pkg/chrootarchive (part 2)
2015-04-14 21:00:12 -04:00
Michael Crosby
3a3ab0e4e7 Merge pull request #12384 from calavera/fix_moxiegirl_handler
Fix @moxiegirl's handler to be consistent with other maintainers.
2015-04-14 17:02:44 -07:00
Jason Divock
25d07511ed Update basic setup instructions
Without adding the user to the group you're going to hit nasty TLS errors. Figured I'd save the next guy the hassle.

Problem more accurately described here:
https://github.com/docker/docker/issues/5314

Signed-off-by: Jason Divock <jdivock@box.com>
2015-04-14 16:56:34 -07:00
David Calavera
d10c5d95a8 Fix @moxiegirl's handler to be consistent with other maintainers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 16:53:28 -07:00
Lewis Marshall
c51cd3298c Prevent Upstart post-start stanza from hanging
Once the job has failed and is respawned, the status becomes `docker
respawn/post-start` after subsequent failures (as opposed to `docker
stop/post-start`), so the post-start script needs to take this into
account.

I could not find specific documentation on the job transitioning to the
`respawn/post-start` state, but this was observed on Ubuntu 14.04.2.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
(cherry picked from commit 302e3834a0)
2015-04-14 16:23:59 -07:00
Jessie Frazelle
485071f92e Merge pull request #11945 from lmars/fix-upstart-post-start
Prevent Upstart post-start stanza from hanging
2015-04-14 16:23:04 -07:00
David Calavera
002afbbe77 Make integration tests to call the new start and create endpoints.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:33 -07:00
David Calavera
98996a432e Remove engine.Job from Create action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
David Calavera
610c436e07 Remove engine.Job from Start action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
Phil Estes
5395cdcae5 Merge pull request #12269 from kostickm/12251-remove-not-empty-check
Remove container name not empty check
2015-04-14 17:55:13 -04:00
Arnaud Porterie
ee54723485 Merge pull request #12379 from sharkone/patch-1
Remove sprious `fmt.Printf` from test
2015-04-14 14:25:16 -07:00
Antonio Murdaca
088e69da35 Fix wrong graphdb refs paths purging
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-14 23:10:43 +02:00
Thomas Texier
2ea1febd9a Remove unnecessary fmt.Printf
Signed-off-by: Thomas Texier <sharkone@en-mousse.org>
2015-04-14 20:55:32 +00:00
Phil Estes
1e6f7e4ee5 Merge pull request #12356 from jfrazelle/godeps-lolololololololololololol
change go tools to use certain commit
2015-04-14 16:18:49 -04:00
Phil Estes
2f0f04e8fa Merge pull request #12292 from cpuguy83/remove_commands_integration
Remove commands integration
2015-04-14 16:17:25 -04:00
Jessie Frazelle
74f4a88305 Merge pull request #11999 from vbatts/vbatts-decide_storage
graphdriver: prefer prior driver state
2015-04-14 13:04:21 -07:00
James Turnbull
62e8621095 Merge pull request #12357 from draghuram/prdoc
Improve the git instructions to update a PR.
2015-04-14 15:46:10 -04:00
Brian Goff
8ce42baaef Make docker cp bind-mount volumes
Allows `docker cp` to work seamlessly, and a lot more cleanly.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-14 15:42:56 -04:00
Brian Goff
63331abbca remove integration/utils setRaw funcs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-14 15:17:17 -04:00
Raghuram Devarakonda
18a8bcf072 Improve the git instructions to update a PR.
Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-04-14 15:11:35 -04:00
Alexander Morozov
676bf4afa5 Merge pull request #12282 from cpuguy83/remove_some_integration_tests
Move integration/server_test tests to integration-cli
2015-04-14 11:55:05 -07:00
Megan Kostick
98f857772f Remove container name not empty check
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-14 11:27:06 -07:00
moxiegirl
a3d871220c Merge pull request #12375 from moxiegirl/12366-change-fix
Fixing changed pushed without edit
2015-04-14 11:06:41 -07:00
Alexander Morozov
5be5749d54 Merge pull request #12370 from buddhamagnet/11593-api-client-docs
add docs for DockerCli and NewDockerCli fixes #11593
2015-04-14 11:00:19 -07:00
buddhamagnet
69747b3c1e add docs for DockerCli and NewDockerCli
Signed-off-by: buddhamagnet <buddhamagnet@gmail.com>
2015-04-14 18:33:11 +01:00
Mary Anthony
4dd4bd00aa Fixing changed pushed without edit
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-14 10:25:07 -07:00
Brian Goff
040176f6e1 Merge pull request #12214 from ahmetalpbalkan/namesgenerator/localrand
names-generator: use local random instance
2015-04-14 13:10:26 -04:00
Alexander Morozov
7b29a88146 Merge pull request #12374 from kostickm/12343-fix-vet-warning-archive
Fix vet warning in archive.go
2015-04-14 10:06:04 -07:00
Alexander Morozov
3748def343 Merge pull request #12366 from bboreham/12337-force-push
Add -f option and explanation to push after rebase
2015-04-14 09:59:48 -07:00
Brian Goff
392fd243bc Merge pull request #12365 from HuKeping/list
Use local variable err instead of a outer one
2015-04-14 12:49:15 -04:00
Alexander Morozov
398220f5ff Merge pull request #12368 from ZJU-SEL/fix-memory-stats-doc
fix memory stats display document
2015-04-14 09:44:44 -07:00
Alexander Morozov
8f0b63925e Merge pull request #12363 from ahmetalpbalkan/integ-cli/use-sockRequest-statuscode
integ-cli: Use status code from sockRequest (fix #12335)
2015-04-14 09:38:10 -07:00
Jessica Frazelle
736824ccc1 change go tools to use certain commit
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-14 09:32:23 -07:00
Hu Keping
a0804e8e11 Use local variable err instead of a outer one
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-15 00:29:53 +08:00
Megan Kostick
fc20658a01 Fix vet warning in archive.go
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-14 09:13:50 -07:00
Phil Estes
fe53c27785 Merge pull request #11992 from runcom/11923-refactor-utils-utils
Refactor utils/utils, fixes #11923
2015-04-14 12:01:23 -04:00
Alexander Morozov
5019f35111 Merge pull request #11980 from sunyuan3/TestSearchCmdOptions
add TestSearchCmdOptions case
2015-04-14 08:34:40 -07:00
wonderflow
d791f7e9f8 fix memory stats display document
Signed-off-by: Sun Jianbo <wonderflow@zju.edu.cn>
2015-04-14 18:34:20 +08:00
Bryan Boreham
c89ddb6d01 Add -f option and explanation to push after rebase
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2015-04-14 10:53:37 +01:00
Ahmet Alp Balkan
531433e765 integ-cli: Use status code from sockRequest (fix #12335)
sockRequest now makes the status code available in the returned
values. This helps avoid string checking for non-HttpStatusOK(=200)
yet successful error messages.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-14 08:07:50 +00:00
Yestin Sun
67df8e4257 Improve test accuracy for pkg/chrootarchive (part 2)
Check test correctness of untar by comparing destination with
source. For part 2, it checkes hashes of source and destination
files or the target files of symbolic links.

This is a supplement to the #11601 fix.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2015-04-13 21:46:14 -07:00
Ahmet Alp Balkan
25fab69f7d names-generator: use local random instance
Instead of seeding/polluting the global random instance,
creating a local `rand.Random` instance which provides the same
level of randomness.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-14 02:35:16 +00:00
Vincent Batts
b68e161e5b graphdriver: prefer prior driver state
Before this, a storage driver would be defaulted to based on the
priority list, and only print a warning if there is state from other
drivers.

This meant a reordering of priority list would "break" users in an
upgrade of docker, such that there images in the prior driver's state
were now invisible.

With this change, prior state is scanned, and if present that driver is
preferred.

As such, we can reorder the priority list, and after an upgrade,
existing installs with prior drivers can have a contiguous experience,
while fresh installs may default to a driver in the new priority list.

Ref: https://github.com/docker/docker/pull/11962#issuecomment-88274858

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-13 21:37:55 -04:00
Tatsushi Inagaki
bcd5e20a09 Enable "netgo" library when we build a static binary with gccgo
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
2015-04-13 21:33:04 -04:00
Yuan Sun
77f2a4a0e3 add TestSearchCmdOptions case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-14 09:23:26 +08:00
Arnaud Porterie
00eddf5e67 Merge pull request #12353 from sunyuan3/duplicate
duplicate logDone in TestRmRunningContainerCheckError409 and TestRmRunni...
2015-04-13 17:48:53 -07:00
Brian Goff
7d738e0b8c Move utils from commands_test.go into utils.go
Everything else was gone from this file except these utils which are
being used in other files and can't yet be removed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:26 -04:00
Brian Goff
125747e967 Remove TestRunAutoremove
This test is already being skipped, and is also fully tested by
`TestRunContainerWithRmFlagExitCodeNotEqualToZero`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:26 -04:00
Brian Goff
e4cfd9b392 MovetAttachDisconnect to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:26 -04:00
Brian Goff
28cda04838 Move TestAttachDetachTruncatedID to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:26 -04:00
Brian Goff
ae0883ce00 Move TestAttachDetach to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:26 -04:00
Brian Goff
f7538c77ef Move TestRunDetach to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:24 -04:00
Jessie Frazelle
f68ad63496 Merge pull request #12345 from kostickm/12324-add-detection-f2fs-jfs-filesystem
Add detection for F2Fs and JFS
2015-04-13 17:32:47 -07:00
Yuan Sun
b85ade79d5 duplicate logDone in TestRmRunningContainerCheckError409 and TestRmRunningContainer
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-14 08:32:25 +08:00
Brian Goff
b93d3f8768 Merge pull request #12351 from jfrazelle/fix-test-daemon-with-wrong-key-messing-up-builds
cleanup daemon tests
2015-04-13 20:31:41 -04:00
Sven Dowideit
e8a7e76283 Merge pull request #11920 from SvenDowideit/flesh-out-docker-hub-automated-builds-docs
Researching Docker Hub account linking and automated builds details
2015-04-14 10:31:21 +10:00
Sven Dowideit
a55f8e1ce7 Researching Docker Hub account linking and automated builds details
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-04-14 10:29:55 +10:00
Megan Kostick
7e2d05b493 Add detection for F2Fs and JFS
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>

Alphabetize FSMagic list to make more human-readable.

Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-13 17:01:43 -07:00
Jessie Frazelle
24df333fa5 Merge pull request #12349 from calavera/patch-1
Fix JSON format in the remote api configuration examples.
2015-04-13 16:59:12 -07:00
Jessica Frazelle
9a87553e4f cleanup test wrong key.json leading to other failures
wait for container to be running before trying to kill it in daemon tests

Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-13 16:58:44 -07:00
Antonio Murdaca
c30a55f14d Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-14 01:37:36 +02:00
David Calavera
d71c929d08 Fix JSON format in the remote api configuration examples.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-13 16:12:00 -07:00
Michael Crosby
7ecf4e5d4d Merge pull request #12166 from cpuguy83/remove_err_when_volume_exists
Don't return error when adding existing volume
2015-04-13 14:15:48 -07:00
Michael Crosby
12f7db1830 Merge pull request #12025 from coolljt0725/add_exec_with_user
Add docker exec run command as a different user and in privileged mode
2015-04-13 13:50:51 -07:00
Michael Crosby
b5c3d01e6b Merge pull request #12044 from reteptilian/11721-remove-randomstring-3
fixes 11721 replace stringutils.GenerateRandomString with stringid.GenerateRandomID
2015-04-13 13:47:50 -07:00
Brian Goff
579c9ec1d0 Don't return error when adding existing volume
Error wasn't really doing anything except for making a bunch of extra
debug logs.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:45:35 -04:00
Michael Crosby
8652ca5d5f Merge pull request #12111 from tianon/builder-deb
Add "builder-deb" base images for building ".deb" packages properly
2015-04-13 13:41:17 -07:00
Brian Goff
02706a40bb move TestImagesFilter to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:40:48 -04:00
Brian Goff
2c24a8a4ea Move TestCreateNumberHostname to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:40:48 -04:00
Brian Goff
ed6074ea6b Move TestMergeOnCommit to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:40:48 -04:00
Brian Goff
9b4d9a3421 Move TestRunWithTooLowMemory to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:40:48 -04:00
Michael Crosby
6fa2a1e486 Merge pull request #12172 from ZJU-SEL/change_stats
change memory usage display
2015-04-13 13:32:45 -07:00
Michael Crosby
3d424ead3b Merge pull request #12287 from calavera/check_memory_swap_when_disabled
Log memory swap capabilities properly.
2015-04-13 13:19:52 -07:00
Evan Hazlett
b6e64981e6 Merge pull request #12204 from yestin/11601-supplement-tests-part-1
Improve test accuracy for pkg/chrootarchive (part 1)
2015-04-13 16:14:18 -04:00
Alexander Morozov
e961f7da67 Merge pull request #12341 from jfrazelle/add-vet-script
Add vet script
2015-04-13 13:13:56 -07:00
Michael Crosby
75b911eb3c Merge pull request #12222 from chenhanxiao/cp-support-colon
cp: add support for copy filename with ":"
2015-04-13 13:09:12 -07:00
Evan Hazlett
6b40377c18 Merge pull request #12262 from YanFeng-Adam/daemon
A wrong key.json would remain if the TestDaemonwithwrongkey case fails. The issue would lead to failure of other cases.
2015-04-13 16:00:20 -04:00
Michael Crosby
afd973c497 Merge pull request #12342 from LK4D4/fix_vet_warn
Fix vet warning
2015-04-13 12:56:47 -07:00
Jessica Frazelle
f3ba0a6a35 change tabs to spaces
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-13 12:48:40 -07:00
bobby abbott
3280ce651b Adds validate-vet script
resolves #11970

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-13 12:48:05 -07:00
Alexander Morozov
10affa8018 Get process list after PID 1 dead
Fix #11087

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ac8bd12b39)
2015-04-13 12:28:22 -07:00
Deng Guangxing
ce27fa2716 move syslog-tag to syslog.New function
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 4f91a333d5)
2015-04-13 12:17:26 -07:00
David Calavera
7523beff41 Log memory swap capabilities properly.
Check whether the swap limit capabilities are disabled or not only when memory swap is set to greater than 0.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-13 11:56:59 -07:00
Evan Hazlett
82256c2a54 Merge pull request #12340 from crosbymichael/syslog-tags
move syslog-tag to syslog.New function
2015-04-13 14:51:00 -04:00
Evan Hazlett
05433a4dab Merge pull request #12275 from LK4D4/pid_host_hell
Get process list after PID 1 dead
2015-04-13 14:50:23 -04:00
Evan Hazlett
9e0a55b48c Merge pull request #12276 from estesp/10246-really-fix-arg-list
Send archive options via pipe in chrootarchive
2015-04-13 14:44:47 -04:00
Alexander Morozov
213eab995a Fix vet warning
pkg/archive/archive_test.go:496: arg changes for printf verb %s of wrong type: []archive.Change

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-13 11:43:30 -07:00
James Turnbull
e29dcd91bd Merge pull request #12228 from bboreham/12022-signal-doc
Add a note about PID 1 not terminating automatically on signal
2015-04-13 14:41:07 -04:00
Evan Hazlett
a8e095b243 Merge pull request #12293 from hqhq/hq_use_hostconfig
use hostConfig in verifyDaemonSettings
2015-04-13 14:34:35 -04:00
Evan Hazlett
3434f64827 Merge pull request #12300 from johngossman/master
Added some error messages and tracing to bridge network initialization
2015-04-13 14:32:56 -04:00
Evan Hazlett
3509132a6e Merge pull request #12301 from ewindisch/https_links
Use HTTPS links for URLs in READMEs / comments / docs
2015-04-13 14:30:53 -04:00
Deng Guangxing
4f91a333d5 move syslog-tag to syslog.New function
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-13 11:24:18 -07:00
Jessie Frazelle
85f1410a5a Merge pull request #12049 from tianon/bundles-latest
Add "bundles/latest" symlink
2015-04-13 11:11:38 -07:00
Michael Crosby
38761bda79 Merge pull request #12264 from Mashimiao/add-event-log-for-push
Add event log for push
2015-04-13 11:03:09 -07:00
Michael Crosby
0e46cc9be4 Merge pull request #12325 from hqhq/hq_fix_build_test
fix build test by adding --no-cache
2015-04-13 10:57:19 -07:00
Michael Crosby
76eeb5d777 Merge pull request #12291 from coolljt0725/add_cfs_bandwidth_to_check_config
Add CFS_BANDWIDTH to check-config
2015-04-13 10:55:31 -07:00
Michael Crosby
5a174e5def Merge pull request #12297 from vdemeester/11603-pkg-archive-test-coverage
Add test on archive.go (#11603)
2015-04-13 10:54:21 -07:00
Michael Crosby
c19bee4fb0 Merge pull request #12338 from LK4D4/fix_compile_integr_cli
Fix errors due changed sockRequest signature
2015-04-13 10:50:38 -07:00
Alexander Morozov
27fccdbabb Fix errors due changed sockRequest signature
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-13 10:30:07 -07:00
Michael Crosby
9a0a4ac02f Merge pull request #12331 from coolljt0725/fix_panic_release_nil_interface
Fix daemon panic when release a nil network interface
2015-04-13 10:13:57 -07:00
Michael Crosby
6f928be7ef Merge pull request #12320 from runcom/fix-api-resize-exec-resize
fix api server resize&execResize
2015-04-13 09:59:11 -07:00
Michael Crosby
33e83d0581 Merge pull request #12279 from runcom/remove-job-commit
Remove job from commit
2015-04-13 09:57:54 -07:00
Tianon Gravi
d42753485b Add "bundles/latest" symlink
This is a symlink to the latest "bundle" that was assembled.  For example, if `VERSION` is currently `1.5.0-dev`, then `bundles/latest` will be a symlink to `bundles/1.5.0-dev` after an attempted build.

One interesting property of this is that after a successful `binary` build, we can `./bundles/latest/binary/docker -v` and get back something like `Docker version 1.5.0-dev, build 3ff6723-dirty`.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-13 10:54:17 -06:00
Bryan Boreham
5ad15479a0 Add a note about PID 1 not terminating on SIGINT/SIGTERM.
Also re-arranged the description of CTRL-c to make it clearer.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2015-04-13 17:39:38 +01:00
Brian Goff
12eff0c26f Merge pull request #12312 from runcom/remove-job-container-stats
Remove job from container stats
2015-04-13 11:58:31 -04:00
Brian Goff
a4f98d3225 Merge pull request #12313 from runcom/remove-job-export
Remove job from export
2015-04-13 11:57:55 -04:00
Alexander Morozov
bfb487dc50 Merge pull request #12304 from runcom/remove-job-logs
Remove job from logs
2015-04-13 08:38:46 -07:00
Doug Davis
9c48f6d9a5 Merge pull request #12314 from runcom/remove-engine-links
Remove engine from links
2015-04-13 11:27:13 -04:00
Brian Goff
871f4cdccb Merge pull request #12326 from xiaods/issure-12316
correct pkg/stdcopy NewStdWriter function comments
2015-04-13 09:39:34 -04:00
Antonio Murdaca
6b737752e3 Remove job from export
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-13 15:27:45 +02:00
Doug Davis
ad41ba1f95 Merge pull request #12321 from HuKeping/testcase_typo
Fix typo in testcase
2015-04-13 08:48:41 -04:00
Hu Keping
1567cf2cdf Fix typo in testcase
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-13 23:09:07 +08:00
Lei Jitang
8b35481292 Fix daemon panic when release a nil network interface
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-13 20:24:10 +08:00
Deshi Xiao
a715b0e31b correct pkg/stdcopy NewStdWriter function comments
pkg/stdcopy NewStdWriter function has wrong doc comment,
utils is not correct, it should be stdcopy

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
2015-04-13 17:21:27 +08:00
Qiang Huang
c49cc1f2fb fix build test by adding --no-cache
Testcase TestBuildResourceConstraintsAreUsed run build without
--no-cache, so if you run this test twice, it will fail the
second time.
TESTFLAGS='-v -run ^TestBuildResourceConstraintsAreUsed$' ./hack/make.sh binary test-integration-cli
[PASSED]
TESTFLAGS='-v -run ^TestBuildResourceConstraintsAreUsed$' ./hack/make.sh binary test-integration-cli
[FAIL]
Because we'll use cID to inspect field and will get empty cID
if we have cache.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-13 16:24:49 +08:00
Antonio Murdaca
3341f3a355 fix api server resize&execResize
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-13 08:42:12 +02:00
Antonio Murdaca
65a056345c Remove jobs from stats
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-13 08:33:53 +02:00
Antonio Murdaca
91bfed6049 Remove job from logs
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-13 08:25:31 +02:00
Ma Shimiao
f5a07f0c88 Add event log for push
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-04-13 09:41:15 +08:00
Phil Estes
908db51804 Send archive options via pipe in chrootarchive
After finding our initial thinking on env. space versus arg list space
was wrong, we need to solve this by using a pipe between the caller and
child to marshall the (potentially very large) options array to the
archiver.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-04-12 21:16:54 -04:00
John Gossman
80e9f6f838 More review feedback addressed
Signed-off-by: John Gossman <johngos@microsoft.com>
2015-04-12 16:26:37 -07:00
John Gossman
4ce19da739 Addressed feedback. Will squash after further review
Signed-off-by: John Gossman <johngos@microsoft.com>
2015-04-12 15:49:29 -07:00
Antonio Murdaca
7560018541 Remove engine from links
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-12 16:25:10 +02:00
Doug Davis
a54fd325e6 Merge pull request #12305 from runcom/remove-job-exec-inspect
Remove job from execInspect
2015-04-12 08:30:38 -04:00
Doug Davis
395df2b0a5 Merge pull request #12306 from runcom/remove-job-stop
Remove job from stop
2015-04-12 08:29:22 -04:00
Antonio Murdaca
04cc6c6aa4 Remove job from stop
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-12 00:41:16 +02:00
Antonio Murdaca
621ee1f6a4 Remove job from execInspect
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-12 00:15:34 +02:00
Vincent Demeester
c4fe5dad1d Add test on archive.go (#11603)
- Trying to add or complete unit test to each ``func``
- Removing dead code (``escapeName``)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-04-11 23:21:37 +02:00
John Gossman
a9843cb739 Added some error messages and tracing to bridge network initialization
Signed-off-by: John Gossman <johngos@microsoft.com>
2015-04-11 11:15:24 -07:00
Eric Windisch
5dc83233bc HTTPS urls for ./project
Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:58:09 -04:00
Eric Windisch
ac65c8c380 HTTPS URLs for docs top-level & man pages
This updates all of docs outside of sources.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:43:26 -04:00
Eric Windisch
df9ee6d656 Link to HTTPS urls in contrib comments/maintainers
Updates comments and dockerfile maintainer lines
to use HTTPS urls where applicable.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:35:08 -04:00
Eric Windisch
ca37301d54 Link to HTTPS URLs in engine comments
Updates most of the instances of HTTP urls in the engine's
comments. Does not account for any use in the code itself,
documentation, contrib, or project files.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:31:34 -04:00
Eric Windisch
723d43387a HTTPS urls for ./hacking
Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:22:16 -04:00
Eric Windisch
67a983fc37 Use HTTPS for package URL
Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:21:16 -04:00
Eric Windisch
787d774af0 Link to HTTPS URLs
Link to HTTPS URLs in top-level documentation / project files.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-11 13:18:57 -04:00
James Turnbull
e3dd323336 Merge pull request #12289 from sunyuan3/docker_remote_api
update docker_remote_api_v1.19.md
2015-04-11 09:27:36 -05:00
James Turnbull
6d8102466a Merge pull request #12288 from sunyuan3/ubuntu
update ubuntulinux.md
2015-04-11 09:25:55 -05:00
jianbosun
d6d8f45b04 change memory usage display
using standard unix postfixes add unit test for display
also change doc for memory usage display change
for example GiB will be GB

Signed-off-by: Sun Jianbo <wonderflow@zju.edu.cn>
2015-04-11 20:04:34 +08:00
Yuan Sun
4f492e794a update docker_remote_api_v1.*
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-11 18:11:49 +08:00
Qiang Huang
39932511c1 use hostConfig in verifyDaemonSettings
We have moved resource configs to hostConfig.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-11 16:37:28 +08:00
Brian Goff
e3c1cc8d77 Merge pull request #12290 from yuchangchun1/typo
Fix a typo in TestVolumesFromGetsProperMode
2015-04-10 23:45:42 -04:00
Lei Jitang
d2d583c53b Add CFS_BANDWIDTH to check-config
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:39:47 +08:00
Lei Jitang
72a500e9e5 Add docker exec run a command in privileged mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:26:37 +08:00
Lei Jitang
2cce4791b0 Add -u|--user flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:04:24 +08:00
y00277921
24dd8a4698 Fix a typo in comment of parseMaybeJSONToList
Signed-off-by: Yu Changchun <yuchangchun1@huawei.com>
2015-04-11 10:34:21 +08:00
Phil Estes
5c3b228b61 Merge pull request #11058 from x1022as/upstream-master
fix 'rmi -f imgID' problem
2015-04-10 22:00:14 -04:00
Deng Guangxing
795a58fb44 'docker rmi -f IMAGE_ID' untag all names and delete the image
If an image has been tagged to multiple repos and tags, 'docker
rmi -f IMAGE_ID' will just untag one random repo instead of
untagging all and deleting the image. This patch implement
this. This commit is composed of:

        *untag all names and delete the image

        *add test to this feature

        *modify commandline/cli.md to explain this

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-04-11 09:24:21 +08:00
Yuan Sun
a8fddbdeae update ubuntulinux.md
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-11 08:58:23 +08:00
Brian Goff
418195a4fb Merge pull request #12274 from brahmaroutu/fix_gccgo_compilation
Unwanted declaration causing compilation issues with gccgo
2015-04-10 20:22:45 -04:00
Brendan Dixon
8d83409e85 Turned off Ctrl+C processing by Windows shell
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
(cherry picked from commit c337bfd2e0)
2015-04-10 16:41:59 -07:00
Jessie Frazelle
d90da05b1b Merge pull request #12283 from brendandixon/win-cli/wrapfix
Turned off Ctrl+C processing by Windows shell
2015-04-10 16:40:43 -07:00
Alexander Morozov
ac8bd12b39 Get process list after PID 1 dead
Fix #11087

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-10 16:23:57 -07:00
Nathan LeClaire
3a73b6a2bf Allow SEO crawling from docs site
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>

Docker-DCO-1.1-Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com> (github: nathanleclaire)

(cherry picked from commit de03f4797b)
2015-04-10 15:59:35 -07:00
moxiegirl
f3e1178791 Merge pull request #12272 from nathanleclaire/bots_are_our_friends
Allow SEO crawling from docs site
2015-04-10 15:58:37 -07:00
Brendan Dixon
c337bfd2e0 Turned off Ctrl+C processing by Windows shell
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2015-04-10 15:43:35 -07:00
Nathan LeClaire
de03f4797b Allow SEO crawling from docs site
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>

Docker-DCO-1.1-Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com> (github: nathanleclaire)
2015-04-10 15:29:55 -07:00
Antonio Murdaca
c8529fde5f Remove job from commit
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-11 00:20:45 +02:00
Brian Goff
001a7e6bab Merge pull request #12103 from sunyuan3/pause
add TestContainerApiPause case
2015-04-10 18:04:29 -04:00
Tibor Vass
563041b5c4 Merge pull request #11478 from dmcgowan/v2-vendored-api
Use v2 api from distribution
2015-04-10 17:22:38 -04:00
Tibor Vass
23c12dabbd Merge pull request #11412 from vbatts/vbatts-dm_sync_is_required
devmapper: udev sync is a requirement
2015-04-10 16:52:38 -04:00
Brian Goff
96313f7ce0 Merge pull request #12250 from runcom/remove-job-wait
Remove job from wait
2015-04-10 16:27:59 -04:00
root
73d08528ea Unwanted declaration causing compilation issues with gccgo
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-10 19:47:15 +00:00
Vincent Batts
0e21782de5 devmapper: storage-opt override for udev sync
This provides an override for forcing the daemon to still attempt
running the devicemapper driver even when udev sync is not supported.

Intended to be a very clear impairment for those choosing to use it. If
udev sync is false, there will still be an error in the daemon logs,
even when the override is in place. The docs have an explicit WARNING.

Including link to the docs for users that encounter this daemon error
during an upgrade.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-10 15:43:16 -04:00
Doug Davis
6d8bba0cc8 Merge pull request #12271 from kostickm/12119-rename-TestStartSilentAttach
Rename TestStartSilentAttach to TestStartAttachSilent
2015-04-10 12:20:37 -07:00
moxiegirl
6ab4878a01 Merge pull request #12218 from draghuram/apidoc_12055
Adds example request and Json parameter information for container
2015-04-10 11:22:57 -07:00
Tianon Gravi
f99269882f Commonalize more bits of install.sh (especially standardizing around "cat <<-EOF")
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
(cherry picked from commit 6842bba163)
2015-04-10 11:20:15 -07:00
Eric Windisch
568a9703ac Wrap installer in a function
This will assure that the install script will not
begin executing until after it has been downloaded should
it be utilized in a 'curl | bash' workflow.

Signed-off-by: Eric Windisch <eric@windisch.us>
(cherry picked from commit fa961ce046)
2015-04-10 11:20:15 -07:00
Aaron Welch
faaeb5162d add centos to supported distros
Signed-off-by: Aaron Welch <welch@packet.net>
(cherry picked from commit a6b8f2e3fe)
2015-04-10 11:20:15 -07:00
Brendan Dixon
b5613baac2 Corrected int16 overflow and buffer sizes
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
(cherry picked from commit a264e1e83d)
2015-04-10 11:20:15 -07:00
Antonio Murdaca
db0ffba3b9 Remove job from wait
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-10 20:17:02 +02:00
Phil Estes
904295fd71 Merge pull request #12242 from tianon/functionalize-install
Wrap install.sh in a function
2015-04-10 14:15:38 -04:00
Michael Crosby
bae3273ef4 Merge pull request #12259 from duglin/RemoveJobTop
Remove Job from `docker top`
2015-04-10 10:56:01 -07:00
Michael Crosby
267bd51adb Merge pull request #12248 from duglin/RemoveJobKill
Remove Job from `docker kill`
2015-04-10 10:52:18 -07:00
Megan Kostick
e7a2e2bf7e Rename TestStartSilentAttach to TestStartAttachSilent
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-10 10:45:38 -07:00
Tibor Vass
43aca9adac Merge pull request #12238 from brendandixon/win-cli/fixes
Corrected int16 overflow and buffer sizes
2015-04-10 13:36:23 -04:00
Richard Burnison
8d1a500303 Only use fallback to short IDs when obvious.
As reported in #11294, the Docker daemon will execute contains it
shouldn't run in the event that a requested tag is present in an image's
ID. This leads to the wrong image being started up silently.

This change reduces the risk of such a collision by using the short ID
iff the actual revOrTag looks like a short ID (not that it necessarily
is).

Signed-off-by: Richard Burnison <rburnison@ebay.com>
2015-04-10 13:20:44 -04:00
Arnaud Porterie
7cec5f50c5 Merge pull request #12209 from ahmetalpbalkan/daemon/cli-help-log-driver-reword
cli: Better wording for daemon --log-driver
2015-04-10 08:29:29 -07:00
Raghuram Devarakonda
202e0380f3 Adds example request and Json parameter information for container
start API.

Closes #10304.

Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-04-10 11:10:41 -04:00
Yan Feng
bfc68d10ed A wrong key.json would remain if the TestDaemonwithwrongkey case fails. The issue would lead to failure of other cases.
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-04-10 11:10:26 -04:00
Brian Goff
0693e34d7e Merge pull request #12260 from HuKeping/rmjob-history
Remove Job from History API
2015-04-10 09:53:05 -04:00
Hu Keping
5c7c3fea6c Remove Job from History API
a part of issue #12151

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-10 21:37:56 +08:00
Doug Davis
5c8e28ec7c Merge pull request #12263 from chenhanxiao/typo-resize-test
api_resize_test: fix a typo
2015-04-10 05:46:42 -07:00
Chen Hanxiao
4ddc721f23 api_resize_test: fix a typo
s/cintainer/container

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-04-10 03:09:26 -04:00
Chen Hanxiao
5037297388 cp: add support for copy filename with ":"
We use ":" as separator CONTAINER:PATH.
This patch enables copy filename with ":"
to host.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-04-10 00:08:05 -04:00
Tibor Vass
296323cd6c Merge pull request #12210 from tiborvass/carry-9916
Carry 9916: add comment column in docker history command
2015-04-10 00:02:00 -04:00
Tibor Vass
fa2ace00a8 Rebase + some fixes
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-04-09 21:29:42 -04:00
David Young
8d682bf734 Refine document by review comments
Signed-off-by: David Young <yangboh@cn.ibm.com>
2015-04-09 21:29:42 -04:00
David Young
bf57339527 Add comment column in docker history command output
Signed-off-by: David Young <yangboh@cn.ibm.com>
2015-04-09 21:29:41 -04:00
Tianon Gravi
6842bba163 Commonalize more bits of install.sh (especially standardizing around "cat <<-EOF")
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-09 19:28:25 -06:00
Alexander Morozov
e690ad9292 Merge pull request #12256 from WiseTrem/remove_go1.2
Remove pools_nopool.go & build tag from pools.go
2015-04-09 18:25:09 -07:00
Doug Davis
3e096cb9c9 Remove Job from docker top
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-09 18:17:50 -07:00
Yuan Sun
8636a21991 add TestContainerApiPause case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-10 09:14:01 +08:00
Michael Crosby
404f81011b Merge pull request #12254 from runcom/remove-job-resize-execresize
Remove job from resize&execResize
2015-04-09 17:00:58 -07:00
moxiegirl
02f6d7f98a Merge pull request #12252 from kostickm/update-contributor-guide-docs
Docs cleanup - Contributor Guide
2015-04-09 16:54:08 -07:00
WiseTrem
f01d755cd0 Remove pools_nopool.go & build tag from pools.go
Fix #11576

Signed-off-by: Gleb Shepelev <shepelyov.g@gmail.com>
2015-04-10 02:32:55 +03:00
Doug Davis
3cb751906a Remove Job from docker kill
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-09 16:06:54 -07:00
Antonio Murdaca
e290a22dc9 Remove job from resize&execResize
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-10 00:56:43 +02:00
Michael Crosby
eebfcde0ea Merge pull request #12249 from runcom/remove-job-pause-unpause
Remove job from pause/unpause
2015-04-09 15:09:48 -07:00
moxiegirl
8ad6031759 Merge pull request #12162 from daviddavis/README
Fixing up the README
2015-04-09 14:26:03 -07:00
Megan Kostick
e4addf1c01 Docs cleanup - Contributor Guide
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-09 14:20:03 -07:00
Alexander Morozov
67676529b3 Merge pull request #12092 from tiborvass/no-jobs-networkdriver-bridge
Remove jobs from daemon/networkdriver/bridge
2015-04-09 14:10:21 -07:00
Michael Crosby
d66f868a83 Merge pull request #12247 from LK4D4/copy_no_engine
Removed engine from /copy
2015-04-09 14:09:00 -07:00
Antonio Murdaca
5ccb1c764b Remove job from pause/unpause
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 22:50:48 +02:00
Alexander Morozov
dd4389fb19 Merge pull request #12109 from runcom/11625-fix-windows-test-build-cancellation
Fix TestBuildCancelationKillsSleep to not fail on Windows
2015-04-09 13:33:27 -07:00
Alexander Morozov
ccdef895de Removed engine from /copy
* Client and server use types.CopyConfig
* API calls container.Copy directly

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-09 13:05:31 -07:00
Antonio Murdaca
d38c90140b Fix TestBuildCancelationKillsSleep to not fail on Windows
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 21:03:19 +02:00
Alexander Morozov
6fb8bd0450 Merge pull request #12244 from calavera/fix_typo_in_dispatcher
Fix typo in builder/dispatchers.go
2015-04-09 11:51:43 -07:00
David Calavera
bbdf045ac1 Fix typo in builder/dispatchers.go
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-09 11:43:05 -07:00
Alexander Morozov
b02cf5239e Merge pull request #12115 from cpuguy83/fix_events_filter_test
Cleanup events filter by container test
2015-04-09 11:40:08 -07:00
Jessie Frazelle
c77ac8e29d Merge pull request #12225 from chenhanxiao/commit-accent
docs: add missing accent mark around docker command
2015-04-09 11:34:07 -07:00
Brian Goff
94fcded51b Merge pull request #12208 from twhiteman/master
fix #12188 integration-cli: use "top" instead of "sleep" to avoid timeout
2015-04-09 14:30:43 -04:00
Eric Windisch
fa961ce046 Wrap installer in a function
This will assure that the install script will not
begin executing until after it has been downloaded should
it be utilized in a 'curl | bash' workflow.

Signed-off-by: Eric Windisch <eric@windisch.us>
2015-04-09 14:26:07 -04:00
Alexander Morozov
92a775bd7a Merge pull request #12234 from runcom/remove-job-rmi
Remove job from rmi
2015-04-09 11:24:20 -07:00
Alexander Morozov
3218f3936d Merge pull request #12197 from runcom/remove-job-rm
Remove job from rm
2015-04-09 11:21:52 -07:00
Todd Whiteman
42d47c3136 fix #12188 integration-cli: tests using "sleep" can timeout too early - change to "top" instead
Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
2015-04-09 10:46:57 -07:00
Antonio Murdaca
e4afc379dc Remove job from rmi
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 19:39:14 +02:00
Brian Goff
2052d01b1e Merge pull request #12240 from LK4D4/fix_attach
Fix regressions in attach
2015-04-09 13:34:18 -04:00
Jessie Frazelle
2b96bd0bb8 Merge pull request #11895 from liusdu/m
show the right image name in job log and docker ps
2015-04-09 10:21:07 -07:00
Alexander Morozov
0fec3e19db Fix regressions in attach
* Wrong bool parsing
* Attach always all streams

Were introduced in #12120

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-09 09:58:44 -07:00
Antonio Murdaca
db13cb7f98 Remove job from rm
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 18:46:24 +02:00
Brian Goff
6b7e520aa3 Merge pull request #12215 from ahmetalpbalkan/execdriver/localrand
execdriver/lxc: use local rand.Random in test
2015-04-09 12:22:25 -04:00
Alexander Morozov
6ba7bf440e Merge pull request #12184 from duglin/RemoveJobImages
Remove Job from `docker images`
2015-04-09 09:19:09 -07:00
Arnaud Porterie
f16d8db789 Merge pull request #12205 from ahmetalpbalkan/docs/remote-api-LogConfig-format
docs: Markdown format fix around LogConfig param
2015-04-09 09:17:24 -07:00
Arnaud Porterie
74b5c7b284 Merge pull request #12231 from ahmetalpbalkan/integ-cli/TestInfoEnsureSucceeds-all-required
cli_info_test: Check all required fields
2015-04-09 09:07:54 -07:00
Brendan Dixon
a264e1e83d Corrected int16 overflow and buffer sizes
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2015-04-09 09:03:04 -07:00
Brian Goff
7dff1c15d2 Merge pull request #12223 from YanFeng-Adam/typo
Fix a typo in docker/daemon/execdriver/native/exec.go
2015-04-09 11:49:02 -04:00
Yan Feng
ab11d60555 Fix a typo in docker/daemon/execdriver/native/exec.go
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-04-09 11:46:09 -04:00
Doug Davis
8295bed3df Merge pull request #12207 from WiseTrem/getBoolParam
Removing unused getBoolParam func from api/server/server.go
2015-04-09 08:28:48 -07:00
Phil Estes
00fd226430 Merge pull request #12227 from HuKeping/rm-rename
Remove Job from rename
2015-04-09 11:27:14 -04:00
Hu Keping
49c4de4aeb Remove Job from rename
A part of ISSUE#12151-Remove engine.Job mechanism

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-04-10 01:52:55 +08:00
Phil Estes
3ca46f29b8 Merge pull request #12232 from ahmetalpbalkan/names/kilby-joyce
namesgenerator: Proposing Kilby/Noyce
2015-04-09 11:25:19 -04:00
Liu Hua
645c020f5a fix up Image-name related issues in docker ps and CI
This patch include the following fixs:
 - fix image name error when docker ps
 - fix docker events test failure: use the exact image name for filter
 - fix docker build CI test failure due to "docker events" change

Because of change of daemon log behavior. Now we record
the exact Image name as you typed. So docker run -d busybux sh
and docker run -d busybox:latest are not the same in the log.
So it will affect the docker events. So change the related CI

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2015-04-09 23:03:23 +08:00
Brian Goff
7e70998bb8 Cleanup events filter by container test
This also seemed to be checking the ordering of the events, which
doesn't seem like something we sould be interested in this particular
test.

Added check to make sure the filtered events have the expected ID's.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-09 09:47:58 -04:00
Ahmet Alp Balkan
197ec4a637 namesgenerator: Proposing Kilby/Noyce
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-09 04:11:06 -07:00
Ahmet Alp Balkan
4c69d0dd8a cli_info_test: Check all required fields
`TestInfoEnsureSucceeds` is supposed to check existence of all
expected fields that are going to be shown in `docker info` command.

If this list was complete, it could have helped catching the missing
`"Logging Driver:"` regression.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-09 04:01:39 -07:00
Ahmet Alp Balkan
a4b7a9e1e5 cli: Better wording for daemon --log-driver
This flag is passed to the daemon CLI. In my opinion, "Container's
logging driver" is not accurate and refers to 'one container'.

Also the `syslog` driver was missing from the list. Having the list
of all logging drivers won't scale here (should be <80 chars per line)
and we have `rotation` driver coming up in the pipeline as well (gh11485).

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-09 02:12:44 -07:00
Chen Hanxiao
809d99ad91 docs: add missing accent mark around docker command
As we did everywhere.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-04-09 04:37:23 -04:00
WiseTrem
0fc75a3136 Removing unused getBoolParam func from api/server/server.go
Fix #12199

Signed-off-by: Gleb Shepelev <shepelyov.g@gmail.com>
2015-04-09 09:13:16 +03:00
Doug Davis
d045b9776b Remove Job from docker images
Also removes engine.Table

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-08 19:33:01 -07:00
Liu Hua
663d913011 Show the right image name/ID in job log
When we tag an Image with several names and we run one of them,
The "create" job will log this event with
 +job log(create, containerID, Imagename).

And the "Imagename" is always the first one (sorted). It is the
same to "start/stop/rm" jobs. So use the correct name instand.
This PR refer to #10479

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2015-04-09 09:41:23 +08:00
Ahmet Alp Balkan
c2c45d7769 execdriver/lxc: use local rand.Random in test
Preventing the test execution to pollute the deterministic runtime environment
by seeding the global rand.Random.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-08 18:13:07 -07:00
Brian Goff
91abff41dd Merge pull request #12206 from jfrazelle/11966-fix-racy-tests-on-overlay
cleanup/fix integration-cli for overlay in overlay
2015-04-08 20:52:58 -04:00
Jessica Frazelle
255b84444a cleanup/fix integration-cli for overlay in overlay
Signed-off-by: Jessica Frazelle <jess@docker.com>
2015-04-08 16:59:36 -07:00
Ahmet Alp Balkan
b66597eef1 docs: Markdown format fix around LogConfig param
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-08 16:16:37 -07:00
Tibor Vass
53582321ee Remove jobs from daemon/networkdriver/bridge
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-04-08 18:50:29 -04:00
Yestin Sun
7bb4b055ab Improve test accuracy for pkg/chrootarchive (part 1)
Check test correctness of untar by comparing destination with
source. For part one, it only compares the directories.

This is a supplement to the #11601 fix.

Signed-off-by: Yestin Sun <yestin.sun@polyera.com>
2015-04-08 14:07:31 -07:00
Arnaud Porterie
7233bd223d Merge pull request #12163 from duglin/RemoveJobPS
Remove Job from PS API
2015-04-08 13:43:47 -07:00
Michael Crosby
56a2c58760 Merge pull request #12194 from icecrime/update_maintainers
Drop shin from MAINTAINERS
2015-04-08 13:43:01 -07:00
Michael Crosby
66a68e378c Merge pull request #12171 from cstivers78/patch-1
Proposing Seymour Cray
2015-04-08 13:42:13 -07:00
Arnaud Porterie
d0c1fba73e Drop shin from MAINTAINERS
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-08 13:31:42 -07:00
Chris Stivers
5206f76f44 Proposing Seymour Cray
Signed-off-by: Chris Stivers <chris@stivers.us>
2015-04-08 13:17:22 -07:00
Alexander Morozov
776b7e8559 Merge pull request #12191 from kostickm/12189-fix-json-tags
Fixing JSON Tags
2015-04-08 13:11:54 -07:00
moxiegirl
57536d82e7 Merge pull request #12187 from moxiegirl/docs-makefile-update
Adding environment variables for sub projects
2015-04-08 12:48:09 -07:00
Mary Anthony
ef8b917fac Adding environment variables for sub projects
Fixes issue #12186
Fixing variables per Jess

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-08 12:23:50 -07:00
Megan Kostick
88119bb276 Fixing JSON Tags
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-08 12:05:12 -07:00
moxiegirl
26e83832c7 Merge pull request #11855 from nfirvine/master
Add some new graphics for mac installation with boot2docker
2015-04-08 10:41:50 -07:00
Doug Davis
1bfa80bdd9 Remove Job from PS API
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-08 10:30:17 -07:00
moxiegirl
ebc1e5ec9f Merge pull request #12176 from YanFeng-Adam/typo
Fix a typo in /doc/sources/reference/run.md
2015-04-08 10:08:05 -07:00
David Davis
f9d323d712 Fixing up the README
Fixing some small issues I found in the README like missing punctuation,
trailing whitespace, etc.

Signed-off-by: David Davis <daviddavis@redhat.com>
2015-04-08 12:57:19 -04:00
Arnaud Porterie
b8a7fdade6 Merge pull request #12178 from fschindler/fix-typo
Fixing typo.
2015-04-08 09:10:53 -07:00
moxiegirl
254d6f7752 Merge pull request #12133 from xiaods/fixed-issue-11500
fixed #11500 Add tip about filter proxy
2015-04-08 09:09:54 -07:00
Arnaud Porterie
a6d39e2a2d Merge pull request #12168 from cpuguy83/remove_dup_file_creation
Remove duplicate config file creation.
2015-04-08 09:03:43 -07:00
Alexander Morozov
3ebfc99d10 Merge pull request #12066 from LK4D4/split_events
Remove engine usage from events
2015-04-08 08:29:24 -07:00
Yan Feng
64fd944e30 Fix a typo in /doc/sources/reference/run.md
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-04-08 11:23:47 -04:00
Arnaud Porterie
94ade35e46 Merge pull request #12183 from runcom/remove-job-diff
Remove engine.Job from diff
2015-04-08 08:21:43 -07:00
Antonio Murdaca
e379e2668c Remove engine.Job from diff
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-08 15:52:10 +02:00
Doug Davis
7cfe438151 Merge pull request #12132 from sunyuan3/d
duplicate logDone in TestRenameRunningContainer and TestRenameCheckNames
2015-04-08 08:09:22 -04:00
Felix Schindler
8afd5cad31 Fixing typo.
Added missing white space.

Signed-off-by: Felix Schindler <fschindler@weluse.de>
2015-04-08 11:03:11 +02:00
Deshi Xiao
a40f379878 fixed #11500 Add tip about filter proxy
fixed #11500
Add tip about filter proxy to Docker installation Guides

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
2015-04-08 14:13:01 +08:00
Yuan Sun
cc30282e94 duplicate logDone in TestRenameRunningContainer and TestRenameCheckNames
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-08 13:33:05 +08:00
Brian Goff
24057777af Remove duplicate config file creation.
When `toDisk` is called, it is creating a file already, no need to
create it here.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-07 21:36:30 -04:00
Alexander Morozov
c956efcd52 Update libcontainer to bd8ec36106086f72b66e1be85a81202b93503e44
Fix #12130

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit 2f853b9493)
2015-04-07 16:22:37 -07:00
Alexander Morozov
5455864187 Test case for network mode chain container -> container -> host
Issue #12130

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ce69dafe4d)
2015-04-07 16:22:37 -07:00
Michael Crosby
06433cf812 Merge pull request #12161 from LK4D4/update_libcontainer
Update libcontainer
2015-04-07 16:18:33 -07:00
Jessie Frazelle
d08db9a059 Merge pull request #12160 from mrunalp/remove_unused
Removes unused function.
2015-04-07 16:05:49 -07:00
Alexander Morozov
ce69dafe4d Test case for network mode chain container -> container -> host
Issue #12130

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 15:20:42 -07:00
Mrunal Patel
195bebd3a7 Removes unused function.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-04-07 18:15:28 -04:00
Tibor Vass
dccda72a41 Merge pull request #12120 from LK4D4/split_attach
Remove engine usage from attach
2015-04-07 18:13:35 -04:00
Alexander Morozov
2f853b9493 Update libcontainer to bd8ec36106086f72b66e1be85a81202b93503e44
Fix #12130

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 15:10:44 -07:00
moxiegirl
8b71930570 Merge pull request #12154 from moxiegirl/carry-pr-11409
Carrying 11409 for a contributor
2015-04-07 15:00:26 -07:00
Alexander Morozov
d1423d28b5 Merge pull request #12155 from kostickm/12146-fix-fail-msg-TestRunDeviceDirectory
Fixing fail message in TestRunDeviceDirectory
2015-04-07 14:55:30 -07:00
moxiegirl
65ca20e6f1 Merge pull request #12156 from moxiegirl/pr-12008-carry
Carry PR 12008 for contributor
2015-04-07 14:54:02 -07:00
Alexander Morozov
c44f513248 Remove engine usage from attach
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 14:23:09 -07:00
Alexander Morozov
8fd2b52146 Fix fail message in TestEventsImageImport
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 14:22:43 -07:00
Mary Anthony
87e70b6831 Carry PR 12008 for contributor
Closes #8040
Remove a tic for the hawk

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-07 14:09:53 -07:00
Tibor Vass
9dd23be563 Merge pull request #11947 from TonnyXu/master
Updated the explanation of ONBUILD in best-practices doc
2015-04-07 16:53:43 -04:00
moxiegirl
4d4f201a4d Merge pull request #12089 from nerdalert/doc-fix-netw-nerdalert
Replaced level with layer for OSI model references
2015-04-07 13:29:40 -07:00
Jessie Frazelle
ebd7df3bbe Merge pull request #11909 from runcom/11908-refactor-utils-utils-daemon
Refactor utils/utils_daemon
2015-04-07 13:24:24 -07:00
Mary Anthony
fdfc36db41 Carrying 11409 for a client
Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-07 13:20:17 -07:00
Megan Kostick
05dcf26199 Fixing fail message in TestRunDeviceDirectory
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-07 13:14:47 -07:00
Vincent Batts
86d66d6273 Merge pull request #12033 from rhvgoyal/devmapper-cleanup
Devmapper Graph Driver Misc cleanup
2015-04-07 15:49:32 -04:00
Phil Estes
e011119a49 Merge pull request #12129 from duglin/RemoveTable5
Remove engine.Table from more daemon side stuff
2015-04-07 12:53:55 -04:00
moxiegirl
531d2b3b80 Merge pull request #12136 from YanFeng-Adam/typo
Fix 2 typos in /doc/sources/reference/run.md
2015-04-07 09:21:01 -07:00
Yan Feng
805f34bb5b Fix 2 typos in /doc/sources/reference/run.md
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
2015-04-07 14:15:05 -04:00
Alexander Morozov
d487ca03e6 Remove events package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 08:43:18 -07:00
Alexander Morozov
c9eb37f975 Remove engine usage for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 08:43:18 -07:00
Alexander Morozov
868f56e083 New package daemon/events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 08:43:14 -07:00
Brent Salisbury
7165089f34 Replaced level with layer for OSI model references
- ty to @moxiegirl for the info workflow for patching images.

-link to the v6 svg (grey L2 switch in the top /level/layer/)
http://docs.master.dockerproject.com/article-img/ipv6_switched_network_example.svg

Signed-off-by: Brent Salisbury <brent.salisbury@docker.com>
2015-04-06 22:23:40 -04:00
Ahmet Alp Balkan
ceb72fab34 Swap width/height in GetWinsize and monitorTtySize
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
(cherry picked from commit 6e44246fed)
2015-04-06 16:55:38 -07:00
Jessie Frazelle
9ede3f9fc1 Merge pull request #12127 from ahmetalpbalkan/win-cli/termsize-fix
Swap width/height in GetWinsize and monitorTtySize
2015-04-06 16:54:29 -07:00
Doug Davis
650bc2ffe5 Remove engine.Table from more daemon side stuff
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-06 15:06:02 -07:00
Ahmet Alp Balkan
6e44246fed Swap width/height in GetWinsize and monitorTtySize
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-06 14:31:42 -07:00
Phil Estes
3588c5fbc7 Merge pull request #12125 from LK4D4/fix_events_streaming_test
Fix events streaming test
2015-04-06 17:12:48 -04:00
Alexandr Morozov
e45bf8d2e9 Decrease timeouts in TestEventsStreaming
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2015-04-06 13:40:56 -07:00
Alexandr Morozov
5fa3a6f248 Pass right timestamp instead of crap from string(int64)
Problem is that --since can consume anything not near looking as
timestamp.

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2015-04-06 13:39:02 -07:00
Phil Estes
dec48d6708 Merge pull request #12070 from duglin/RemoveTableCLI
Last step in removing engine.Table from api/client/*
2015-04-06 16:33:29 -04:00
Arnaud Porterie
8a50746b5d Merge pull request #11686 from willhf/9340_test
Add test for net=container and links
2015-04-06 13:21:01 -07:00
Michael Crosby
488a721dc9 Merge pull request #12121 from tiborvass/copy-not-deprecated
Revert "Since `COPY` has been deprecated in the recent release of Docker...
2015-04-06 13:18:55 -07:00
Tibor Vass
d2992c78dc Revert "Since COPY has been deprecated in the recent release of Docker I updated the best practices section to inform users that ADD is the way forward and to not use COPY."
COPY was not deprecated.

This reverts commit 3148063af1.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-04-06 15:34:10 -04:00
Vincent Batts
ca628c6216 devmapper: udev sync is a requirement
closes #10664
closes #4036

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-04-06 15:17:57 -04:00
Jessie Frazelle
37a16580b1 Merge pull request #12064 from brendandixon/win-cli/rawfix
Windows console fixes
2015-04-06 18:45:08 +00:00
moxiegirl
9cad920c08 Merge pull request #11993 from crunchywelch/master
add centos to supported distros
2015-04-06 11:44:40 -07:00
moxiegirl
2c44556ff9 Merge pull request #12093 from malnick/malnick_dockerfile_best_practice_update
Updated the dockerfile best practice section on ADD and COPY
2015-04-06 11:43:50 -07:00
moxiegirl
ce18734c2c Merge pull request #12055 from l0kix2/patch-1
Improved "start a container" section 1.16 & 1.17 API docs
2015-04-06 11:41:38 -07:00
Alexander Morozov
f5657249a0 Merge pull request #11324 from sunyuan3/TestDaemonwithwrongkey
add TestDaemonwithwrongkey test case
2015-04-06 11:35:05 -07:00
Alexander Morozov
a0fc0343b7 Merge pull request #12090 from runcom/12079-events-streaming-tests
Test events streaming
2015-04-06 11:23:47 -07:00
Arnaud Porterie
ed8d402851 Merge pull request #11978 from x1022as/info-show-loggingdriver
docker info show logging driver info
2015-04-06 11:11:31 -07:00
Doug Davis
065648a832 Last step in removing engine.Tabel from api/client/*
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-06 10:55:53 -07:00
Tibor Vass
281b8f67e1 Merge pull request #11293 from shishir-a412ed/docker_load_clobber_image_name
Fix for Issue 11285: warning message displayed when updating an existing image
2015-04-06 13:04:49 -04:00
malnick
3148063af1 Since COPY has been deprecated in the recent release of Docker I updated the best practices section to inform users that ADD is the way forward and to not use COPY.
Signed-off-by: malnick <malnick@gmail.com>
2015-04-06 10:04:42 -07:00
moxiegirl
3e077bb3f7 Merge pull request #12100 from draghuram/docker_update
Add the missing option to the wget command for updating Docker.
2015-04-06 10:03:23 -07:00
Antonio Murdaca
d1c4439b5a Test events streaming, fixes #12079
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-06 19:00:17 +02:00
moxiegirl
96c3141fa5 Merge pull request #12020 from chenhanxiao/docker-import-commit
docs: keep the style of docker-commit consistent with docker-import
2015-04-06 09:47:47 -07:00
Tianon Gravi
eee1efcfd6 Add "builder-deb" base images for building ".deb" packages properly
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-06 10:43:36 -06:00
Brian Goff
d3fa57e051 Merge pull request #12112 from kostickm/12042-fix-logDone-format
Fixes logDone format
2015-04-06 12:34:38 -04:00
Tianon Gravi
8b4c3a111d Merge pull request #10275 from Snorch/master
docker-tests: mount hierarchies and make symlinks for subsystems
2015-04-06 10:32:04 -06:00
moxiegirl
d489b91aa9 Merge pull request #11915 from ZJU-SEL/fix_issue_11676_11754
clarify RLIMIT_AS is disabled, explain how to edit DOCKER_OPTS
2015-04-06 09:23:53 -07:00
Arnaud Porterie
ac93a13e27 Merge pull request #11554 from Sirupsen/logrus-fields
logging: use logrus fields
2015-04-06 09:00:18 -07:00
Megan Kostick
d6ada45f45 Closes #12042 - fix logDone format
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-06 08:54:35 -07:00
Arnaud Porterie
90be2a66a8 Merge pull request #12102 from x1022as/typo
fix typo
2015-04-06 08:46:41 -07:00
Arnaud Porterie
b9d2ede4d4 Merge pull request #12107 from cpuguy83/remove_striptrailingchars
Remove `stripTrailingCharacters` from tests
2015-04-06 08:46:08 -07:00
Arnaud Porterie
716576b0cc Merge pull request #12110 from leoh0/fix-typo
Minor spelling fix
2015-04-06 08:43:18 -07:00
Eohyung Lee
7986c37996 Minor spelling fix
Signed-off-by: Eohyung Lee <liquidnuker@gmail.com>
2015-04-06 23:27:53 +09:00
Brian Goff
475c65319b Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Shishir Mahajan
7d0053d554 Applying: Fix for Issue 11285: warning message displayed when updating an existing image
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-04-06 09:05:03 -04:00
Deng Guangxing
71de711189 fix typo in cli.md
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-04-06 16:11:40 +08:00
Raghuram Devarakonda
9287e70c12 Add the missing option to the wget command for updating Docker.
Signed-off-by: Raghuram Devarakonda <draghuram@gmail.com>
2015-04-05 23:00:21 -04:00
willhf
bc0cdc0a4c Fix incompatible flags conditional
Signed-off-by: willhf <willhf@gmail.com>
2015-04-05 19:38:31 -07:00
Simei He
5057d7da13 fix the space thing.
Signed-off-by: Simei He <hesimei@zju.edu.cn>
2015-04-06 09:00:59 +08:00
Yuan Sun
ef13dcd4dc add TestDaemonwithwrongkey test case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-06 08:57:47 +08:00
Doug Davis
58390b6087 Merge pull request #12075 from eljojo/remove_stupid
Remove "stupid" wording
2015-04-04 12:37:38 -04:00
José Tomás Albornoz
4cf5a1c2aa Remove "stupid" wording
Signed-off-by: José Tomás Albornoz <jojo@eljojo.net>
2015-04-04 15:26:45 +02:00
Doug Davis
ca8d196d13 Merge pull request #12074 from guoxiuyan/Fix_typo
Fix a minor typo
2015-04-04 07:34:35 -04:00
Kirill SIbirev
ac12c80537 Improved "start a container" section in 1.16 & 1.17 docs
It seems it was lost or something

Signed-off-by: Kirill Sibirev <l0kix2@gmail.com>
2015-04-04 11:23:49 +03:00
guoxiuyan
ffcc4a1e52 Fix a minor typo
Signed-off-by: Guo Xiuyan <guoxiuyan@huawei.com>
2015-04-04 15:36:35 +08:00
Tonny Xu
e50636617f Updated the explanation of ONBUILD in best-practices doc
Signed-off-by: Tonny Xu <tonny.xu@gmail.com>
2015-04-04 12:46:25 +09:00
Michael Crosby
2a79d54f4c Merge pull request #12063 from icecrime/update_maintainers
Several updates to MAINTAINERS file
2015-04-03 17:20:20 -07:00
Arnaud Porterie
a45375f1f9 Merge pull request #12069 from whoshuu/notice-link
Make NOTICE in the README into a link
2015-04-03 17:08:53 -07:00
Arnaud Porterie
886026f99e Add thaJeztah
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-03 16:37:36 -07:00
Huu Nguyen
d94e186442 Make NOTICE in the README into a link
Signed-off-by: Huu Nguyen <whoshuu@gmail.com>
2015-04-03 16:36:49 -07:00
Tianon Gravi
6a99c2032e Merge pull request #12065 from proppy/patch-14
test-unit: fix TESTFLAGS doc
2015-04-03 16:26:11 -06:00
Simon Eskildsen
e1ca439828 daemon: convert version log statement to fields
Signed-off-by: Simon Eskildsen <sirup@sirupsen.com>
2015-04-03 18:22:17 -04:00
Johan Euphrosine
5846914f91 test-unit: fix TESTFLAGS doc
Signed-off-by: Johan Euphrosine <proppy@google.com>
2015-04-03 15:05:14 -07:00
Brendan Dixon
1a36a113d4 Windows console fixes
Corrected integer size passed to Windows
Corrected DisableEcho / SetRawTerminal to not modify state
Cleaned up and made routines more idiomatic
Corrected raw mode state bits
Removed duplicate IsTerminal
Corrected off-by-one error
Minor idiomatic change

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
2015-04-03 15:02:52 -07:00
Arnaud Porterie
58f07c9d8a Rename status labels
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-03 14:33:16 -07:00
Arnaud Porterie
80f3085651 Sort maintainers alphabetically
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-03 14:33:16 -07:00
Arnaud Porterie
370cef012e Move docs approval section
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-03 14:33:16 -07:00
Jessie Frazelle
b2fbd9e632 Merge pull request #12060 from duglin/RemoveTable3
Remove engine.Table from docker search and fix missing field
2015-04-03 21:29:36 +00:00
Jessie Frazelle
9cdad8a26b Merge pull request #11886 from jamiehannaford/pkg-mnt-docs
Document exported functions and consts in pkg/mount
2015-04-03 21:28:11 +00:00
Alexander Morozov
5c83dfe670 Merge pull request #11994 from unclejack/jsonfilelog_allocations
daemon/logger/jsonfilelog: avoid some allocations
2015-04-03 13:58:13 -07:00
Jessie Frazelle
4d571257ed Merge pull request #12039 from ahmetalpbalkan/windows-install-docs-update
docs: Add new windows installation tutorials
2015-04-03 20:39:21 +00:00
moxiegirl
fb1e10284b Merge pull request #11968 from thaJeztah/docs-fix-bullets-and-labels-filter
docs: fix bullet list and missing label filter
2015-04-03 12:33:22 -07:00
moxiegirl
a6c04f33e1 Merge pull request #12003 from sleinen/patch-1
Make explanation consistent with command
2015-04-03 12:19:37 -07:00
moxiegirl
6d5a0ac11e Merge pull request #12057 from icecrime/11925_carry
Specify running `boot2docker ip` on host
2015-04-03 12:11:53 -07:00
Jessie Frazelle
409ed98c3f Merge pull request #12048 from tianon/auto-btrfs_noversion
Change the btrfs_noversion check to be automatic
2015-04-03 19:00:57 +00:00
Jessie Frazelle
3985dc299a Merge pull request #12054 from eluck/master
Update userguide/dockervolumes - fixes issue #12052
2015-04-03 18:58:52 +00:00
Jessie Frazelle
3683498d6f Merge pull request #12037 from twhiteman/master
integration-cli: in TestPsListContainersSize, check for no containers
2015-04-03 18:52:26 +00:00
Jessie Frazelle
55da2e5987 Merge pull request #12059 from whoshuu/readme
Clean up formatting in the README
2015-04-03 18:49:26 +00:00
Ahmet Alp Balkan
2b320a2309 docs: Add new windows installation tutorials
Updated Windows installation documentation with newest
screencasts and Chocolatey instructions to install windows
client CLI.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-04-03 11:33:34 -07:00
Doug Davis
67b4cce0f6 Remove engine.Table from docker search and fix missing field
registry/SearchResults was missing the "is_automated" field.
I added it back in.

Pull this 'table' removal one from the others because it fixed
a bug too

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-03 11:27:30 -07:00
Michael Crosby
e64f6baf11 Merge pull request #12010 from ibuildthecloud/small
Small changes from #11967 for review comments
2015-04-03 11:27:06 -07:00
Jessie Frazelle
b3e9c274dd Merge pull request #11981 from unclejack/fix_profiler
api/server: fix profiler HTTP serving
2015-04-03 18:25:12 +00:00
Antonio Murdaca
01724c1cf1 Refactor ultis/utils_daemon, fixes #11908
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-03 20:20:04 +02:00
Michael Crosby
326a5545d4 Merge pull request #12058 from duglin/RemoveTable2
Remove engine.Table from docker history and docker rmi
2015-04-03 10:57:52 -07:00
moxiegirl
12e7787540 Merge pull request #12017 from moxiegirl/distribution-man-pages
Updating with man pages for distribution
2015-04-03 09:55:08 -07:00
Huu Nguyen
bfddad18ce Clean up formatting in the README
Signed-off-by: Huu Nguyen <whoshuu@gmail.com>
2015-04-03 09:50:35 -07:00
Arnaud Porterie
61933395eb Merge pull request #11860 from maximkulkin/11575-dockerize-image-tool
Add tool to conver disk image into Docker image
2015-04-03 09:32:11 -07:00
Arnaud Porterie
c8ca904f15 Merge pull request #11881 from jrjang/master
mkimage-arch: set default C.UTF-8 locale
2015-04-03 09:28:11 -07:00
Arnaud Porterie
bcbdf77ddb Specify running boot2docker ip on host
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-03 08:53:44 -07:00
Alexander Morozov
03525d5fc6 Merge pull request #11956 from coolljt0725/add_memcg_swap_cgroup_enabled_to_check_config
add MEMCG_SWAP_ENABLED to check-config.sh
2015-04-03 08:50:54 -07:00
Doug Davis
2c5da7d1ac Merge pull request #12018 from sunyuan3/search
If docker search with --starts=${negative number}, it would show the war...
2015-04-03 11:38:38 -04:00
Doug Davis
0b2fa9c707 Remove engine.Table from docker history and docker rmi
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-03 08:31:30 -07:00
moxiegirl
05753288c4 Merge pull request #11997 from tiborvass/carry-11926
Carry 11926: Added information about accessing host directory on Windows.
2015-04-03 06:43:38 -07:00
moxiegirl
da61228501 Merge pull request #11775 from maximkulkin/explain-advanced-contribution-workflow
Explain advanced contribution workflow more
2015-04-03 06:41:49 -07:00
Aaron Welch
a6b8f2e3fe add centos to supported distros
Signed-off-by: Aaron Welch <welch@packet.net>
2015-04-03 08:56:26 -04:00
eluck
57b09068ef Update userguide/dockervolumes - fixes issue #12052
Signed-off-by: Evgeny Lukianchikov <mail@eluck.me>
2015-04-03 14:07:51 +03:00
Jamie Hannaford
9a98556c2b Add documentation for exported functions and types
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2015-04-03 11:33:34 +02:00
Tianon Gravi
3761955e8c Change the btrfs_noversion check to be automatic
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-03 01:30:12 -06:00
Simei He
8c578b8190 minor edits.
Signed-off-by: Simei He <hesimei@zju.edu.cn>
2015-04-03 14:43:21 +08:00
Arnaud Porterie
a3a45a6ec0 Merge pull request #11883 from coolljt0725/add_missing_option_to_bash_completion
Add some missing option to bash completion
2015-04-02 22:49:58 -07:00
Alexander Morozov
4e90b47cc2 Merge pull request #12043 from joeygibson/12041-fix-vet-warnings
Fix vet warnings in pkg/requestdecorator/requestdecorator_test.go #12041
2015-04-02 22:07:55 -07:00
Joey Gibson
a9443de7c5 Fix vet warnings in pkg/requestdecorator/requestdecorator_test.go #12041
Signed-off-by: Joey Gibson <joey@joeygibson.com>
2015-04-03 00:18:21 -04:00
Yuan Sun
87e0e4eb43 If docker search with --starts=${negative number}, it would show the warning.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-03 08:55:34 +08:00
Tibor Vass
f92e88b7e0 Merge pull request #11995 from icecrime/test_daemon_stop
Properly stop test daemon in integration-cli
2015-04-02 20:27:20 -04:00
Phil Estes
3f1590f679 Merge pull request #12040 from duglin/TableFromDiff
Remove use of Table from 'docker diff'
2015-04-02 17:21:40 -07:00
Doug Davis
49c72506ac Remove use of Table from 'docker diff'
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-02 16:55:58 -07:00
Arnaud Porterie
9c505c906d Merge pull request #11571 from noironetworks/11555-Docker-since-beginning-of-unix-time-doesnt-work
Fixes docker events since beginning of unix time
2015-04-02 15:03:04 -07:00
Jessie Frazelle
962ded2dee Merge pull request #12036 from crosbymichael/update-libcontainer-apr2
Update libcontainaer to d00b8369852285d6a830a8d3b9
2015-04-02 14:46:44 -07:00
Todd Whiteman
3e51a81475 integration-cli: add check for TestPsListContainersSize when no containers are returned
* when no containers are returned, go test would then aborts with:
  panic: runtime error: index out of range

Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
2015-04-02 14:45:52 -07:00
Michael Crosby
d12fef1515 Update libcontainaer to d00b8369852285d6a830a8d3b9
Fixes #12015

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-02 14:12:55 -07:00
Vivek Goyal
c737800b7f devmapper: Retry device removal after 100ms instead of 10ms
Right now we try device removal at the interval of 10ms and keep on trying
till either device is removed or 10 seconds are over. That means if device
is busy, we will try 1000 times in those 10 seconds.

Sounds too high a frequency of deivce removal retrial. All the logs are
filled easily. I think it is a good idea to slow down a bit and retry at
the interval of 100ms instead of 10ms.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Vivek Goyal
f74d12012c devmapper: Remove call to waitClose()
During device removal, we are first waiting for device to close() in a tight
loop for 10 seconds. I am not sure why do we need it. First of all we come
here once the umount() is successful so device should be free. For some reason
of device is temporarily busy, then removeDevice() logic retries device removal
logic in a loop for 10 seconds and that should cover it. Can't see why one
more 10 seoncds loop is required before attempting device removal.

One loop should be able to cover all the temporary device busy conditions and
if condition is not temporary then 10 seconds loop is not going to help anyway.

So instead of two loops of 10 seconds each, I am converting it to a single
loop of 20 seconds. May be 10 second loop is good enough but for now I am
keeping it 20 seconds to avoid any regressions.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Vivek Goyal
dbf04ec4e2 devmapper: Remove extra wait after device removal
Currently in device removal path (device deactivation), we wait
for 10 seconds for devive to actually go away. waitRemove().

In current code this is not required. If dm removal task has completed
and one has done the wait on udev cookie, then device is gone and there
is no need to write another loop to wait for device removal.

This patch removes the waitRemove() which waits for 10 seconds after
device removal. This seems unnecessary.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Vivek Goyal
665656afbb devmapper: Use a pointer as argument to deferred function UdevWait()
UdevWait() is deferred and takes uint cookie as an argument. As arguments
to deferred functions are calculated at the time of call, it is possible
that any update to cookie later by libdm are not taken into account when
UdevWait() is called. Hence use a pointer to uint as argument to UdevWait()
function.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Vivek Goyal
cb7c893275 devicemapper: Remove debug messages from RemoveDevice()
devmapper graph driver retries device removal 1000 times in case of failure
and if this fills up console with 1000 messages (when daemon is running in
debug mode). So remove these debug messages.
 
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Vivek Goyal
e07d3cd9ac devmapper: Fix libdm logging
There are issues with libdm logging. Right now if docker daemon is run
in debug mode, logging by libdm is too verbose. And if a device can't 
be removed, thousands of messages fill the console and one can not see
what's going on.

This patch removes devicemapper.LogInitVerbose() call as that call will
only work if docker was not registering its own log handler with libdm.
For some reason docker registers one with libdm and libdm hands over
all the messages to docker (including debug ones). And now it is up to
devmapper backend to figure out which ones should go to console and
which ones should not.

So by default log only fatal messages from libdm. One can easily modify
the code to change it for debugging purposes.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-04-02 16:47:14 -04:00
Tibor Vass
c88b2c422f Merge pull request #12012 from jfrazelle/fix-race-volumes-from-api
TestVolumesFromHasPriority fix race
2015-04-02 16:01:09 -04:00
Tibor Vass
42c7855014 Merge pull request #12011 from jfrazelle/fix-lxc-device-test
fix device test on lxc...
2015-04-02 16:00:39 -04:00
Alexander Morozov
104b20a133 Merge pull request #12026 from cpuguy83/add_self_to_maintainers
Add cpuguy83 to maintainers.people
2015-04-02 09:20:19 -07:00
Arnaud Porterie
02c2308e39 Properly stop test daemon in integration-cli
Always stop the test daemon in an attempt to fix race conditions in
subsequent tests.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-02 08:53:31 -07:00
Alexander Morozov
ccfbe880c8 Merge pull request #12029 from unclejack/testpsgroupportrange_fast
integration-cli: make TestPsGroupPortRange fast
2015-04-02 08:48:08 -07:00
unclejack
132da3f036 daemon/logger/jsonfilelog: avoid some allocations
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-02 18:33:23 +03:00
unclejack
cfa8aaf16f integration-cli: make TestPsGroupPortRange fast
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-02 18:26:29 +03:00
Peter Esbensen
6896016b7c Fixes #11721 removed GenerateRandomString
Signed-off-by: Peter Esbensen <pkesbensen@gmail.com>

gofmt

Signed-off-by: Peter Esbensen <pkesbensen@gmail.com>
2015-04-02 08:07:52 -07:00
Peter Esbensen
11287f7714 Added unit tests for stringutils GenerateRandomAlphaOnlyString and GenerateRandomAsciiString
Signed-off-by: Peter Esbensen <pkesbensen@gmail.com>
2015-04-02 07:12:47 -07:00
Brian Goff
6ac845edad Add cpuguy83 to maintainers.people
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-02 08:51:47 -04:00
Tibor Vass
9707286a5c Merge pull request #11149 from duglin/8667-AdvancedVars
Add support for advanced ${} uses
2015-04-02 08:25:49 -04:00
Chen Hanxiao
8fa03df885 docs: keep the style of docker-commit consistent with docker-import
add a pair of accent mark around dockerfile commands
in docker-commit, as the same thing in docker-import.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-04-02 05:01:14 -04:00
unclejack
3bea892d54 api/server: fix profiler HTTP serving
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-02 09:53:40 +03:00
Mary Anthony
b6d55ebcbc Updating with man pages for distribution
Went through the man pages to update for the
v2 instance. Checked against the commands.

Signed-off-by: Mary Anthony <mary@docker.com>
2015-04-01 21:02:19 -07:00
Jessica Frazelle
c447fd339a TestVolumesFromHasPriority fix race
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)
2015-04-01 18:06:28 -07:00
Jessica Frazelle
f472c7236f fix device test on lxc, on lxc in contianers there are no dirs with devices in /dev, but this works outside a container...
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
2015-04-01 17:47:36 -07:00
Lei Jitang
a9588158b5 Add MEMCG_SWAP_ENABLED to check-config.sh
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-02 08:38:39 +08:00
Darren Shepherd
7433c9c92a Make server_windows.go consistent with server_linux.go
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-04-01 17:31:15 -07:00
Darren Shepherd
34f44c642f Infer type
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-04-01 17:31:09 -07:00
Andrea Luzzardi
b9be50b578 Merge pull request #10745 from jfrazelle/device-dir
Mounting a dir of devices like /dev/snd should mount all child devices
2015-04-01 16:53:01 -07:00
Sebastiaan van Stijn
37c7f3a204 docs: fix bullet list and missing label filter
Some bullet lists didn't render as bullet-lists because
of a missing newline.

Also added missing "label" filter for `docker ps` and
slightly re-worded the header above the supported filters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-04-02 01:48:28 +02:00
Arnaud Porterie
3f77f627d0 Merge pull request #12007 from crosbymichael/fix-oom-hang
Return closed channel if oom notification fails
2015-04-01 15:59:20 -07:00
Jessica Frazelle
664004ed0c Mounting a directory of devices like /dev/snd should mount all child devices.
I have seen a lot of people try to do this and reach out to me on how to mount
/dev/snd because it is returning "not a device node". The docs imply you can
_just_ mount /dev/snd and that is not the case. This fixes that. It also allows
for coolness if you want to mount say /dev/usb.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-04-01 15:57:41 -07:00
Arnaud Porterie
3fe7a3d537 Merge pull request #12005 from LK4D4/bump_docs
Bump API version and docs to v1.19
2015-04-01 15:34:28 -07:00
Vincent Batts
88b8fc10e3 Merge pull request #11099 from iavael/bugfix/tar-symlinks
Fixed handling hardlinks to symlinks in tar stream
2015-04-01 18:34:00 -04:00
Michael Crosby
7061a993c5 Return closed channel if oom notification fails
When working with Go channels you must not set it to nil or else the
channel will block forever.  It will not panic reading from a nil chan
but it blocks.  The correct way to do this is to create the channel then
close it as the correct results to the caller will be returned.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-04-01 15:30:48 -07:00
Alexander Morozov
2c0ee48224 Merge pull request #12006 from icecrime/add_kitematic_to_readme
Add Kitematic to README.md
2015-04-01 14:41:41 -07:00
Arnaud Porterie
7bd250c74d Add Kitematic to README.md
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-04-01 14:38:49 -07:00
Nick Irvine
1a4d2a5c8b Add some new graphics for installation and understanding docs
Fixes: #11552

- scalable SVG
- uses colours from the rest of the page
- emphasizes that boot2docker is the ordinary Linux setup in a VM
- Add new graphic for architecture diagram
- Add windows boot2docker diagram
- Add windows diagram to documentation
- Remove old PNGs; replaced with SVGs
- Add redirects for new SVG versions of installation diagrams

Signed-off-by: Nick Irvine <nfirvine@nfirvine.com>
2015-04-01 14:24:53 -07:00
Alexander Morozov
81f9b72c64 Bump API version and docs to v1.19
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-01 13:40:56 -07:00
Tibor Vass
4467b6a2cb Merge pull request #11974 from crosbymichael/registry-jobs
Remove jobs from registry.Service
2015-04-01 16:32:41 -04:00
Simon Leinen
b58c4b8e68 Make explanation consistent with command
To reduce confusion of the reader.  Fixes a likely cut & paste error.

Signed-off-by: Simon Leinen <simon.leinen@gmail.com>
2015-04-01 21:54:21 +02:00
Alexander Morozov
7101419c1c Merge pull request #11990 from duglin/11985-RemoveDeadCode
Remove dead code looking for non-existent err msg
2015-04-01 10:46:10 -07:00
Jay
6e46204ab8 Added information about accessing host directory on Windows.
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-04-01 13:36:43 -04:00
André Martins
8f7ac20bac Fixes docker events since beginning of unix time
Fixes issue #11555
Applied a workaround to check if since and until flags are valid or not.

Signed-off-by: André Martins <martins@noironetworks.com>
2015-04-01 18:14:59 +01:00
Alexander Morozov
624de8a9cd Merge pull request #11949 from MabinGo/fix_randombug_in_eventtest
Fix random error in cli events test
2015-04-01 09:26:48 -07:00
Doug Davis
39908fc6d9 Add support for more advanced ${xxx:...} syntax
Just ${xxx:+...} and ${xxx:-...} for now

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-01 08:11:15 -07:00
moxiegirl
39711c8b26 Merge pull request #11969 from powo/patch-1
Update networking.md (IPv6 wrong prefix)
2015-04-01 07:45:31 -07:00
Doug Davis
d351aef8af Remove dead code looking for non-existent err msg
Closes #11985

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-01 07:37:10 -07:00
moxiegirl
dc564d8cf8 Merge pull request #11972 from thaJeztah/docs-fix-heading-level
docs: fix heading level of logging drivers
2015-04-01 07:34:45 -07:00
moxiegirl
f73109b883 Merge pull request #11982 from sunyuan3/docker-run
Fix typoes in docker-run.1.md
2015-04-01 07:32:06 -07:00
James Turnbull
a73b7354a6 Merge pull request #11954 from ankushagarwal/#11953
Use different host and container port for clarity
2015-04-01 09:21:15 -04:00
Yuan Sun
a44451d40e Fix typoes in docker-run.1.md
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-04-01 17:09:01 +08:00
Deng Guangxing
f5a401d3fe docker info show logging driver info
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-04-01 16:05:14 +08:00
Mabin
e15c3e36cc Fix random bug in cli events test
Signed-off-by: Mabin <bin.ma@huawei.com>
2015-04-01 11:00:01 +08:00
Lei Jitang
7105f93a72 Add some missing option to bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-01 10:35:05 +08:00
Michael Crosby
98cfa2aecd Merge pull request #11975 from duglin/FixOOMTest
Increase timeout on TestRunOOMExitCode test
2015-03-31 17:24:26 -07:00
Doug Davis
8d1455d88b Increase timeout on TestRunOOMExitCode test
I can never get it to work for me when its just 3 seconds.
With this change it generates the OOM message around 17 seconds, but
I increased the timeout to 30 for people with slower machines

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-31 16:57:43 -07:00
Michael Crosby
e736f16bbd Merge pull request #11930 from unclejack/broadcastwriter_refactor
pkg/broadcastwriter: use []byte to lower alloc
2015-03-31 16:47:23 -07:00
Michael Crosby
03d3d79b2b Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 16:38:04 -07:00
Jessie Frazelle
596ddef7d7 Merge pull request #11967 from LK4D4/fix_panic
Avoid ServeApi race condition
2015-03-31 16:37:32 -07:00
Sebastiaan van Stijn
f855d5dde7 Fix heading level of logging drivers
Syslog was a heading-2, but should be heading-3;
changed the headings to heading-4 to match the
"network settings" section.

Also changed "Log driver" to "logging driver" for JSON.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-04-01 01:07:22 +02:00
Wolfgang Powisch
6a47c70d60 Update networking.md
Signed-off-by: Wolfgang Powisch <powo@powo.priv.at>
2015-04-01 00:44:41 +02:00
unclejack
153f98bad5 pkg/broadcastwriter: reset after 4 KB w/o stream
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-01 01:26:19 +03:00
Alexander Morozov
c717475714 Fix panic in integration tests
Closing activationLock only if it's not closed already. This is needed
only because integration tests using docker code directly and doesn't
care about global state.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-31 15:12:15 -07:00
Derek McGowan
62009ef77e Use vendored v2 registry api
Update registry package to use the v2 registry api from distribution. Update interfaces to directly take in digests.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-03-31 15:02:27 -07:00
Alexander Morozov
d15d1674c3 Skip heavy operations if there is no jsonlog writers
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-01 01:02:18 +03:00
unclejack
5550a46946 pkg/broadcastwriter: use []byte to lower alloc
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-01 01:02:18 +03:00
unclejack
b535ed3595 pkg/jsonlog: add JSONLogBytes for low allocations
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-01 01:02:18 +03:00
unclejack
f26f405b00 pkg/broadcastwriter: add test w/ "" stream only
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-04-01 01:02:18 +03:00
Derek McGowan
f011d722ce Vendor distribution v2 api
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-03-31 14:58:45 -07:00
Michael Crosby
7dd79dcc7b Merge pull request #11952 from ankushagarwal/#11581
Add some documentation to pkg/system
2015-03-31 14:58:32 -07:00
Michael Crosby
ded5c73deb Merge pull request #11962 from vbatts/vbatts-promote_overlay
graphdriver: promote overlay above vfs
2015-03-31 14:39:08 -07:00
Alexander Morozov
e4545ed8cb Merge pull request #11963 from crosbymichael/api-server
API Server Socket Refactoring
2015-03-31 14:25:32 -07:00
Vincent Batts
2c72ff1dbf graphdriver: promote overlay above vfs
It's about time to let folks not hit 'vfs', when 'overlay' is supported
on their kernel. Especially now that v3.18.y is a long-term kernel.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-31 17:18:49 -04:00
Michael Crosby
da6248751b Merge pull request #11961 from dmcgowan/fix-build-progress-output-11849
Fix progress reader output on close
2015-03-31 14:04:33 -07:00
Jessie Frazelle
749a117267 Merge pull request #11934 from cpuguy83/fix_volume_symlink_check
Fix volume symlink check
2015-03-31 13:56:23 -07:00
Arnaud Porterie
e04acf8a38 Merge pull request #11045 from brahmaroutu/fixtest_10964
Skip TestEventsImagePull unless network is available
2015-03-31 13:48:54 -07:00
Michael Crosby
62806cc85e Refactor API socket handling
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 13:37:49 -07:00
Michael Crosby
b85cf5da5e Merge pull request #11958 from LK4D4/fix_portmapper_race
Move portmapper initialization to var block
2015-03-31 13:23:45 -07:00
Jessie Frazelle
a381a1bb03 Merge pull request #11473 from pradeepchhetri/docker-wait-cli-integration-test
Added basic integration tests for docker wait command
2015-03-31 13:23:23 -07:00
Derek McGowan
aa3083f577 Fix progress reader output on close
Currently the progress reader won't close properly by not setting the close size.

fixes #11849

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-03-31 13:17:25 -07:00
Jessie Frazelle
b875e126dd Merge pull request #11137 from rhvgoyal/fix-removal
Do not remove container if underlying resource cleanup failed
2015-03-31 13:09:23 -07:00
Brian Goff
63708dca8a Use getResourcePath instead
Also cleans up tests to not shell out for file creation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-31 15:10:30 -04:00
Ankush Agarwal
e94a48ffc8 Add some documentation to pkg/system
Partially addresses #11581

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-31 12:00:33 -07:00
Ankush Agarwal
8caf8f0a79 Use different host and container port for clarity
Fixes #11953

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-31 11:59:58 -07:00
Michael Crosby
7609d52797 Move Profiler into specific http.Handler
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-31 11:38:17 -07:00
Alexander Morozov
584180fce7 Initialize portMapper in RequestPort too
Api requesting port for daemon before init_networkdriver called.
Problem is that now initialization of api depends on initialization of
daemon and their intializations runs in parallel. Proper fix will be
just do it sequentially. For now I don't want refactor it, because it
can bring additional problems in 1.6.0.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-31 11:30:57 -07:00
Jun-Ru Chang
9e9adf8075 mkimage-arch: set C.UTF-8 default locale
It may not work fine when doing expect script if setting other locales.

Signed-off-by: Jun-Ru Chang <jrjang@gmail.com>
2015-04-01 00:40:34 +08:00
Tibor Vass
ddbc68f564 Merge pull request #11843 from ahmetalpbalkan/win-cli/monitorttysize
windows: monitorTtySize correctly by polling
2015-03-31 11:14:04 -04:00
Vivek Goyal
40945fc186 container: Do not remove contianer if any of the resource failed cleanup
Do not remove container if any of the resource could not be cleaned up. We
don't want to leak resources.

Two new states have been created. RemovalInProgress and Dead. Once container
is Dead, it can not be started/restarted. Dead container signifies the
container where we tried to remove it but removal failed. User now needs to
figure out what went wrong, corrent the situation and try cleanup again.

RemovalInProgress signifies that container is already being removed. Only
one removal can be in progress.

Also, do not allow start of a container if it is already dead or removal is
in progress.

Also extend existing force option (-f) to docker rm to not return an error
and remove container from user view even if resource cleanup failed.
This will allow a user to get back to old behavior where resources
might leak but atleast user will be able to make progress.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-03-31 09:51:19 -04:00
Pavel Tikhomirov
d322cd5dcb docker-tests: mount hierarchies and make symlinks for subsystems
Docker does not know about our named cpuacct,cpu,cpuset cgroup
hierarchy with multiple subsystems in it. So to use them with docker
in integration-cli test TestRunWithCpuset inside docker container
we need to add symlinks to them in hack/dind script.

Example:
old version of parser will do:
	cat /proc/1/cgroup
	11:cpu,cpuacct,name=my_cpu_cpuacct:/
	...
and create and mount this hierarchy to directory
	/cgroup/cpu,cpuacct,name=my_cpu_cpuacct/
so docker cannot find it because it has strange name

in new parser directory will be same as on host
	/cgroup/my_cpu_cpuacct
and have symlinks for docker to find it
	/cgroup/cpu	-> /cgroup/my_cpu_cpuacct
	/cgroup/cpuacct	-> /cgroup/my_cpu_cpuacct

in other case if where is no name
	cat /proc/1/cgroup
	11:cpu,cpuacct:/
	...
mount will be same for both parsers
	/cgroup/cpu,cpuacct
and new one will also create symlinks
	/cgroup/cpu	-> /cgroup/cpu,cpuacct
	/cgroup/cpuacct	-> /cgroup/cpu,cpuacct

Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
2015-03-31 15:49:10 +03:00
Phil Estes
97f621bcd8 Merge pull request #11861 from ZJU-SEL/11752-add-cap-list-table
Fix-11752 add capabilities list information table.
2015-03-30 23:18:30 -04:00
Harry Zhang
bf15f675b9 Revison the some columns to make table clearer
Signed-off-by: Harry Zhang <harryzhang@zju.edu.cn>
2015-03-31 02:41:49 +00:00
dalanlan
8d3d34d5e3 fix issue #11676 #11754, disable RLIMIT_AS,edit DOCKER_OPTS
Signed-off-by: Simei He <hesimei@zju.edu.cn>
2015-03-31 10:13:37 +08:00
Doug Davis
73b7cee89c Merge pull request #11946 from crosbymichael/no-pkg-init
Remove port mapper/allocator global state
2015-03-30 22:03:12 -04:00
Michael Crosby
d8c628cf08 Ensure that bridge driver does not use global mappers
This has a few hacks in it but it ensures that the bridge driver does
not use global state in the mappers, atleast as much as possible at this
point without further refactoring.  Some of the exported fields are
hacks to handle the daemon port mapping but this results in a much
cleaner approach and completely remove the global state from the mapper
and allocator.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-30 18:28:24 -07:00
Lewis Marshall
302e3834a0 Prevent Upstart post-start stanza from hanging
Once the job has failed and is respawned, the status becomes `docker
respawn/post-start` after subsequent failures (as opposed to `docker
stop/post-start`), so the post-start script needs to take this into
account.

I could not find specific documentation on the job transitioning to the
`respawn/post-start` state, but this was observed on Ubuntu 14.04.2.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
2015-03-31 01:56:16 +01:00
Darren Shepherd
8f6a14452d Avoid ServeApi race condition
If job "acceptconnections" is called before "serveapi" the API Accept()
method will hang forever waiting for activation.  This is due to the fact
that when "acceptconnections" ran the activation channel was nil.

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-03-30 17:39:43 -07:00
Michael Crosby
62522c9853 Refactor portmapper to remove ALL global state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-30 17:31:21 -07:00
Michael Crosby
43a50b0618 Refactor port allocator to not have ANY global state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-30 17:30:59 -07:00
Jessie Frazelle
e7c48f5817 Merge pull request #11942 from crosbymichael/update-libct-mar30
Update libcontainer to c8512754166539461fd860451ff
2015-03-30 17:12:53 -07:00
Jessie Frazelle
f0ddbbaa86 Merge pull request #11933 from LK4D4/fix_err_mask
Various fixes for execdriver
2015-03-30 17:12:35 -07:00
Michael Crosby
e2d96d4304 Merge pull request #11939 from jfrazelle/fix-go1.3.3
fix basicAuth function not in go1.3.3
2015-03-30 16:51:42 -07:00
Jessie Frazelle
1ce39e234c Merge pull request #11904 from albers/completion-filters
Add missing filters to bash completion for docker images and docker ps
2015-03-30 16:37:01 -07:00
Michael Crosby
17ecbcf8ff Update libcontainer to c8512754166539461fd860451ff
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-30 16:29:10 -07:00
Alexander Morozov
2742bf5cbc Merge pull request #11938 from achanda/patch-1
Remove unused daemon.LogToDisk function
2015-03-30 15:48:03 -07:00
Alexander Morozov
f468bbb7e8 Do not mask *exec.ExitError
Fix #11764

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-30 15:31:49 -07:00
Jessica Frazelle
4a2ef6c805 fix basicAuth function not in go1.3.3
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
2015-03-30 15:28:34 -07:00
Michael Crosby
69b84c5be9 Merge pull request #11936 from runcom/11935-remove-duplicate-assignment
Remove duplicate assignment
2015-03-30 15:16:11 -07:00
Abhishek Chanda
1d23bae785 Remove unused daemon.LogToDisk function
Fixes #11937
Signed-off-by: Abhishek Chanda <abhishek.becs@gmail.com>
2015-03-30 14:54:17 -07:00
Antonio Murdaca
cc46ae8eae Remove duplicate assignment
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-30 23:07:43 +02:00
Michael Crosby
fe9f3227b1 Merge pull request #11859 from HuKeping/eof
Add nice error message
2015-03-30 13:53:09 -07:00
Michael Crosby
00a15227f8 Merge pull request #11893 from runcom/11892-refactor-utils-flags
Refactor utils/flags.go
2015-03-30 13:35:40 -07:00
Alexander Morozov
5a1e5cf8c9 Get child processes before main process die
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-30 13:28:34 -07:00
Alexander Morozov
489ab77f4a Use proper wait function for --pid=host
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-30 13:27:38 -07:00
Michael Crosby
b6d6ffa1dd Merge pull request #11896 from vdemeester/9998-cp
Docker cp handles resolv.conf, hostname & hosts, fixes #9998
2015-03-30 13:15:00 -07:00
Michael Crosby
70a479dda5 Merge pull request #11900 from runcom/11899-refactor-utils-http
Refactor utils/http.go
2015-03-30 13:11:45 -07:00
Michael Crosby
a7a93fd2b2 Merge pull request #11931 from scarletmeow/11563_log_timestamp
Upgrade logrus to v0.7.2
2015-03-30 13:09:17 -07:00
Michael Crosby
72dfd6728f Merge pull request #11869 from dmcgowan/v2-push-gzipped
Compress layers on push to a v2 registry
2015-03-30 12:58:55 -07:00
Tiffany Low
711e580320 Upgrade logrus to v0.7.2
- Daemon logs now report to millisecond resolution

Signed-off-by: Tiffany Low <the.second.angel@gmail.com>
2015-03-30 12:27:03 -07:00
Derek McGowan
851c64725d Compress layers on push to a v2 registry
When buffering to file add support for compressing the tar contents. Since digest should be computed while writing buffer, include digest creation during buffer.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-03-30 12:15:15 -07:00
Jessie Frazelle
f3a048516e Merge pull request #11901 from albers/dockerfile-bash-completion
Enable bash completion in build environment
2015-03-30 11:52:43 -07:00
Michael Crosby
446437d1a1 Merge pull request #11928 from crosbymichael/aufs-build-errors
Fix AUFS logrus build errors on import
2015-03-30 11:49:14 -07:00
Michael Crosby
d1306e63e4 Fix AUFS logrus build errors on import
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-30 11:46:44 -07:00
Tianon Gravi
a0d90f18d5 Merge pull request #11890 from albers/completion-run-cgroup-parent
Do not complete --cgroup-parent as _filedir
2015-03-30 12:42:30 -06:00
Michael Crosby
14fed352cb Merge pull request #11799 from dqminh/aufs-dirperm1
aufs: apply dirperm1 by default if supported
2015-03-30 11:36:02 -07:00
moxiegirl
3a706d6580 Merge pull request #11894 from ankushagarwal/11630
Explain --net=host option usage
2015-03-30 11:18:01 -07:00
Ankush Agarwal
ddd27616e0 Explain --net=host option usage
Fixes #11630

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-30 10:28:44 -07:00
Alexander Morozov
924d503cb1 Merge pull request #11898 from unclejack/broadcastwriter_writestring
pkg/broadcastwriter: avoid alloc w/ WriteString
2015-03-30 09:28:08 -07:00
Antonio Murdaca
0995ab5946 Refactor utils/http.go, fixes #11899
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-30 17:59:57 +02:00
Alexander Morozov
a2ea4a9d9d Merge pull request #11906 from runcom/11905-refactor-utils-tmpdir
Refactor utils/tmpdir.go
2015-03-30 08:58:51 -07:00
Alexander Morozov
a27057d779 Merge pull request #11888 from jamiehannaford/commit-cmd-struct
Use ContainerCommitResponse struct for Commit cmd
2015-03-30 08:20:32 -07:00
Doug Davis
5ab98eae3c Merge pull request #11913 from sunyuan3/docker_cli_restart_test
Verify MaximumRetryCount=0 if the restart policy is always.
2015-03-30 10:05:08 -04:00
Doug Davis
d95fae062b Merge pull request #11912 from sunyuan3/typo
Fix a typo in daemon/networkdriver/ipallocator/allocator.go
2015-03-29 21:59:50 -04:00
Yuan Sun
f5310f403d Verify MaximumRetryCount=0 if the restart policy is always.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-03-30 09:08:33 +08:00
Yuan Sun
08331294bc Fix a typo in daemon/networkdriver/ipallocator/allocator.go
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-03-30 08:31:46 +08:00
moxiegirl
41e47bbf34 Merge pull request #11678 from botchagalupe/docker-11465
Closes #11465 - Add additional doc for local registries on pull command
2015-03-29 14:10:20 -07:00
moxiegirl
4edf8e1e53 Merge pull request #11798 from amylindburg/11792-fix-typo
Fixing typo in cd instruction
2015-03-29 14:01:35 -07:00
moxiegirl
3bf9869234 Merge pull request #11897 from ankushagarwal/glossary
Add Glossary to documentation
2015-03-29 13:49:22 -07:00
moxiegirl
8b3d8f21a0 Merge pull request #11885 from bobrik/fix-formatting
Fixed code formatting on docs.docker.com
2015-03-29 13:21:26 -07:00
moxiegirl
3ff71c24c1 Merge pull request #11875 from ahmetalpbalkan/docs/boot2docker-windows
Update Documentation for Windows Installation
2015-03-29 13:18:00 -07:00
Vincent Demeester
8bc330d863 Docker cp handles resolv.conf, hostname & hosts, fixes #9998
Add a integration test TestCpSpecialFiles

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-03-29 22:10:14 +02:00
moxiegirl
584df44d42 Merge pull request #11870 from dekobon/master
11558 - Documentation fixes and improvements for Riak Dockerfile
2015-03-29 12:42:54 -07:00
Ankush Agarwal
567f723721 Add Glossary to documentation
Closes #11057

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-29 12:24:54 -07:00
Antonio Murdaca
f1bbc1f34f Refactor utils/tmpdir.go, fixes #11905
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-29 20:56:07 +02:00
Harald Albers
cf438a542e Add missing filters to bash completion for docker images and docker ps
Signed-off-by: Harald Albers <github@albersweb.de>
2015-03-29 10:13:47 -07:00
moxiegirl
1f27ebc2c7 Merge pull request #11880 from miwest929/feature/add_man_pages_docs
Feature/add man pages docs
2015-03-29 09:39:56 -07:00
Harald Albers
e8edcf47b4 Enable bash completion in build environment
Installs and configures bash completion for Docker.
Note that bash completion still has to be initialized by a custom
.bashrc file.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-03-29 06:50:46 -07:00
unclejack
db877d8a42 pkg/broadcastwriter: avoid alloc w/ WriteString
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-03-29 15:20:53 +03:00
Lei Jitang
7583b49125 Fix create volume in a directory which is a symbolic link
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-29 13:35:36 +08:00
Antonio Murdaca
5670c6c695 Refactor utils/flags.go, fixes #11892
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-29 03:22:46 +02:00
Harald Albers
a09cc935c3 Do not complete --cgroup-parent as _filedir
This is a follow-up on PR 11708, as suggested by tianon.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-03-28 11:32:33 -07:00
Jamie Hannaford
8b795a05a8 Use ContainerCommitResponse struct for Commit cmd
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2015-03-28 17:55:45 +01:00
Ian Babrou
0dc996a7d7 fixed code formatting on docs.docker.com
Signed-off-by: Ian Babrou <ibobrik@gmail.com>
2015-03-28 14:32:53 +03:00
Phil Estes
61069d8b69 Merge pull request #11281 from coolljt0725/fix_ipc_from_non_exist_container
Fix error from daemon no such image even when the image exist
2015-03-28 06:58:48 -04:00
Hu Keping
cee62a95a2 Add nice error message
Generally, when using Remote API to push images there needs a http Header
X-Registry-Auth.
For compatibility if there was no authConfig header, everything will be
okay if a proper JSON-http-body was applied.

But when both X-Registry-Auth Header and the Body are missing, due to
the function of decode JSON, it will return an EOF error which was not
very clear to user.

So I think we can make the respone error be more nice.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-03-28 16:27:30 +08:00
Michael West
b4905859d5 Add a missing definite article
Signed-off-by: Michael West <mwest@mdsol.com>
2015-03-27 23:35:37 -04:00
Michael West
f7d75cc08a Add man pages generation instructions.
Signed-off-by: Michael West <mwest@mdsol.com>
2015-03-27 23:35:13 -04:00
Harry Zhang
194cad243c Remove dupllicated prefix to make table shorter & fix bugs
Signed-off-by: Harry Zhang <harryzhang@zju.edu.cn>
2015-03-28 01:49:28 +00:00
Lei Jitang
013fb87543 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-28 09:07:20 +08:00
Michael Crosby
789a67e931 Merge pull request #11805 from runcom/11804-remove-err-field-job-struct
Remove err field from Job struct
2015-03-27 16:27:04 -07:00
Jessie Frazelle
e3b0014987 Merge pull request #11708 from coolljt0725/add_cgroup_parent_to_bash_completion
Add new docker run option to bash completion
2015-03-27 15:06:10 -07:00
Jessie Frazelle
221ff368df Merge pull request #11852 from clnperez/doc-dev-container
Fix typo in doc at /set-up-dev-env
2015-03-27 15:03:36 -07:00
Michael Crosby
c088486093 Merge pull request #11845 from lobatt/master
Issue #11836
2015-03-27 14:55:04 -07:00
Ahmet Alp Balkan
de09c55394 Update boot2docker on Windows documentation
Boot2Docker experience is updated now that we have a Docker
client on Windows. Instead of running `boot2docker ssh`, users
can also use boot2docker on Windows Command Prompt (`cmd.exe`)
and PowerShell.

Updated documentation and screenshots, added a few details,
reorganized sections by importance, fixed a few errors.

Remaining: the video link in the Demonstration section needs
to be updated once I shoot a new video.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-27 14:54:37 -07:00
Maxim Kulkin
d1af2bc253 Add tool to conver disk image into Docker image
dockerize-image tool takes a virtual disk image file
and creates a Docker image based on it. You can
specify a base Docker image to make this tool create
an image that will contain only filesystem diff
instead of full filesystem.
See tools usage for details.

Signed-off-by: Maxim Kulkin <maxim.kulkin@gmail.com>
2015-03-27 14:53:54 -07:00
Michael Crosby
7cc73607a2 Merge pull request #11853 from EricR/doc-PkgSysInfo
Add some basic doc for SysInfo
2015-03-27 14:52:20 -07:00
Michael Crosby
cc609c7556 Merge pull request #11871 from NinjaTrappeur/dry-run-test
Fix vet warning in devicemapper.
2015-03-27 14:48:55 -07:00
Alexander Morozov
240f3e14c7 Merge pull request #11848 from duglin/CleanupIntTests
Clean up integration-cli tests
2015-03-27 14:11:56 -07:00
Alexander Morozov
37241db5f3 Merge pull request #11872 from ankushagarwal/11825
Replace fmt.Fprint* with io.WriteString
2015-03-27 14:05:15 -07:00
Ahmet Alp Balkan
986ae5d52a docs: remove unused windows images
These images was just sitting around and referenced from
nowhere, nor they seemed any useful.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-27 13:59:35 -07:00
Alexander Morozov
8c58bdd3a7 Merge pull request #11842 from brahmaroutu/events_tests
Events tests
2015-03-27 13:45:11 -07:00
Ankush Agarwal
6d21b2ba80 Replace fmt.Fprint* with io.WriteString
This fixes vet warnings in api/client/stats.go

Fixes #11825

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-27 13:08:20 -07:00
Félix Baylac-Jacqué
6b764bba8a Fix vet warning in devicemapper.
Issue #11828

Signed-off-by: Félix Baylac-Jacqué <baylac.felix@gmail.com>
2015-03-27 20:16:25 +01:00
Elijah Zupancic
de45aacc32 Added updated working Riak Dockerfile and documentation.
Signed-off-by: Elijah Zupancic <elijah@zupancic.name>
2015-03-27 12:03:46 -07:00
Elijah Zupancic
31c5041157 Removed references to creating an OpenSSH server. This method of accessing the Docker container is no longer needed now that the exec command is available.
Signed-off-by: Elijah Zupancic <elijah@zupancic.name>
2015-03-27 12:03:34 -07:00
Elijah Zupancic
17303b18b8 Removed ulimit steps from Dockerfile because they aren't applied according to @cpuguy83.
Signed-off-by: Elijah Zupancic <elijah@zupancic.name>
2015-03-27 12:03:24 -07:00
Antonio Murdaca
60085e22ff Remove err field from Job struct, fixes #11804
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-27 19:08:53 +01:00
Eric Rafaloff
3716df57c0 Update inline doc for New
Signed-off-by: Eric Rafaloff <erafaloff@gmail.com>
2015-03-27 13:55:22 -04:00
Jessie Frazelle
121de9e4e3 Merge pull request #11850 from kytrinyx/11796-git-mental-model
Clarify git instructions in project guide. Fixes #11796
2015-03-27 09:02:03 -07:00
cheney90
89a29d7e99 Add capabilities list information table.
Signed-off-by: Chen Qiu <21321229@zju.edu.cn>
2015-03-27 08:45:36 +00:00
Brian Goff
da5c863d20 Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
2015-03-26 23:55:50 -07:00
Eric Rafaloff
6abe160eae Add missing . in comment
Signed-off-by: Eric Rafaloff <erafaloff@gmail.com>
2015-03-26 23:22:05 -04:00
Eric Rafaloff
01bbc3fbb9 Add some basic doc for SysInfo
Signed-off-by: Eric Rafaloff <erafaloff@gmail.com>
2015-03-26 23:05:07 -04:00
Srini Brahmaroutu
f5ad895ba6 Use common code to test all events, when using filter that expect all lifecycle events.
Addresses: #10654

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-03-27 02:47:46 +00:00
Christy Perez
dd6f988b23 Fix typo in doc at /set-up-dev-env
Save a whale!

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-03-26 21:46:35 -05:00
Katrina Owen
54c9ae187f Clarify git instructions in project guide. Fixes #11796
The git model uses `upstream master` to refer to the branch on
the remote repository, and `upstream/master` to refer to the
local cache of the upstream branch.

I did not explain the difference in the docs (that seemed a bit
excessive), but I did clarify the instructions so that it refers
to the correct concept in each place.

Signed-off-by: Katrina Owen <katrina.owen@gmail.com>
2015-03-26 19:24:14 -07:00
moxiegirl
d2df901be3 Merge pull request #11846 from voltaic/master
Update set-up-dev-env.md
2015-03-26 18:09:28 -07:00
moxiegirl
cd8ea1d17e Merge pull request #11793 from lolilo/update-project-doc
fix typos, grammar, more concise wording
2015-03-26 17:57:45 -07:00
Doug Davis
9a9d23dbc4 Clean up integration-cli tests
My AR couldn't take it any more:
- one logDone per test
- PASSED lines don't wrap

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-26 17:25:50 -07:00
Brian Goff
756b8f2fde Merge pull request #11841 from runcom/11762-replace-aliased-logrus-imports
Replace aliased imports of logrus
2015-03-26 16:49:01 -07:00
Daniel S
ddcb3ad061 Update set-up-dev-env.md
Signed-off-by: graycoder <patgray1127@gmail.com>
2015-03-26 19:41:31 -04:00
Olivier Gambier
be5fd157d5 Merge pull request #11813 from miminar/show-verified-status
Consider tag updated also in case repo does not exist
2015-03-26 16:29:13 -07:00
Jessie Frazelle
cf7104a0e8 Merge pull request #11840 from ahmetalpbalkan/win-cli/term-resize-fix
term/winconsole: Identify tty correctly, fix resize problem
2015-03-26 16:19:27 -07:00
chli
f581f74209 Issue #11836
Signed-off-by: chli <chli@freewheel.tv>
2015-03-26 19:18:23 -04:00
Ahmet Alp Balkan
ebbceea8a7 windows: monitorTtySize correctly by polling
This change makes `monitorTtySize` work correctly on windows by polling
into win32 API to get terminal size (because there's no SIGWINCH on
windows) and send it to the engine over Remove API properly.

Average getttysize syscall takes around 30-40 ms on an average windows
machine as far as I can tell, therefore in a `for` loop, checking every
250ms if size has changed or not.

I'm not sure if there's a better way to do it on windows, if so,
somebody please send a link 'cause I could not find.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-26 16:08:05 -07:00
moxiegirl
8c1118a8f9 Merge pull request #11832 from jamiehannaford/patch-1
Fix spelling
2015-03-26 15:47:27 -07:00
moxiegirl
296642035d Merge pull request #11801 from hqhq/hq_fix_doc_for_exec
update docs for container exec
2015-03-26 15:31:16 -07:00
Antonio Murdaca
6f4d847046 Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-26 23:22:04 +01:00
Ahmet Alp Balkan
0532dcf3dc term/winconsole: Identify tty correctly, fix resize problem
This change fixes a bug where stdout/stderr handles are not identified
correctly.

Previously we used to set the window size to fixed size to fit the default
tty size on the host (80x24). Now the attach/exec commands can correctly
get the terminal size from windows.

We still do not `monitorTtySize()` correctly on windows and update the tty
size on the host-side, in order to fix that we'll provide a
platform-specific `monitorTtySize` implementation in the future.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-26 15:11:28 -07:00
Peter Choi
ae907e7af1 Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
2015-03-26 15:05:45 -06:00
John Willis
2c07fd9fdf #11465 Add additional doc for locagi registries on pull command - for docker-pull.1.md
Signed-off-by: John Willis <john.willis@docker.com>
2015-03-26 16:09:56 -04:00
Pradeep Chhetri
1401b8fe0d Added integration tests for docker wait command
Signed-off-by: Pradeep Chhetri <pradeep@indix.com>
2015-03-27 01:24:11 +05:30
Alexander Morozov
42f9594fd3 Merge pull request #11834 from jamiehannaford/contributor-guide-fix
Make gofmt use the filename previously referenced
2015-03-26 12:41:53 -07:00
Jamie Hannaford
7fdf5257b4 Make gofmt use the filename previously referenced
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2015-03-26 20:39:15 +01:00
Jessie Frazelle
df90fb716b Merge pull request #10050 from lindenlab/9922-private-registry-search-401
9922-fix: private registry search with auth returns 401
2015-03-26 12:24:06 -07:00
Jamie Hannaford
849e55f4e4 Fix spelling
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2015-03-26 20:24:01 +01:00
James Turnbull
dcc6e818fe Merge pull request #11747 from moxiegirl/11694-remove-sudo-added-in-error
Proposal: Removing sudo from examples
2015-03-26 15:18:48 -04:00
Don Kjer
6b2eeaf896 Fix for issue 9922: private registry search with auth returns 401
Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-03-26 18:59:16 +00:00
Mary Anthony
29d01b7dde Removing sudo from command line examples
We now advise people to configure docker group and
add to sudo.  Mac shouldn't use sudo.  Removed sudo
from command examples.  Left in installation to be removed
in installation doc sweep -- removing requires finer
grain control.

Signed-off-by: Mary Anthony <mary@docker.com>
2015-03-26 11:12:37 -07:00
Alexander Morozov
6a43d71014 Merge pull request #11734 from yestin/11601-test-chrootarchive
Add more tests for pkg/chrootarchive
2015-03-26 11:03:58 -07:00
Daniel, Dao Quang Minh
d68d5f2e4b print dirperm1 supported status in docker info
It's easier for users to check if their systems support dirperm1 just by using
docker info

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-03-26 17:58:49 +00:00
Michael Crosby
708ed9d87a Merge pull request #11766 from peggyl/11596-api-commands-godoc
Add godoc-style docstrings to Cmd... methods
2015-03-26 10:58:35 -07:00
Michael Crosby
a196cc943c Merge pull request #11791 from moo-mou/11768-vetwarning
Fix vet warning
2015-03-26 10:52:07 -07:00
Michael Crosby
ec8f61044a Merge pull request #11811 from VladimirAus/11585-3
#11585: README for pkg/signal.
2015-03-26 10:44:09 -07:00
Michael Crosby
5f295a6e82 Merge pull request #11821 from duglin/FixCPUTest
Fix TestBuildResourceConstraintsAreUsed Cpuset test
2015-03-26 10:42:43 -07:00
Mary Anthony
a4609a1dfb Removing sudo from examples
We now have instructions in our Unix installs about setting up
docker group to avoid sudo.  Also, Mac/Windows shouldn't use
sudo.  So, I've removed sudo from our examples and added a
section at the top reminding them that if they have to use
sudo to run docker they can change that.

Signed-off-by: Mary Anthony <mary@docker.com>
2015-03-26 10:13:19 -07:00
Tibor Vass
2bbf1987d2 Merge pull request #11800 from hqhq/hq_fix_create_issue
add back job.Errorf
2015-03-26 11:12:55 -06:00
Alexander Morozov
b9d19fdaef Merge pull request #11786 from peggyl/golint-api-client
Fix golint errors for casing in api/client package
2015-03-26 09:28:33 -07:00
Alexander Morozov
d4fca8047c Merge pull request #11789 from parknicker/PostContainerWaitFix
Changes response of postContainersWait to use a struct
2015-03-26 08:40:00 -07:00
Alexander Morozov
dd492dc15d Merge pull request #11702 from jimmypuckett/feature/bitflag_checking_style_11668
Feature/bitflag checking style 11668.  Fixes #11668
2015-03-26 08:34:58 -07:00
Doug Davis
389d0ae453 Fix TestBuildResourceConstraintsAreUsed Cpuset test
Set cpuset to "0" so that it works on single core machines.
W/o this (and set to "1") we'll see something like this error
when running:
System error: write /cgroup/cpuset/docker/66689499bbd08cd8dccc9b7bfd1d6b34e85d73ce8c84d3c69b5e91944322da60/docker/79d7c548b58c85c4cfad6cd01eb7c3b30db254d1014c496137edd93ddc528a6f/cpuset.cpus: invalid argument"

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-26 07:31:39 -07:00
Doug Davis
afc8ae939a Merge pull request #11806 from aneshas/11770-redundant-err-nil-check
Removed redundant err == nil check
2015-03-26 10:07:40 -04:00
Michal Minar
3b8d4bb82b Consider tag updated also in case repo does not exist
This patch causes `The image you are pulling has been verified` status
message to be produced also when the repository is pulled for the first
time.

Signed-off-by: Michal Minar <miminar@redhat.com>
2015-03-26 12:52:56 +01:00
VladimirAus
9b876b9c03 #11585: README for pkg/signal. Signed-off-by: Vladimir Roudakov <v_roudakov@yahoo.com>
Signed-off-by: VladimirAus <v_roudakov@yahoo.com>
2015-03-26 21:18:27 +10:00
Anes Hasicic
b38e11b3c4 Removed redundant err == nil check
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
2015-03-26 11:36:13 +01:00
Daniel, Dao Quang Minh
d7bbe2fcb5 document dirperm1 fix for #783 in known issues
Since `dirperm1` requires a more recent aufs patch than many current OS release,
we cant remove #783 completely. This documents that docker will apply `dirperm1`
automatically for systems that support it

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-03-26 07:46:13 +00:00
Daniel, Dao Quang Minh
281abd2c8a aufs: apply dirperm1 by default if supported
Automatically detect support for aufs `dirperm1` option and apply it.
`dirperm1` tells aufs to check the permission bits of the directory on the
topmost branch and ignore the permission bits on all lower branches.
It can be used to fix aufs' permission bug (i.e., upper layer having
broader mask than the lower layer).

More information about the bug can be found at https://github.com/docker/docker/issues/783
`dirperm1` man page is at: http://aufs.sourceforge.net/aufs3/man.html

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-03-26 07:25:42 +00:00
Qiang Huang
fabb5114d8 update docs for container exec
https://github.com/docker/docker/pull/11665 This PR changed container
exec API response, we need docs updated.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-26 13:55:46 +08:00
Qiang Huang
40ef253ef5 add back job.Errorf
c79b9bab54 (Remove engine.Status and replace it with standard go error)
cause a regression that create container won't get any warnings, we still
need this to send useful informations to user.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-26 13:12:36 +08:00
Amy Lindburg
0f702094ec Fixing typo in cd instruction
Signed-off-by: Amy Lindburg <amy.lindburg@docker.com>
2015-03-25 21:52:32 -07:00
Alexander Morozov
bc0f1e0e09 Merge pull request #11794 from moo-mou/11790-pkgulimit
Fixes pointer error
2015-03-25 21:30:37 -07:00
Nick Parker
89d63d2a82 fixes comment for ContainerWaitResponse struct
Signed-off-by: Nick Parker <nikaios@gmail.com>
2015-03-25 22:22:58 -06:00
Arnaud Porterie
191f88dd2c Merge pull request #11795 from grubernaut/net_none_test_fixes
Add fixes for integration-cli tests w/ --net none
2015-03-25 21:22:28 -07:00
Steve Francia
ff2fc9757d Merge pull request #11781 from xamyzhao/patch-1
Updated step 5 with Windows instructions so that installation works in W...
2015-03-25 23:51:35 -04:00
Phil Estes
23699f5a29 Merge pull request #11468 from robertabbott/10959-refactor-progressreader-hack
Fixes hacks from progressreader refactor
2015-03-25 23:50:43 -04:00
Jake Champlin
c2fe262439 Add fixes for integration-cli tests w/ --net none
Adds network to integration tests that were failing without network.

Fixes #10964
Fixes #10968

Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
2015-03-25 23:46:04 -04:00
paul
273fdd97ed Fixes pointer error
Signed-off-by: Paul Mou <ppymou@gmail.com>
2015-03-25 20:45:17 -07:00
paul
c5bf2145f1 Fix vet warning
Signed-off-by: Paul Mou <ppymou@gmail.com>
2015-03-25 20:31:02 -07:00
Peggy Li
2a5a402c71 Update CmdCommit docstring and fix CmdHelp whitespace
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-03-25 20:07:00 -07:00
Liana Lo
4982374739 fix typos, grammar, more concise wording
Signed-off-by: Liana Lo <liana.lixia@gmail.com>
2015-03-25 20:03:42 -07:00
Nick Parker
1bc266dfa7 Changes response of postContainersWait to use a struct
Signed-off-by: Nick Parker <nikaios@gmail.com>
2015-03-25 21:01:14 -06:00
Peggy Li
a465e26bb0 Fix golint errors for casing in api/client package
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-03-25 19:54:29 -07:00
bobby abbott
0cd6c05d81 Fixes hacks from progressreader refactor
related to #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-25 18:21:02 -07:00
moxiegirl
f84086be2a Merge pull request #11776 from shin-/security_opt_docs_fix
API docs fix for SecurityOpt parameter.
2015-03-25 18:20:59 -07:00
Maxim Kulkin
b4d7b0f865 Explain advanced contribution workflow more
Explain why advanced contribution workflow have to be so complex

Signed-off-by: Maxim Kulkin <mkulkin@mirantis.com>
2015-03-25 18:04:41 -07:00
Jessie Frazelle
667452ec63 Merge pull request #11779 from blatyo/add_ulimit_test
Add test for successful Ulimit Parse.
2015-03-25 17:34:58 -07:00
Alexander Morozov
d0b2cfa1f1 Merge pull request #11778 from blatyo/fix_ulimit_string
Fix (*Ulimit).String() function. Closes #11769.
2015-03-25 17:33:00 -07:00
xamyzhao
ba222f7bc8 Updated step 5 with Windows instructions so that installation works in Windows
Signed-off-by: Amy Zhao <x.amy.zhao@gmail.com>
Signed-off-by: Amy Zhao <xamyzhao@mit.edu>
2015-03-25 20:32:50 -04:00
Allen Madsen
a97ca674f0 Add test for successful Ulimit Parse.
Signed-off-by: Allen Madsen <blatyo@gmail.com>
2015-03-25 20:03:26 -04:00
Allen Madsen
cb168e5622 Fix (*Ulimit).String() function. Closes #11769.
Signed-off-by: Allen Madsen <blatyo@gmail.com>
2015-03-25 19:39:05 -04:00
Joffrey F
61dba98608 SecurityOpt parameter is singular, and belongs in HostConfig
since API 1.17

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-03-25 16:25:13 -07:00
Arnaud Porterie
e589dc7424 Merge pull request #11757 from ankushagarwal/Fds
Rename 'Fds' to 'File Descriptors' in docker info
2015-03-25 16:24:57 -07:00
Jimmy Puckett
5dde99163e running code formatter as @tiborvass requested
Signed-off-by: Jimmy Puckett <jimmy.puckett@spinen.com>
2015-03-25 19:24:55 -04:00
Jessie Frazelle
89e7f5e661 Merge pull request #11772 from aneshas/11718-redundant-else
Fixed redundant else
2015-03-25 16:16:16 -07:00
Jessie Frazelle
f14bf9b53c Merge pull request #11773 from icecrime/unused_securityopt_field
Remove unused runconfig.Config.SecurityOpt field
2015-03-25 16:15:41 -07:00
Jessie Frazelle
8cd3564ec1 Merge pull request #11771 from aneshas/11719-redundant-elses
Removed redundant elses
2015-03-25 16:06:30 -07:00
Tibor Vass
8d62e12f4d Merge pull request #11745 from imdreamrunner/patch-1
Add missing newline for bash code example
2015-03-25 16:58:55 -06:00
Tibor Vass
136f8fa2ff Merge pull request #11774 from thaJeztah/fix-workdir-typo
Fix typo "WRKDIR" -> "WORKDIR"
2015-03-25 16:55:57 -06:00
Tibor Vass
87e877e3c1 Merge pull request #11748 from minimum2scp/fix/debootstrap
removed unnecessary tabs from /usr/sbin/policy-rc.d, and /sbin/initctl for mkimage.sh debootstrap
2015-03-25 16:55:13 -06:00
Sebastiaan van Stijn
6fdb583f38 Fix typo "WRKDIR" -> "WORKDIR"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-03-25 23:47:38 +01:00
Arnaud Porterie
e39646d2e1 Remove unused runconfig.Config.SecurityOpt field
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-25 15:46:42 -07:00
Anes Hasicic
3d7b9e8f30 Fixed redundant else
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
2015-03-25 23:44:32 +01:00
Alexander Morozov
e6cbffe94b Merge pull request #11761 from runcom/11731-remove-engine-status
Remove engine.Status, replace with standard go error
2015-03-25 15:41:02 -07:00
Anes Hasicic
1b6065de8f Removed redundant elses
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
2015-03-25 23:34:00 +01:00
Antonio Murdaca
c79b9bab54 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-25 22:32:08 +01:00
Peggy Li
b5d0380108 Add godoc-style docstrings to Cmd... methods
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-03-25 14:17:11 -07:00
Michael Crosby
3d9cbf0e71 Merge pull request #11758 from crosbymichael/update-libct-mar25
Update libcontainer to a6044b701c166fe538fc760f9e2
2015-03-25 12:17:33 -07:00
Ankush Agarwal
161c2e5e74 Rename Fds to File Descriptors in docker info
This makes the docker info more readable. Also change a log line
in a test file renaming Fds

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-03-25 12:04:15 -07:00
Arnaud Porterie
54a607a22d Merge pull request #11691 from matthewkmayer/feature-dont-create-bind-dirs
Removes bind dir creation in daemon start.
2015-03-25 11:44:13 -07:00
Jessie Frazelle
667df336b7 Merge pull request #11756 from vbatts/vbatts-remove_trailing_whitespaces
.: remove trailing white spaces
2015-03-25 11:36:10 -07:00
Michael Crosby
b4196f7892 Update libcontainer to a6044b701c166fe538fc760f9e2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-25 11:32:14 -07:00
Jessie Frazelle
e6e2893fa3 Merge pull request #11753 from vbatts/vbatts-btrfs_ifdef_build_version
btrfs: #ifdef for build version
2015-03-25 11:25:49 -07:00
YAMADA Tsuyoshi
09165e0fe0 removed unnecessary tab from /usr/sbin/policy-rc.d, and /sbin/initctl
Signed-off-by: YAMADA Tsuyoshi <tyamada@minimum2scp.org>
2015-03-26 03:10:34 +09:00
Vincent Batts
b76e300b4c btrfs: #ifdef for build version
We removed it, because upstream removed it. But now it will be coming
back, so work with it either way.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-25 13:56:51 -04:00
Vincent Batts
7617ec176d .: remove trailing white spaces
blame tibor this one ;-)
```
find . -type f -not -name '*.png' -not -name '*.go' -not -name '*.md'
-not -name '*.tar' -not -name '*.pem' -not -path './vendor/*' -not -path
'./.git/*' -not -path '*/testdata/*' -not -path './docs/*images*' -not
-path '*/testfiles/*' -not -path './bundles/*' -not -path
'./docs/*static*/*' -not -path './docs/*article-img/*' -exec grep -HnEl
'[[:space:]]$' {} \; | xargs sed -iE 's/[[:space:]]*$//'
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-25 13:38:17 -04:00
Xinzi Zhou
ed7907a988 Add missing newline for bash code example
Signed-off-by: Zhou Xinzi <imdreamrunner@gmail.com>
2015-03-26 01:24:00 +08:00
Doug Davis
a0cfe83435 Merge pull request #11751 from tiborvass/revert-validate-spaces
Revert "Dealing with trailing whitespaces"
2015-03-25 13:01:58 -04:00
Alexander Morozov
444c967aec Merge pull request #11750 from MabinGo/adjust_log_func_call
Use appropriate func to record logs according to different scene
2015-03-25 09:41:41 -07:00
Alexander Morozov
5f7e142c46 Merge pull request #11729 from icecrime/11048_carry
Carry #11048
2015-03-25 09:27:07 -07:00
Alexander Morozov
9359e2bed3 Merge pull request #11749 from duglin/FixLogin
Fix login
2015-03-25 09:22:52 -07:00
Brian Goff
bb65c808df Merge pull request #11730 from runcom/11725-fix-volume-initialize-error-check
Fix volume initialize error check
2015-03-25 09:19:42 -07:00
Tibor Vass
639d60b538 Merge pull request #11533 from hqhq/hq_fix_decode
fix decode data loss when using int64 in json
2015-03-25 10:17:10 -06:00
Tibor Vass
0252ad0adc Revert "Dealing with trailing whitespaces"
The validation script from #10681 is too pedantic, and does not handle
well situations like:

```
cat <<EOF   # or <<-EOF
	Whether the leading whitespace is stripped out or not by bash
	it should still be considered as valid.
EOF
```

This reverts commit 4e65c1c319.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-03-25 10:04:56 -06:00
Doug Davis
0d65069a17 Fix login
Right now it returns:
```
FATA[0001] json: Unmarshal(non-pointer types.AuthResponse)
```

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-25 08:45:14 -07:00
Alexander Morozov
f08e9f44a9 Merge pull request #11737 from duglin/FixTestOutput
TestBuildCancelationKillsSleep sends exec cmd to stdout
2015-03-25 08:45:09 -07:00
Antonio Murdaca
1d1230ea32 Fix volume initialize error check, Fixes #11725
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-25 16:36:00 +01:00
Mabin
b46beb170f Use appropriate function to record logs
Signed-off-by: Mabin <bin.ma@huawei.com>
2015-03-25 23:32:12 +08:00
Brian Goff
3bed92a7bf Merge pull request #11741 from aneshas/11720-redundant-else
Fixed redundant else in GetDeviceStatus
2015-03-25 08:28:38 -07:00
Brian Goff
7c2cc476da Merge pull request #11735 from Sirupsen/listenbuffer-promote
listenbuffer: add docs and test
2015-03-25 08:14:21 -07:00
Srini Brahmaroutu
be5de5bcb8 Fix the events, pull test to use v2 local server
Closes #10964
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-03-25 15:12:47 +00:00
moxiegirl
dea660874c Merge pull request #11715 from duglin/DocCliEnvVars
Add some info about what environment variables are available
2015-03-25 07:29:27 -07:00
moxiegirl
67eb10defe Merge pull request #11694 from hqhq/hq_add_memsw_example
docs: add memory and swap memory usage examples
2015-03-25 07:01:44 -07:00
Anes Hasicic
e479e1c9f7 Fixed redundant else in GetDeviceStatus
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
2015-03-25 09:53:04 +01:00
Doug Davis
65584318d2 Merge pull request #11738 from joeygibson/11610-split
api/client - The code for all cli commands are in one file #11610
2015-03-25 00:48:50 -04:00
Doug Davis
494c41519b Merge pull request #11733 from jfrazelle/fix-lxc
Get rid of panic in stats/ fix dir lxc
2015-03-25 00:41:11 -04:00
Jessica Frazelle
c959d26d2f fix 2 integration tests on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-24 21:12:16 -07:00
Jessica Frazelle
7dce902494 Get rid of panic in stats for lxc
Fix containers dir

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-24 21:12:06 -07:00
Joey Gibson
58690c9cca api/client - The code for all cli commands are in one file #11610
Signed-off-by: Joey Gibson <joey@joeygibson.com>
2015-03-24 23:57:23 -04:00
Doug Davis
fbd47969a8 TestBuildCancelationKillsSleep send exec cmd to stdout
and makes the testing output ugly.

This hides the output since it not used.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-24 20:56:26 -07:00
Simon Eskildsen
67bd859481 listenbuffer: add docs
Signed-off-by: Simon Eskildsen <sirup@sirupsen.com>
2015-03-25 03:11:34 +00:00
Simon Eskildsen
b6b8032a17 listenbuffer: add test
Signed-off-by: Simon Eskildsen <sirup@sirupsen.com>
2015-03-25 03:11:33 +00:00
Doug Davis
0d2190e679 Add some info about what environment variables are available
Having the list in one spot makes it easier for people to see what's
avaiable instead of having to scan all of the docs and extract the info.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-24 18:29:21 -07:00
Yestin Sun
a08048d5c8 Add more tests for pkg/chrootarchive
Fixes issue #11601

Change-Id: Ifc1dbcc59cc4dc581ed43fc8fbe43fbaec4ccad0
Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2015-03-24 18:23:28 -07:00
Jimmy Puckett
e8e60befd6 Code simplification that @tiborvass requested
Signed-off-by: Jimmy Puckett <jimmy.puckett@spinen.com>
2015-03-24 21:10:07 -04:00
Jimmy Puckett
ec5e22efe3 Changing bitflag checking style to preferred style. Fixes #11668
Signed-off-by: Jimmy Puckett <jimmy.puckett@spinen.com>
2015-03-24 21:09:25 -04:00
Jessie Frazelle
22dba32b4d Merge pull request #10527 from mfojtik/lxc_11
Fix lxc-start in lxc>1.1.0 where containers start daemonized by default
2015-03-24 17:37:27 -07:00
Michael Crosby
d214e64032 Merge pull request #11018 from delftswa2014/10958-pidfile
Moves pid file operations to /pkg/
2015-03-24 17:20:52 -07:00
Arnaud Porterie
8900ae2928 Revert all but TestPullImageFromCentralRegistry changes
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-24 16:27:35 -07:00
Jessie Frazelle
aecc5b606f Merge pull request #11728 from crosbymichael/lxc-mkdir
Mkdir for lxc root dir before setup of symlink
2015-03-24 16:25:12 -07:00
Arnaud Porterie
322095ed63 Merge pull request #10681 from noironetworks/whitespaces-cleaner
Removed all trailing whitespaces from every text file
2015-03-24 16:02:14 -07:00
Rick Wieman
772833274f 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>
2015-03-24 23:59:32 +01:00
Michael Crosby
246cab90f2 Mkdir for lxc root dir before setup of symlink
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-24 15:53:23 -07:00
Michael Crosby
f3fc857e01 Merge pull request #11716 from LK4D4/root_in_run
Use /var/run/docker as root for execdriver
2015-03-24 14:58:30 -07:00
Matthew Mayer
08d75bc450 Squashed commit of the following:
commit d379f7645026001ce57fd6421c819f6c7df77964
Author: Matthew Mayer <matthewkmayer@gmail.com>
Date:   Mon Mar 23 22:13:06 2015 -0700

    Removes unused imports.

    Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com>

commit 6e1f77c7f1566c8719087d88fbe06bade122691c
Author: Matthew Mayer <matthewkmayer@gmail.com>
Date:   Mon Mar 23 20:41:16 2015 -0700

    Removes bind dir creation in daemon start.

    Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com>

Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com>
2015-03-24 14:56:45 -07:00
Michael Crosby
46be6bb403 Merge pull request #11651 from vbatts/vbatts-dont_rm_dockerversion
make.sh: leave around the generated version
2015-03-24 14:47:42 -07:00
Alexander Morozov
979283a166 Merge pull request #11726 from noxiouz/history-swap-parallel-assignment
History.Swap Use parallel assignment to swap elements
2015-03-24 14:43:44 -07:00
Michael Crosby
73dab8205a Merge pull request #11679 from avidas/api-common-constants-document
Add comments to api/common constants
2015-03-24 14:43:09 -07:00
Alexander Morozov
a4e1de58a3 Merge pull request #11727 from tiborvass/carry-11441
Carry 11441: fix docker ps help message
2015-03-24 14:42:02 -07:00
jimmyxian
a153e80f72 fix docker ps help message
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-03-24 15:33:53 -06:00
Anton Tiurin
fc325274e8 History.Swap Use parallel assignment to swap elements, as it's
a more idiomatic way for golang than using a temp variable.

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-03-25 00:13:13 +03:00
Michael Crosby
46321a1e4f Merge pull request #11713 from icecrime/update_gitignore
Update .gitignore
2015-03-24 14:03:31 -07:00
Alexander Morozov
439e0ab23f Merge pull request #11712 from 4gh/test_httputils
add tests for pkg/httputils
2015-03-24 13:56:31 -07:00
Tibor Vass
28b96cc613 Merge pull request #11663 from arthurbarr/master
Fix #11589 by adding README and comments to exported functions
2015-03-24 14:45:05 -06:00
Vincent Batts
8fc9e40086 Merge pull request #11417 from rhatdan/btrfs
Btrfs has eliminated the BTRFS_BUILD_VERSION in latest version
2015-03-24 16:00:15 -04:00
Alexander Morozov
131b29f7bc Merge pull request #10283 from rhatdan/dev
We want to allow the sharing of /dev from the host into the container.
2015-03-24 12:57:44 -07:00
Alexander Morozov
f7900cdd67 Merge pull request #11689 from calavera/ipallocator_refactor
Use a structure to keep the allocated ips pool.
2015-03-24 12:42:30 -07:00
moxiegirl
d20ba329d1 Merge pull request #11717 from moxiegirl/tweaks-from-contributathon
Adding in comments from party
2015-03-24 12:18:18 -07:00
Phil Estes
ce372cd664 Merge pull request #11709 from paulbellamy/11626-portallocator
Refactor global portallocator and portmapper state
2015-03-24 13:51:00 -05:00
Michael Crosby
8eee55a35c Merge pull request #11710 from runcom/11599-refactor-pkg-common
Refactor pkg/common, Fixes #11599
2015-03-24 11:45:07 -07:00
David Calavera
7e95b13460 Use a structure to keep the allocated ips pool.
Fixes #11624.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-03-24 11:41:44 -07:00
Mary Anthony
6de806f348 Adding in comments from party
Signed-off-by: Mary Anthony <mary@docker.com>
2015-03-24 11:25:26 -07:00
Dan Walsh
25c4a92342 Merge branch 'master' of github.com:docker/docker into btrfs
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-24 14:14:54 -04:00
Alexander Morozov
1e788ec985 Use /var/run/docker as root for execdriver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-24 10:47:30 -07:00
Arthur Barr
557cca536f Fix #11589 by adding README and comments to exported functions
Signed-off-by: Arthur Barr <arthur.barr@uk.ibm.com>
2015-03-24 17:30:19 +00:00
Antonio Murdaca
b80fae7356 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 18:19:59 +01:00
Arnaud Porterie
4433b4c19e Sort .gitignore content
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-24 09:40:07 -07:00
Frank Herrmann
2770a88413 add tests for pkg/httputils
closes #11597

Signed-off-by: Frank Herrmann <fgh@4gh.tv>
2015-03-24 16:27:09 +00:00
moxiegirl
4b4bdb5be5 Merge pull request #11697 from pdxdan/7447-GID-Doc
Updated Dockerfile and docker-run documentation for USER commands
2015-03-24 09:17:41 -07:00
moxiegirl
dbd00822ec Merge pull request #11693 from jessedearing/login_docs
Add documentation about the semantics of `docker login` @jessedearing thanks for the PR!
2015-03-24 09:13:53 -07:00
moxiegirl
d827b4d235 Merge pull request #11688 from afewremarks/master
RE: Issue #6114.  Updated docs to reflect docker inpsect for volumes
2015-03-24 09:12:00 -07:00
Alexander Morozov
9d7f58100f Merge pull request #11670 from runcom/11607-api-route-post-auth-response
Return AuthResponse from postAuth api endpoint
2015-03-24 08:26:07 -07:00
moxiegirl
05c23cad85 Merge pull request #11690 from ssdonline/fix_issue_11683
Fixes error #11683
2015-03-24 06:28:24 -07:00
Lei Jitang
7d70736015 Add some run option to bash completion
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-24 20:15:16 +08:00
Doug Davis
1ad6aae272 Merge pull request #11701 from HuKeping/typo
Fix minor typo
2015-03-24 08:03:09 -04:00
Hu Keping
96d8c3584c Fix minor typo
Fix minor typo and make the comments of version-comparison functions
uniform.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-03-25 00:46:22 +08:00
Paul Bellamy
87df5ab41b Refactor global portallocator and portmapper state
Continuation of: #11660, working on issue #11626.

Wrapped portmapper global state into a struct. Now portallocator and
portmapper have no global state (except configuration, and a default
instance).

Unfortunately, removing the global default instances will break
```api/server/server.go:1539```, and ```daemon/daemon.go:832```, which
both call the global portallocator directly. Fixing that would be a much
bigger change, so for now, have postponed that.

Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
2015-03-24 11:15:30 +00:00
Qiang Huang
a5cbb5c3ae add cpuset and examples to run.md
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-24 18:48:08 +08:00
Antonio Murdaca
babd1b3e1f Return AuthResponse from postAuth api endpoint, Fixes #11607
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 09:57:01 +01:00
Jesse Dearing
ed0d2ac3b7 Add documentation about the semantics of docker login
Fixes #10550

Signed-off-by: Jesse Dearing <jesse.dearing@gmail.com>
2015-03-23 23:53:50 -07:00
Qiang Huang
0f9c20fe68 docs: add memory and swap memory usage examples
fix: https://github.com/docker/docker/issues/11629

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-24 13:45:16 +08:00
moxiegirl
617f18b001 Merge pull request #11692 from khoomeister/ck-fix-another-typo
fix test-and-docs typo "do" to "due"
2015-03-23 21:36:40 -07:00
Chris Khoo
df98ce0a28 fix test-and-docs typo "do" to "due"
Signed-off-by: Chris Khoo <chris.khoo@gmail.com>
2015-03-23 21:12:09 -07:00
Dan Anolik
a57d7c5c79 Added documentation for specifying groupname or GID for commands. Also clarified used of the possible use of multiple USER commands in a Dockerfile.
Signed-off-by: Dan Anolik <dan@anolik.net>
2015-03-23 20:47:04 -07:00
Swapnil Daingade
6fa6b5bcbb Fixes error #11683
Signed-off-by: Swapnil Daingade <swapnil.daingade@gmail.com>
2015-03-23 23:45:55 -04:00
Sven Dowideit
72394a5d7a Merge pull request #11684 from khoomeister/ck-fix-prereq-typo
fix broken prerequisite link
2015-03-24 13:45:48 +10:00
Avi Das
c136591f40 Add comments to api/common constants, closes #11583
Signed-off-by: Avi Das <andas222@gmail.com>
2015-03-23 22:35:41 -05:00
Mark West
ef0275c66c RE: Issue #6114. Updated docs to reflect docker inpsect for volumes
Signed-off-by: Mark West <markewest@gmail.com>
2015-03-23 20:16:40 -07:00
willhf
6dba2d01b5 Add test for net=container and links
Signed-off-by: willhf <willhf@gmail.com>
2015-03-23 19:50:33 -07:00
Arnaud Porterie
3ebd768487 Merge pull request #11681 from alena1108/master
Removed unused "mutex" field
2015-03-23 19:40:38 -07:00
Chris Khoo
b21751da90 fix broken prerequisite link
Signed-off-by: Chris Khoo <chris.khoo@gmail.com>
2015-03-23 19:22:17 -07:00
Alena Prokharchyk
dabd8a02ae Removed unused "mutex" field
fixes #11659

Signed-off-by: Alena Prokharchyk <alena@rancher.com>
2015-03-23 19:05:21 -07:00
John Willis
3d28fc7d1c #11465 Add additional doc for locagi registries onn pull command
Signed-off-by: John Willis <john.willis@docker.com>
2015-03-23 21:00:02 -04:00
Jessie Frazelle
e6b7d93072 Merge pull request #11665 from runcom/11613-api-exec-start-structured-response
Return ContainerExecCreateResponse from container exec create API endpoint
2015-03-23 17:52:15 -07:00
Michael Crosby
f586145cf1 Merge pull request #11634 from robertabbott/testutils_refactor
Refactors pkg/testutils
2015-03-23 17:30:51 -07:00
Jessie Frazelle
26f84d50aa Merge pull request #11674 from jamshid/docfix
correcting git fetch command
2015-03-23 17:11:31 -07:00
Jamshid Afshar
841692ff86 correcting git fetch command
Signed-off-by: Jamshid Afshar <jafshar@yahoo.com>
2015-03-23 19:00:05 -05:00
Jessie Frazelle
d5eea4e8b0 Merge pull request #11636 from robertabbott/refactor_networkfs
Refactor pkg/networkfs
2015-03-23 16:58:29 -07:00
Jessie Frazelle
f99da5745c Merge pull request #11672 from nparker94/master
Added missing code example in the RM command reference
2015-03-23 16:53:39 -07:00
Michael Crosby
4e3c72a026 Merge pull request #11667 from icecrime/integration-cli_image_cleanup
Cleanup "hello-world" image in build tests
2015-03-23 16:42:46 -07:00
Antonio Murdaca
0c3d2f6f96 Return ContainerExecCreateResponse from container exec start API endpoint, Fixes #11613
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 00:41:54 +01:00
Tibor Vass
92f9e2d395 Merge pull request #11657 from GeorgeMac/cleanup-redundant-else
#11602 - Cleanup redundant else statements find via golint
2015-03-23 18:27:29 -05:00
Michael Crosby
f7af5b0a84 Merge pull request #11666 from dmcgowan/fix-v2-get-all-tags
Fix v2 get all tags (carrying 11334)
2015-03-23 16:21:58 -07:00
Michael Crosby
839350d377 Merge pull request #11671 from noxiouz/11669-syslog-log-remove-redundant-stringcast
Syslog.Log - Remove redundant cast of msg.Line []byte to string
2015-03-23 16:16:18 -07:00
Natalie Parker
fe1f5ac77c Added missing code example in the RM command reference of command to delete all stopped containers
Signed-off-by: Natalie Parker <nparker@omnifone.com>
2015-03-23 23:05:57 +00:00
Srini Brahmaroutu
5d70a97b1f Fix the TestPullImageFromCentralRegistry to skip and add local v1 registry test when net=none
Closes #10966
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-03-23 22:53:04 +00:00
Alexander Morozov
197a3f0a98 Merge pull request #11570 from runcom/9658-consistent-autoremove
Remove container if --rm flag is passed and container cannot be started
2015-03-23 15:38:51 -07:00
Anton Tiurin
f2c7b4d743 Syslog.Log - Remove redundant cast of msg.Line []byte to string as
it's a fmt.Sprintf responsibility.

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-03-24 01:35:54 +03:00
Jessie Frazelle
bcb369af11 Merge pull request #11469 from albers/completion-cp
restrict bash completion for hostdir arg to directories
2015-03-23 15:31:00 -07:00
Jessie Frazelle
9d00d8137f Merge pull request #11422 from vbatts/vbatts-overlay_dir_mtime_changes
pkg/archive: ignore mtime changes on directories
2015-03-23 15:24:05 -07:00
Arnaud Porterie
3b4ff1c132 Merge pull request #11264 from brahmaroutu/fixtest_10967
Test image api through local V1 repo, skip network test.
2015-03-23 15:20:39 -07:00
Arnaud Porterie
bfc748221b Cleanup "hello-world" image in build tests
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-23 15:16:13 -07:00
Alexander Morozov
dccaf1434f Merge pull request #11664 from crosbymichael/update-libct-mar23
Update libcontainer to fd0087d3acdc4c5865de1829d4accee5e3ebb658
2015-03-23 15:00:34 -07:00
Derek McGowan
4925d98d1f Add struct tags on v2 remote tags struct
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-03-23 14:33:52 -07:00
Meaglith Ma
221e9624e3 Fix decode tags value error when call get /v2/<name>/tags/list in registry api v2.
Signed-off-by: Meaglith Ma <genedna@gmail.com>
2015-03-23 14:33:52 -07:00
Alexander Morozov
9f894c93e4 Merge pull request #11658 from 4gh/doc_package_builder
Add builder/evaluator comments for the package in godoc-style
2015-03-23 14:27:23 -07:00
Jessie Frazelle
ccd4181d10 Merge pull request #11545 from cpuguy83/remove_allocator_warning
Don't warn when ip_local_port_range not found
2015-03-23 14:19:57 -07:00
Michael Crosby
e321ec9807 Update libcontainer to fd0087d3acdc4c5865de1829d4a
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-23 14:14:20 -07:00
Alexander Morozov
d852e5fde8 Merge pull request #11660 from paulbellamy/11626-portallocator
Refactoring portallocator away from a global var
2015-03-23 14:10:56 -07:00
Frank Herrmann
a0cd004528 Add builder/evaluator comments for the package in godoc-style
fixes #11617

Signed-off-by: Frank Herrmann <fgh@4gh.tv>
2015-03-23 20:56:03 +00:00
Paul Bellamy
1257679876 Refactor global portallocator state into a global struct
Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
2015-03-23 20:41:41 +00:00
George MacRorie
664ef0cbe2 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
2015-03-23 20:40:29 +00:00
Brian Goff
8e4d9f3cf9 Improve err message when parsing kernel port range
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-23 13:29:25 -07:00
Alexander Morozov
bc73f0ea4c Merge pull request #11656 from runcom/11611-builder-evaluator-remove-hardcoded-error
Remove hardcoded error from builder/evaluator.go
2015-03-23 13:25:08 -07:00
Antonio Murdaca
8b02d85e17 Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 20:58:16 +01:00
Jessie Frazelle
b094677559 Merge pull request #11648 from ahmetalpbalkan/win-cli/ansi-emulation-check
Disable ANSI emulation in certain windows shells
2015-03-23 12:55:31 -07:00
Alexander Morozov
2717302cc6 Merge pull request #11654 from runcom/11650-syslog-close-redunant-nil-check
syslog Close() - Remove redunant nil check, s.writer cannot be nil
2015-03-23 12:32:26 -07:00
Alexander Morozov
ec27b77dc2 Merge pull request #11653 from runcom/11649-syslog-refactor-log-else-clause
Refactor syslog Log else clause
2015-03-23 12:29:35 -07:00
Antonio Murdaca
e600df2d97 Remove redunant nil check, s.writer cannot be nil
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 20:03:24 +01:00
Antonio Murdaca
8f025aae36 Refactor syslog Log else clause
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 20:01:01 +01:00
Vincent Batts
3a939d9987 make.sh: leave around the generated version
For positerity (largely of packagers) lets leave around the generated
version files that happen during build.
They're already ignored in git, and recreated on every build.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-23 14:46:44 -04:00
Ahmet Alp Balkan
b38ff8c83d Disable ANSI emulation in certain windows shells
This disables recently added ANSI emulation feature in certain Windows
shells (like ConEmu) where ANSI output is emulated by default with builtin
functionality in the shell.

MSYS (mingw) runs in cmd.exe window and it doesn't support emulation.

Cygwin doesn't even pass terminal handles to docker.exe as far as I can
tell, stdin/stdout/stderr handles are behaving like non-TTY. Therefore not
even including that in the check.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-03-23 18:38:43 +00:00
Alexander Morozov
65e21f5703 Merge pull request #11458 from ibuildthecloud/syslog
Add syslog logging driver
2015-03-23 11:34:33 -07:00
Tibor Vass
61966d281b Merge pull request #10431 from duglin/Issue10391
Clarify ENV non-recursivenes w.r.t. env var substitution + fix escaping
2015-03-23 13:30:11 -05:00
Jessie Frazelle
85ab3c3b49 Merge pull request #11573 from icecrime/11572-restore_pull_test
Restore TestPullVerified test
2015-03-23 11:21:16 -07:00
Jessie Frazelle
1fe55b2f8b Merge pull request #10365 from cpuguy83/9981_fix_cannot_overwrite_nonbind_as_bind
Allow path from normal volume existing to overwrite in start Binds
2015-03-23 10:43:02 -07:00
Alexander Morozov
bd95202161 Merge pull request #11406 from MabinGo/CmdStart_fix
Fix hanging up problem when start and attach multiple containers at once
2015-03-23 10:17:50 -07:00
Jessie Frazelle
c4603de56a Merge pull request #10347 from unclejack/bufreader_reset
reset bufReader to avoid extreme growth of buffers
2015-03-23 10:07:43 -07:00
Jessie Frazelle
56acb1aac8 Merge pull request #11395 from mitchcapper/master
Change windows default permissions to 755 not 711, read access for all p...
2015-03-23 09:59:40 -07:00
Jessie Frazelle
bf304cc414 Merge pull request #11574 from icecrime/release_version_push
Document VERSION file update scheme
2015-03-23 09:47:16 -07:00
Srini Brahmaroutu
5daa9260bc Test image api through local V1 repo
Closes #10967
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-03-23 16:45:48 +00:00
Antonio Murdaca
d124197cc7 Remove container if --rm flag is passed and container cannot be started
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 13:03:31 +01:00
bobby abbott
a91b2431a3 Refactor pkg/networkfs
Solves #11591

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-22 23:53:47 -07:00
bobby abbott
5de1e7bc3a Refactors pkg/testutils
Solves #11579.

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-22 22:31:46 -07:00
Mabin
7dc1af146d Fix hanging up problem when start and attach multiple containers
Signed-off-by: Mabin <bin.ma@huawei.com>
2015-03-23 12:10:22 +08:00
Arnaud Porterie
f07ac12791 Document VERSION file update scheme
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-22 18:45:01 -07:00
Arnaud Porterie
33448ac3c9 Restore TestPullVerified test
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-22 17:56:05 -07:00
sidharthamani
eaecd8b1b5 add syslog driver
Signed-off-by: wlan0 <sid@rancher.com>
2015-03-21 18:01:18 -07:00
Mitch Capper
b7dc9040f0 Change windows default permissions to 755 not 711, read access for all poses little security risk and prevents breaking existing Dockerfiles
Signed-off-by: Mitch Capper <mitch.capper@gmail.com>
2015-03-20 21:54:33 -07:00
Doug Davis
6d66e3e7a5 Fix some escaping around env var processing
Clarify in the docs that ENV is not recursive

Closes #10391

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-20 20:09:00 -07:00
Qiang Huang
0aa250bd60 fix decode data loss when using int64 in json
The problem is when I create container though REST api, set memory limit
in hostConfig, the memory limit didn't work. Because when we DecodeEnv,
we got hostConfig part of Env like this:
{"Binds":["/:/tmp"],"CpuShares":512,"CpusetCpus":"0,1","Devices":[],"Memory":1.6777216e+07,"MemorySwap":0}

And we cannot unmarshal number 1.6777216e+07 into Go value of type int64,
so we got 0.

We can fix this by setting Decoder as UseNumber().

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-21 10:16:18 +08:00
Dan Walsh
3c136333af Btrfs has eliminated the BTRFS_BUILD_VERSION in latest version
They say we should only use the BTRFS_LIB_VERSION

They will no longer support this since it had to be managed manually

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-20 11:43:53 -04:00
Dan Walsh
fe9fe1473c We want to allow the sharing of /dev from the host into the
container.

docker run -v /dev:/dev should stop mounting other default mounts in i
libcontainer otherwise directories and devices like /dev/ptx get mishandled.

We want to be able to run libvirtd for launching vms and it needs
access to the hosts /dev.  This is a key componant of OpenStack.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-20 08:56:21 -04:00
Michal Fojtik
d62f25e422 Fix lxc-start in lxc>1.1.0 where containers start daemonized by default
Signed-off-by: Michal Fojtik <mfojtik@redhat.com>
2015-03-19 14:51:05 +01:00
unclejack
e5ea2b2357 pkg/ioutils: avoid huge Buffer growth in bufreader
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-03-18 19:51:55 +02:00
unclejack
028f7987fe pkg/ioutils: add tests for BufReader
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-03-18 19:32:46 +02:00
Harald Albers
418b7a9abb restrict bash completion for hostdir arg to directories
The previous state assumed that the HOSTPATH argument referred to a
file. As clarified by moxiegirl in PR #11305, it is a directory.
Adjusted completion to reflect this.

Signed-off-by: Harald Albers <github@albersweb.de>
2015-03-18 18:10:58 +01:00
Vincent Batts
2ce37f6616 pkg/archive: ignore mtime changes on directories
on overlay fs, the mtime of directories changes in a container where new
files are added in an upper layer (e.g. '/etc'). This flags the
directory as a change where there was none.

Closes #9874

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-03-17 10:53:34 -04:00
André Martins
4e65c1c319 Dealing with trailing whitespaces
Created a validation that detects all trailing whitespaces from every
text file that isn't *.go, *.md, vendor/*,
docs/theme/mkdocs/tipuesearch*

Removed trailing whitespaces from every text file except from vendor/*
builder/parser/testfiles*, docs/theme/mkdocs/tipuesearch* and *.md

Signed-off-by: André Martins <martins@noironetworks.com>
2015-03-17 03:34:01 +00:00
Iavael
ab181ce557 Fixed handling hardlinks to symlinks in tar stream
Signed-off-by: Iavael <iavaelooeyt@gmail.com>
2015-03-03 16:10:53 +03:00
Brian Goff
49e1ad49c8 Allow normal volume to overwrite in start Binds
Fixes #9981
Allows a volume which was created by docker (ie, in
/var/lib/docker/vfs/dir) to be used as a Bind argument via the container
start API and overwrite an existing volume.

For example:

```bash
docker create -v /foo --name one
docker create -v /foo --name two
```

This allows the volume from `one` to be passed into the container start
API as a bind to `two`, and it will overwrite it.

This was possible before 7107898d5c

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-10 20:46:37 -05:00
1292 changed files with 81462 additions and 38064 deletions

50
.gitignore vendored
View File

@@ -1,33 +1,37 @@
# Docker project generated files to ignore
# if you want to ignore files created by your editor/tools,
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
.vagrant*
bin
docker/docker
*.exe
.*.swp
a.out
*.orig
build_src
.flymake*
.idea
*.rej
*.test
.*.swp
.DS_Store
.bashrc
.dotcloud
.flymake*
.git/
.gopath/
.hg/
.idea
.vagrant*
Vagrantfile
a.out
autogen/
bin
build_src
bundles/
docker/docker
docs/AWS_S3_BUCKET
docs/GITCOMMIT
docs/GIT_BRANCH
docs/VERSION
docs/_build
docs/_static
docs/_templates
.gopath/
.dotcloud
*.test
bundles/
.hg/
.git/
vendor/pkg/
pyenv
Vagrantfile
docs/AWS_S3_BUCKET
docs/GIT_BRANCH
docs/VERSION
docs/GITCOMMIT
docs/changed-files
autogen/
.bashrc
# generated by man/man/md2man-all.sh
man/man1
man/man5
pyenv
vendor/pkg/

View File

@@ -1,5 +1,76 @@
# Changelog
## 1.7.0 (2015-06-16)
#### Runtime
+ Experimental feature: support for out-of-process volume plugins
+ Experimental feature: support for out-of-process network plugins
* Logging: syslog logging driver is available
* The userland proxy can be disabled in favor of hairpin NAT using the daemons `--userland-proxy=false` flag
* The `exec` command supports the `-u|--user` flag to specify the new process owner
+ Default gateway for containers can be specified daemon-wide using the `--default-gateway` and `--default-gateway-v6` flags
+ The CPU CFS (Completely Fair Scheduler) quota can be set in `docker run` using `--cpu-quota`
+ Container block IO can be controlled in `docker run` using`--blkio-weight`
+ ZFS support
+ The `docker logs` command supports a `--since` argument
+ UTS namespace can be shared with the host with `docker run --uts=host`
#### Quality
* Networking stack was entirely rewritten as part of the libnetwork effort
* Engine internals refactoring
* Volumes code was entirely rewritten to support the plugins effort
+ Sending SIGUSR1 to a daemon will dump all goroutines stacks without exiting
#### Build
+ Support ${variable:-value} and ${variable:+value} syntax for environment variables
+ Support resource management flags `--cgroup-parent`, `--cpu-period`, `--cpu-quota`, `--cpuset-cpus`, `--cpuset-mems`
+ git context changes with branches and directories
* The .dockerignore file support exclusion rules
#### Distribution
+ Client support for v2 mirroring support for the official registry
#### Bugfixes
* Firewalld is now supported and will automatically be used when available
* mounting --device recursively
## 1.6.2 (2015-05-13)
#### Runtime
- Revert change prohibiting mounting into /sys
## 1.6.1 (2015-05-07)
#### Security
- Fix read/write /proc paths (CVE-2015-3630)
- Prohibit VOLUME /proc and VOLUME / (CVE-2015-3631)
- Fix opening of file-descriptor 1 (CVE-2015-3627)
- Fix symlink traversal on container respawn allowing local privilege escalation (CVE-2015-3629)
- Prohibit mount of /sys
#### Runtime
- Update Apparmor policy to not allow mounts
## 1.6.0 (2015-04-07)
#### Builder
+ Building images from an image ID
+ Build containers with resource constraints, ie `docker build --cpu-shares=100 --memory=1024m...`
+ `commit --change` to apply specified Dockerfile instructions while committing the image
+ `import --change` to apply specified Dockerfile instructions while importing the image
+ Builds no longer continue in the background when canceled with CTRL-C
#### Client
+ Windows Support
#### Runtime
+ Container and image Labels
+ `--cgroup-parent` for specifying a parent cgroup to place container cgroup within
+ Logging drivers, `json-file`, `syslog`, or `none`
+ Pulling images by ID
+ `--ulimit` to set the ulimit on a container
+ `--default-ulimit` option on the daemon which applies to all created containers (and overwritten by `--ulimit` on run)
## 1.5.0 (2015-02-10)
#### Builder

View File

@@ -129,12 +129,12 @@ However, there might be a way to implement that feature *on top of* Docker.
<col width="45%">
<col width="65%">
<tr>
<td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</th>
<td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>
<td>
<p>
IRC a direct line to our most knowledgeable Docker users; we have
both the <code>#docker</code> and <code>#docker-dev</code> group on
<strong>irc.freenode.net</strong>.
both the <code>#docker</code> and <code>#docker-dev</code> group on
<strong>irc.freenode.net</strong>.
IRC is a rich chat protocol but it can overwhelm new users. You can search
<a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
</p>
@@ -146,9 +146,9 @@ However, there might be a way to implement that feature *on top of* Docker.
<td>
There are two groups.
<a href="https://groups.google.com/forum/#!forum/docker-user" target="_blank">Docker-user</a>
is for people using Docker containers.
The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
group is for contributors and other people contributing to the Docker
is for people using Docker containers.
The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
group is for contributors and other people contributing to the Docker
project.
</td>
</tr>
@@ -156,15 +156,15 @@ However, there might be a way to implement that feature *on top of* Docker.
<td>Twitter</td>
<td>
You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's Twitter feed</a>
to get updates on our products. You can also tweet us questions or just
to get updates on our products. You can also tweet us questions or just
share blogs or stories.
</td>
</tr>
<tr>
<td>Stack Overflow</td>
<td>
Stack Overflow has over 7000K Docker questions listed. We regularly
monitor <a href="http://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
Stack Overflow has over 7000K Docker questions listed. We regularly
monitor <a href="https://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
and so do many other knowledgeable Docker users.
</td>
</tr>

View File

@@ -26,11 +26,15 @@
FROM ubuntu:14.04
MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
RUN echo deb http://ppa.launchpad.net/zfs-native/stable/ubuntu trusty main > /etc/apt/sources.list.d/zfs.list
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \
aufs-tools \
automake \
bash-completion \
btrfs-tools \
build-essential \
curl \
@@ -49,6 +53,8 @@ RUN apt-get update && apt-get install -y \
ruby1.9.1 \
ruby1.9.1-dev \
s3cmd=1.1.0* \
ubuntu-zfs \
libzfs-dev \
--no-install-recommends
# Get lvm2 source for compiling statically
@@ -97,12 +103,19 @@ RUN cd /usr/local/go/src \
./make.bash --no-clean 2>&1; \
done
# We still support compiling with older Go, so need to grab older "gofmt"
ENV GOFMT_VERSION 1.3.3
RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt
# This has been commented out and kept as reference because we don't support compiling with older Go anymore.
# ENV GOFMT_VERSION 1.3.3
# RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt
# Update this sha when we upgrade to go 1.5.0
ENV GO_TOOLS_COMMIT 069d2f3bcb68257b627205f0486d6cc69a231ff9
# Grab Go's cover tool for dead-simple code coverage testing
RUN go get golang.org/x/tools/cmd/cover
# Grab Go's vet tool for examining go code to find suspicious constructs
# and help prevent errors that the compiler might not catch
RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \
&& go install -v golang.org/x/tools/cmd/cover \
&& go install -v golang.org/x/tools/cmd/vet
# TODO replace FPM with some very minimal debhelper stuff
RUN gem install --no-rdoc --no-ri fpm --version 1.3.2
@@ -113,7 +126,8 @@ RUN set -x \
&& git clone https://github.com/docker/distribution.git /go/src/github.com/docker/distribution \
&& (cd /go/src/github.com/docker/distribution && git checkout -q $REGISTRY_COMMIT) \
&& GOPATH=/go/src/github.com/docker/distribution/Godeps/_workspace:/go \
go build -o /go/bin/registry-v2 github.com/docker/distribution/cmd/registry
go build -o /go/bin/registry-v2 github.com/docker/distribution/cmd/registry \
&& rm -rf /go/src/github.com/docker/distribution/
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT 91985b239764fe54714fa0a93d52aa362357d251
@@ -137,32 +151,37 @@ RUN useradd --create-home --gid docker unprivilegeduser
VOLUME /var/lib/docker
WORKDIR /go/src/github.com/docker/docker
ENV DOCKER_BUILDTAGS apparmor selinux btrfs_noversion
ENV DOCKER_BUILDTAGS apparmor selinux
# Let us use a .bashrc file
RUN ln -sfv $PWD/.bashrc ~/.bashrc
# Register Docker's bash completion.
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image.sh /docker-frozen-images \
busybox:latest@4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125 \
hello-world:frozen@e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5
hello-world:frozen@e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5 \
jess/unshare@5c9f6ea50341a2a8eb6677527f2bdedbf331ae894a41714fda770fb130f3314d
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
# Install man page generator
COPY vendor /go/src/github.com/docker/docker/vendor
# (copy vendor/ because go-md2man needs golang.org/x/net)
# Download man page generator
RUN set -x \
&& git clone -b v1.0.1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
&& git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday \
&& go install -v github.com/cpuguy83/go-md2man
&& git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday
# install toml validator
# Download toml validator
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
RUN set -x \
&& git clone https://github.com/BurntSushi/toml.git /go/src/github.com/BurntSushi/toml \
&& (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT) \
&& go install -v github.com/BurntSushi/toml/cmd/tomlv
&& (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT)
# copy vendor/ because go-md2man needs golang.org/x/net
COPY vendor /go/src/github.com/docker/docker/vendor
RUN go install -v github.com/cpuguy83/go-md2man \
github.com/BurntSushi/toml/cmd/tomlv
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]

View File

@@ -1,7 +1,7 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
@@ -182,7 +182,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,

View File

@@ -37,7 +37,7 @@ project from a great one.
text = """
Docker follows the timeless, highly efficient and totally unfair system
known as [Benevolent dictator for
life](http://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), with
life](https://en.wikipedia.org/wiki/Benevolent_Dictator_for_Life), with
yours truly, Solomon Hykes, in the role of BDFL. This means that all
decisions are made, by default, by Solomon. Since making every decision
myself would be highly un-scalable, in practice decisions are spread
@@ -113,7 +113,7 @@ It is the responsibility of the subsystem maintainers to process patches affecti
manner.
* If the change affects areas of the code which are not part of a subsystem,
or if subsystem maintainers are unable to reach a timely decision, it must be approved by
or if subsystem maintainers are unable to reach a timely decision, it must be approved by
the core maintainers.
* If the change affects the UI or public APIs, or if it represents a major change in architecture,
@@ -131,7 +131,7 @@ for each.
"""
# Triage
[Rules.review.states.0-triage]
[Rules.review.states.0-needs-triage]
# Maintainers are expected to triage new incoming pull requests by removing
# the `0-triage` label and adding the correct labels (e.g. `1-design-review`)
@@ -149,7 +149,7 @@ for each.
1-design-review = "general case"
# Design review
[Rules.review.states.1-design-review]
[Rules.review.states.1-needs-design-review]
# Maintainers are expected to comment on the design of the pull request.
# Review of documentation is expected only in the context of design validation,
@@ -166,7 +166,7 @@ for each.
2-code-review = "general case"
# Code review
[Rules.review.states.2-code-review]
[Rules.review.states.2-needs-code-review]
# Maintainers are expected to review the code and ensure that it is good
# quality and in accordance with the documentation in the PR.
@@ -184,7 +184,7 @@ for each.
3-docs-review = "general case"
# Docs review
[Rules.review.states.3-docs-review]
[Rules.review.states.3-needs-docs-review]
# Maintainers are expected to review the documentation in its bigger context,
# ensuring consistency, completeness, validity, and breadth of coverage across
@@ -193,6 +193,11 @@ for each.
# They should ask for any editorial change that makes the documentation more
# consistent and easier to understand.
#
# Changes and additions to docs must be reviewed and approved (LGTM'd) by a minimum of
# two docs sub-project maintainers. If the docs change originates with a docs
# maintainer, only one additional LGTM is required (since we assume a docs maintainer
# approves of their own PR).
#
# Once documentation is approved (see below), a maintainer should make sure to remove this
# label and add the next one.
@@ -200,14 +205,9 @@ for each.
2-code-review = "requires more code changes"
1-design-review = "raises design concerns"
4-merge = "general case"
# Docs approval
[Rules.review.docs-approval]
# Changes and additions to docs must be reviewed and approved (LGTM'd) by a minimum of two docs sub-project maintainers.
# If the docs change originates with a docs maintainer, only one additional LGTM is required (since we assume a docs maintainer approves of their own PR).
# Merge
[Rules.review.states.4-merge]
[Rules.review.states.4-needs-merge]
# Maintainers are expected to merge this pull request as soon as possible.
# They can ask for a rebase, or carry the pull request themselves.
@@ -268,7 +268,7 @@ made through a pull request.
# The chief architect is responsible for the overall integrity of the technical architecture
# across all subsystems, and the consistency of APIs and UI.
#
#
# Changes to UI, public APIs and overall architecture (for example a plugin system) must
# be approved by the chief architect.
"Chief Architect" = "shykes"
@@ -296,7 +296,9 @@ made through a pull request.
[Org.Operators.security]
people = [
"erw"
"erw",
"diogomonica",
"nathanmccauley"
]
[Org.Operators."monthly meetings"]
@@ -312,13 +314,29 @@ made through a pull request.
"jfrazelle",
"crosbymichael"
]
[Org.Operators.community]
people = [
"theadactyl"
]
# The chief maintainer is responsible for all aspects of quality for the project including
# code reviews, usability, stability, security, performance, etc.
# code reviews, usability, stability, security, performance, etc.
# The most important function of the chief maintainer is to lead by example. On the first
# day of a new maintainer, the best advice should be "follow the C.M.'s example and you'll
# be fine".
"Chief Maintainer" = "crosbymichael"
# The community manager is responsible for serving the project community, including users,
# contributors and partners. This involves:
# - facilitating communication between maintainers, contributors and users
# - organizing contributor and maintainer events
# - helping new contributors get involved
# - anything the project community needs to be successful
#
# The community manager is a point of contact for any contributor who has questions, concerns
# or feedback about project operations.
"Community Manager" = "theadactyl"
[Org."Core maintainers"]
@@ -339,14 +357,15 @@ made through a pull request.
people = [
"unclejack",
"crosbymichael",
"erikh",
"estesp",
"icecrime",
"jfrazelle",
"lk4d4",
"runcom",
"tibor",
"unclejack",
"vbatts",
"vieux",
"vishh"
@@ -359,80 +378,81 @@ made through a pull request.
# has a dedicated group of maintainers, which are dedicated to that subsytem and responsible
# for its quality.
# This "cellular division" is the primary mechanism for scaling maintenance of the project as it grows.
#
#
# The maintainers of each subsytem are responsible for:
#
#
# 1. Exposing a clear road map for improving their subsystem.
# 2. Deliver prompt feedback and decisions on pull requests affecting their subsystem.
# 3. Be available to anyone with questions, bug reports, criticism etc.
# on their component. This includes IRC, GitHub requests and the mailing
# list.
# on their component. This includes IRC, GitHub requests and the mailing
# list.
# 4. Make sure their subsystem respects the philosophy, design and
# road map of the project.
# road map of the project.
#
# #### How to review patches to your subsystem
#
#
# Accepting pull requests:
#
# - If the pull request appears to be ready to merge, give it a `LGTM`, which
# stands for "Looks Good To Me".
# - If the pull request has some small problems that need to be changed, make
# a comment adressing the issues.
# - If the changes needed to a PR are small, you can add a "LGTM once the
# following comments are adressed..." this will reduce needless back and
# forth.
# - If the PR only needs a few changes before being merged, any MAINTAINER can
# make a replacement PR that incorporates the existing commits and fixes the
# problems before a fast track merge.
#
#
# - If the pull request appears to be ready to merge, give it a `LGTM`, which
# stands for "Looks Good To Me".
# - If the pull request has some small problems that need to be changed, make
# a comment adressing the issues.
# - If the changes needed to a PR are small, you can add a "LGTM once the
# following comments are adressed..." this will reduce needless back and
# forth.
# - If the PR only needs a few changes before being merged, any MAINTAINER can
# make a replacement PR that incorporates the existing commits and fixes the
# problems before a fast track merge.
#
# Closing pull requests:
#
# - If a PR appears to be abandoned, after having attempted to contact the
# original contributor, then a replacement PR may be made. Once the
# replacement PR is made, any contributor may close the original one.
# - If you are not sure if the pull request implements a good feature or you
# do not understand the purpose of the PR, ask the contributor to provide
# more documentation. If the contributor is not able to adequately explain
# the purpose of the PR, the PR may be closed by any MAINTAINER.
# - If a MAINTAINER feels that the pull request is sufficiently architecturally
# flawed, or if the pull request needs significantly more design discussion
# before being considered, the MAINTAINER should close the pull request with
# a short explanation of what discussion still needs to be had. It is
# important not to leave such pull requests open, as this will waste both the
# MAINTAINER's time and the contributor's time. It is not good to string a
# contributor on for weeks or months, having them make many changes to a PR
# that will eventually be rejected.
#
# - If a PR appears to be abandoned, after having attempted to contact the
# original contributor, then a replacement PR may be made. Once the
# replacement PR is made, any contributor may close the original one.
# - If you are not sure if the pull request implements a good feature or you
# do not understand the purpose of the PR, ask the contributor to provide
# more documentation. If the contributor is not able to adequately explain
# the purpose of the PR, the PR may be closed by any MAINTAINER.
# - If a MAINTAINER feels that the pull request is sufficiently architecturally
# flawed, or if the pull request needs significantly more design discussion
# before being considered, the MAINTAINER should close the pull request with
# a short explanation of what discussion still needs to be had. It is
# important not to leave such pull requests open, as this will waste both the
# MAINTAINER's time and the contributor's time. It is not good to string a
# contributor on for weeks or months, having them make many changes to a PR
# that will eventually be rejected.
[Org.Subsystems.Documentation]
people = [
"fredlf",
"james",
"sven",
"moxiegirl",
"thaJeztah",
"jamtur01",
"spf13",
"mary"
"sven"
]
[Org.Subsystems.libcontainer]
people = [
"crosbymichael",
"vmarmol",
"mpatel",
"jnagal",
"lk4d4"
"lk4d4",
"mpatel",
"vmarmol"
]
[Org.Subsystems.registry]
people = [
"dmcg",
"dmp42",
"vbatts",
"joffrey",
"jlhawn",
"samalba",
"sday",
"jlhawn",
"dmcg"
"vbatts"
]
[Org.Subsystems."build tools"]
@@ -471,11 +491,27 @@ made through a pull request.
[Org.Subsystem.builder]
people = [
"duglin",
"erikh",
"tibor",
"duglin"
"tibor"
]
[Org.Curators]
# The curators help ensure that incoming issues and pull requests are properly triaged and
# that our various contribution and reviewing processes are respected. With their knowledge of
# the repository activity, they can also guide contributors to relevant material or
# discussions.
#
# They are neither code nor docs reviewers, so they are never expected to merge. They can
# however:
# - close an issue or pull request when it's an exact duplicate
# - close an issue or pull request when it's inappropriate or off-topic
people = [
"thajeztah"
]
[people]
@@ -500,11 +536,21 @@ made through a pull request.
Email = "ben@firshman.co.uk"
GitHub = "bfirsh"
[people.cpuguy83]
Name = "Brian Goff"
Email = "cpuguy83@gmail.com"
Github = "cpuguy83"
[people.crosbymichael]
Name = "Michael Crosby"
Email = "crosbymichael@gmail.com"
GitHub = "crosbymichael"
[people.diogomonica]
Name = "Diogo Monica"
Email = "diogo@docker.com"
GitHub = "diogomonica"
[people.duglin]
Name = "Doug Davis"
Email = "dug@us.ibm.com"
@@ -552,7 +598,7 @@ made through a pull request.
[people.jfrazelle]
Name = "Jessie Frazelle"
Email = "jess@docker.com"
Email = "j@docker.com"
GitHub = "jfrazelle"
[people.jlhawn]
@@ -560,21 +606,26 @@ made through a pull request.
Email = "josh.hawn@docker.com"
Github = "jlhawn"
[people.joffrey]
Name = "Joffrey Fuhrer"
Email = "joffrey@docker.com"
Github = "shin-"
[people.lk4d4]
Name = "Alexander Morozov"
Email = "lk4d4@docker.com"
GitHub = "lk4d4"
[people.mary]
[people.moxiegirl]
Name = "Mary Anthony"
Email = "mary.anthony@docker.com"
GitHub = "moxiegirl"
[people.nathanmccauley]
Name = "Nathan McCauley"
Email = "nathan.mccauley@docker.com"
GitHub = "nathanmccauley"
[people.runcom]
Name = "Antonio Murdaca"
Email = "me@runcom.ninja"
GitHub = "runcom"
[people.sday]
Name = "Stephen Day"
Email = "stephen.day@docker.com"
@@ -584,17 +635,27 @@ made through a pull request.
Name = "Solomon Hykes"
Email = "solomon@docker.com"
GitHub = "shykes"
[people.spf13]
Name = "Steve Francia"
Email = "steve.francia@gmail.com"
GitHub = "spf13"
[people.sven]
Name = "Sven Dowideit"
Email = "SvenDowideit@home.org.au"
GitHub = "SvenDowideit"
[people.thajeztah]
Name = "Sebastiaan van Stijn"
Email = "github@gone.nl"
GitHub = "thaJeztah"
[people.theadactyl]
Name = "Thea Lamkin"
Email = "thea@docker.com"
GitHub = "theadactyl"
[people.tianon]
Name = "Tianon Gravi"
Email = "admwiggin@gmail.com"

View File

@@ -1,4 +1,4 @@
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate
.PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration-cli test-docker-py validate
# env vars passed through directly to Docker's build scripts
# to allow things like `make DOCKER_CLIENTONLY=1 binary` easily
@@ -7,7 +7,10 @@ DOCKER_ENVS := \
-e BUILDFLAGS \
-e DOCKER_CLIENTONLY \
-e DOCKER_EXECDRIVER \
-e DOCKER_EXPERIMENTAL \
-e DOCKER_GRAPHDRIVER \
-e DOCKER_STORAGE_OPTS \
-e DOCKER_USERLANDPROXY \
-e TESTDIRS \
-e TESTFLAGS \
-e TIMEOUT
@@ -19,14 +22,9 @@ DOCKER_ENVS := \
BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
# to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
# to allow `make DOCSPORT=9000 docs`
DOCSPORT := 8000
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_RUN_DOCKER := docker run --rm -it --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
@@ -47,29 +45,13 @@ binary: build
cross: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
docs: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve
docs-shell: docs-build
$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
docs-release: docs-build
$(DOCKER_RUN_DOCS) -e OPTIONS -e BUILD_ROOT -e DISTRIBUTION_ID \
-v $(CURDIR)/docs/awsconfig:/docs/awsconfig \
"$(DOCKER_DOCS_IMAGE)" ./release.sh
docs-test: docs-build
$(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./test.sh
test: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration test-integration-cli test-docker-py
$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py
test-unit: build
$(DOCKER_RUN_DOCKER) hack/make.sh test-unit
test-integration: build
$(DOCKER_RUN_DOCKER) hack/make.sh test-integration
test-integration-cli: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-integration-cli
@@ -77,7 +59,7 @@ test-docker-py: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
validate: build
$(DOCKER_RUN_DOCKER) hack/make.sh validate-gofmt validate-dco validate-toml
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-test validate-toml validate-vet
shell: build
$(DOCKER_RUN_DOCKER) bash
@@ -85,13 +67,5 @@ shell: build
build: bundles
docker build -t "$(DOCKER_IMAGE)" .
docs-build:
cp ./VERSION docs/VERSION
echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
# echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
echo "$(GITCOMMIT)" > docs/GITCOMMIT
docker pull docs/base
docker build -t "$(DOCKER_DOCS_IMAGE)" docs
bundles:
mkdir bundles

10
NOTICE
View File

@@ -1,7 +1,7 @@
Docker
Copyright 2012-2015 Docker, Inc.
This product includes software developed at Docker, Inc. (http://www.docker.com).
This product includes software developed at Docker, Inc. (https://www.docker.com).
This product contains software (https://github.com/kr/pty) developed
by Keith Rarick, licensed under the MIT License.
@@ -10,10 +10,10 @@ The following is courtesy of our legal counsel:
Use and transfer of Docker may be subject to certain restrictions by the
United States and other governments.
United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not
violate applicable laws.
violate applicable laws.
For more information, please see http://www.bis.doc.gov
For more information, please see https://www.bis.doc.gov
See also http://www.apache.org/dev/crypto.html and/or seek legal counsel.
See also https://www.apache.org/dev/crypto.html and/or seek legal counsel.

111
README.md
View File

@@ -2,7 +2,7 @@ Docker: the Linux container engine
==================================
Docker is an open source project to pack, ship and run any application
as a lightweight container
as a lightweight container.
Docker containers are both *hardware-agnostic* and *platform-agnostic*.
This means they can run anywhere, from your laptop to the largest
@@ -13,7 +13,7 @@ databases, and backend services without depending on a particular stack
or provider.
Docker began as an open-source implementation of the deployment engine which
powers [dotCloud](http://dotcloud.com), a popular Platform-as-a-Service.
powers [dotCloud](https://dotcloud.com), a popular Platform-as-a-Service.
It benefits directly from the experience accumulated over several years
of large-scale operation and support of hundreds of thousands of
applications and databases.
@@ -30,7 +30,7 @@ security@docker.com and not by creating a github issue.
A common method for distributing applications and sandboxing their
execution is to use virtual machines, or VMs. Typical VM formats are
VMWare's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory
VMware's vmdk, Oracle Virtualbox's vdi, and Amazon EC2's ami. In theory
these formats should allow every developer to automatically package
their application into a "machine" for easy distribution and deployment.
In practice, that almost never happens, for a few reasons:
@@ -56,12 +56,12 @@ By contrast, Docker relies on a different sandboxing method known as
*containerization*. Unlike traditional virtualization, containerization
takes place at the kernel level. Most modern operating system kernels
now support the primitives necessary for containerization, including
Linux with [openvz](http://openvz.org),
Linux with [openvz](https://openvz.org),
[vserver](http://linux-vserver.org) and more recently
[lxc](http://lxc.sourceforge.net), Solaris with
[zones](http://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc),
[zones](https://docs.oracle.com/cd/E26502_01/html/E29024/preface-1.html#scrolltoc),
and FreeBSD with
[Jails](http://www.freebsd.org/doc/handbook/jails.html).
[Jails](https://www.freebsd.org/doc/handbook/jails.html).
Docker builds on top of these low-level primitives to offer developers a
portable format and runtime environment that solves all four problems.
@@ -105,7 +105,7 @@ This is usually difficult for several reasons:
these situations with various degrees of ease - but they all
handle them in different and incompatible ways, which again forces
the developer to do extra work.
* *Custom dependencies*. A developer may need to prepare a custom
version of their application's dependency. Some packaging systems
can handle custom versions of a dependency, others can't - and all
@@ -115,7 +115,7 @@ This is usually difficult for several reasons:
Docker solves the problem of dependency hell by giving the developer a simple
way to express *all* their application's dependencies in one place, while
streamlining the process of assembling them. If this makes you think of
[XKCD 927](http://xkcd.com/927/), don't worry. Docker doesn't
[XKCD 927](https://xkcd.com/927/), don't worry. Docker doesn't
*replace* your favorite packaging systems. It simply orchestrates
their use in a simple and repeatable way. How does it do that? With
layers.
@@ -147,19 +147,19 @@ Docker can be installed on your local machine as well as servers - both
bare metal and virtualized. It is available as a binary on most modern
Linux systems, or as a VM on Windows, Mac and other systems.
We also offer an [interactive tutorial](http://www.docker.com/tryit/)
We also offer an [interactive tutorial](https://www.docker.com/tryit/)
for quickly learning the basics of using Docker.
For up-to-date install instructions, see the [Docs](http://docs.docker.com).
For up-to-date install instructions, see the [Docs](https://docs.docker.com).
Usage examples
==============
Docker can be used to run short-lived commands, long-running daemons
(app servers, databases etc.), interactive shell sessions, etc.
(app servers, databases, etc.), interactive shell sessions, etc.
You can find a [list of real-world
examples](http://docs.docker.com/examples/) in the
examples](https://docs.docker.com/examples/) in the
documentation.
Under the hood
@@ -171,16 +171,16 @@ Under the hood, Docker is built on the following components:
[cgroup](http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-24-c)
and
[namespacing](http://blog.dotcloud.com/under-the-hood-linux-kernels-on-dotcloud-part)
capabilities of the Linux kernel;
* The [Go](http://golang.org) programming language.
* The [Docker Image Specification] (https://github.com/docker/docker/blob/master/image/spec/v1.md)
* The [Libcontainer Specification] (https://github.com/docker/libcontainer/blob/master/SPEC.md)
capabilities of the Linux kernel
* The [Go](https://golang.org) programming language
* The [Docker Image Specification](https://github.com/docker/docker/blob/master/image/spec/v1.md)
* The [Libcontainer Specification](https://github.com/docker/libcontainer/blob/master/SPEC.md)
Contributing to Docker
======================
[![GoDoc](https://godoc.org/github.com/docker/docker?status.png)](https://godoc.org/github.com/docker/docker)
[![Jenkins Build Status](https://jenkins.dockerproject.com/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.com/job/Docker%20Master/)
[![GoDoc](https://godoc.org/github.com/docker/docker?status.svg)](https://godoc.org/github.com/docker/docker)
[![Jenkins Build Status](https://jenkins.dockerproject.org/job/Docker%20Master/badge/icon)](https://jenkins.dockerproject.org/job/Docker%20Master/)
Want to hack on Docker? Awesome! We have [instructions to help you get
started contributing code or documentation.](https://docs.docker.com/project/who-written-for/).
@@ -192,12 +192,12 @@ Getting the development builds
==============================
Want to run Docker from a master build? You can download
master builds at [master.dockerproject.com](https://master.dockerproject.com).
master builds at [master.dockerproject.org](https://master.dockerproject.org).
They are updated with each commit merged into the master branch.
Don't know how to use that super cool new feature in the master build? Check
out the master docs at
[docs.master.dockerproject.com](http://docs.master.dockerproject.com).
[docs.master.dockerproject.org](http://docs.master.dockerproject.org).
How the project is run
======================
@@ -207,17 +207,65 @@ or want to get more involved, the best place to start is [the project directory]
We are always open to suggestions on process improvements, and are always looking for more maintainers.
### Talking to other Docker users and contributors
<table class="tg">
<col width="45%">
<col width="65%">
<tr>
<td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>
<td>
<p>
IRC a direct line to our most knowledgeable Docker users; we have
both the <code>#docker</code> and <code>#docker-dev</code> group on
<strong>irc.freenode.net</strong>.
IRC is a rich chat protocol but it can overwhelm new users. You can search
<a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
</p>
Read our <a href="https://docs.docker.com/project/get-help/#irc-quickstart" target="_blank">IRC quickstart guide</a> for an easy way to get started.
</td>
</tr>
<tr>
<td>Google Groups</td>
<td>
There are two groups.
<a href="https://groups.google.com/forum/#!forum/docker-user" target="_blank">Docker-user</a>
is for people using Docker containers.
The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
group is for contributors and other people contributing to the Docker
project.
</td>
</tr>
<tr>
<td>Twitter</td>
<td>
You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's Twitter feed</a>
to get updates on our products. You can also tweet us questions or just
share blogs or stories.
</td>
</tr>
<tr>
<td>Stack Overflow</td>
<td>
Stack Overflow has over 7000K Docker questions listed. We regularly
monitor <a href="https://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
and so do many other knowledgeable Docker users.
</td>
</tr>
</table>
### Legal
*Brought to you courtesy of our legal counsel. For more context,
please see the "NOTICE" document in this repo.*
please see the [NOTICE](https://github.com/docker/docker/blob/master/NOTICE) document in this repo.*
Use and transfer of Docker may be subject to certain restrictions by the
United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not
violate applicable laws.
United States and other governments.
For more information, please see http://www.bis.doc.gov
It is your responsibility to ensure that your use and/or transfer does not
violate applicable laws.
For more information, please see https://www.bis.doc.gov
Licensing
@@ -230,17 +278,18 @@ Other Docker Related Projects
=============================
There are a number of projects under development that are based on Docker's
core technology. These projects expand the tooling built around the
Docker platform to broaden its application and utility.
If you know of another project underway that should be listed here, please help
us keep this list up-to-date by submitting a PR.
Docker platform to broaden its application and utility.
* [Docker Registry](https://github.com/docker/distribution): Registry
server for Docker (hosting/delivery of repositories and images)
* [Docker Machine](https://github.com/docker/machine): Machine management
for a container-centric world
for a container-centric world
* [Docker Swarm](https://github.com/docker/swarm): A Docker-native clustering
system
system
* [Docker Compose](https://github.com/docker/compose) (formerly Fig):
Define and run multi-container apps
* [Kitematic](https://github.com/kitematic/kitematic): The easiest way to use
Docker on a Mac
If you know of another project underway that should be listed here, please help
us keep this list up-to-date by submitting a PR.

View File

@@ -1 +1 @@
1.5.0-dev
1.7.0-rc4

83
api/client/attach.go Normal file
View File

@@ -0,0 +1,83 @@
package client
import (
"encoding/json"
"fmt"
"io"
"net/url"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/signal"
)
// CmdAttach attaches to a running container.
//
// Usage: docker attach [OPTIONS] CONTAINER
func (cli *DockerCli) CmdAttach(args ...string) error {
var (
cmd = cli.Subcmd("attach", "CONTAINER", "Attach to a running container", true)
noStdin = cmd.Bool([]string{"#nostdin", "-no-stdin"}, false, "Do not attach STDIN")
proxy = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxy all received signals to the process")
)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
stream, _, err := cli.call("GET", "/containers/"+name+"/json", nil, nil)
if err != nil {
return err
}
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return err
}
if !c.State.Running {
return fmt.Errorf("You cannot attach to a stopped container, start it first")
}
if err := cli.CheckTtyInput(!*noStdin, c.Config.Tty); err != nil {
return err
}
if c.Config.Tty && cli.isTerminalOut {
if err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {
logrus.Debugf("Error monitoring TTY size: %s", err)
}
}
var in io.ReadCloser
v := url.Values{}
v.Set("stream", "1")
if !*noStdin && c.Config.OpenStdin {
v.Set("stdin", "1")
in = cli.in
}
v.Set("stdout", "1")
v.Set("stderr", "1")
if *proxy && !c.Config.Tty {
sigc := cli.forwardAllSignals(cmd.Arg(0))
defer signal.StopCatch(sigc)
}
if err := cli.hijack("POST", "/containers/"+cmd.Arg(0)+"/attach?"+v.Encode(), c.Config.Tty, in, cli.out, cli.err, nil, nil); err != nil {
return err
}
_, status, err := getExitCode(cli, cmd.Arg(0))
if err != nil {
return err
}
if status != 0 {
return StatusError{StatusCode: status}
}
return nil
}

310
api/client/build.go Normal file
View File

@@ -0,0 +1,310 @@
package client
import (
"bufio"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"github.com/docker/docker/api"
"github.com/docker/docker/graph/tags"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/jsonmessage"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/units"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
const (
tarHeaderSize = 512
)
// CmdBuild builds a new image from the source code at a given path.
//
// If '-' is provided instead of a path or URL, Docker will build an image from either a Dockerfile or tar archive read from STDIN.
//
// Usage: docker build [OPTIONS] PATH | URL | -
func (cli *DockerCli) CmdBuild(args ...string) error {
cmd := cli.Subcmd("build", "PATH | URL | -", "Build a new image from the source code at PATH", true)
tag := cmd.String([]string{"t", "-tag"}, "", "Repository name (and optionally a tag) for the image")
suppressOutput := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the verbose output generated by the containers")
noCache := cmd.Bool([]string{"#no-cache", "-no-cache"}, false, "Do not use cache when building the image")
rm := cmd.Bool([]string{"#rm", "-rm"}, true, "Remove intermediate containers after a successful build")
forceRm := cmd.Bool([]string{"-force-rm"}, false, "Always remove intermediate containers")
pull := cmd.Bool([]string{"-pull"}, false, "Always attempt to pull a newer version of the image")
dockerfileName := cmd.String([]string{"f", "-file"}, "", "Name of the Dockerfile (Default is 'PATH/Dockerfile')")
flMemoryString := cmd.String([]string{"m", "-memory"}, "", "Memory limit")
flMemorySwap := cmd.String([]string{"-memory-swap"}, "", "Total memory (memory + swap), '-1' to disable swap")
flCPUShares := cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
flCpuPeriod := cmd.Int64([]string{"-cpu-period"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) period")
flCpuQuota := cmd.Int64([]string{"-cpu-quota"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) quota")
flCPUSetCpus := cmd.String([]string{"-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")
flCPUSetMems := cmd.String([]string{"-cpuset-mems"}, "", "MEMs in which to allow execution (0-3, 0,1)")
flCgroupParent := cmd.String([]string{"-cgroup-parent"}, "", "Optional parent cgroup for the container")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
var (
context archive.Archive
isRemote bool
err error
)
_, err = exec.LookPath("git")
hasGit := err == nil
if cmd.Arg(0) == "-" {
// As a special case, 'docker build -' will build from either an empty context with the
// contents of stdin as a Dockerfile, or a tar-ed context from stdin.
buf := bufio.NewReader(cli.in)
magic, err := buf.Peek(tarHeaderSize)
if err != nil && err != io.EOF {
return fmt.Errorf("failed to peek context header from STDIN: %v", err)
}
if !archive.IsArchive(magic) {
dockerfile, err := ioutil.ReadAll(buf)
if err != nil {
return fmt.Errorf("failed to read Dockerfile from STDIN: %v", err)
}
// -f option has no meaning when we're reading it from stdin,
// so just use our default Dockerfile name
*dockerfileName = api.DefaultDockerfileName
context, err = archive.Generate(*dockerfileName, string(dockerfile))
} else {
context = ioutil.NopCloser(buf)
}
} else if urlutil.IsURL(cmd.Arg(0)) && (!urlutil.IsGitURL(cmd.Arg(0)) || !hasGit) {
isRemote = true
} else {
root := cmd.Arg(0)
if urlutil.IsGitURL(root) {
root, err = utils.GitClone(root)
if err != nil {
return err
}
defer os.RemoveAll(root)
}
if _, err := os.Stat(root); err != nil {
return err
}
absRoot, err := filepath.Abs(root)
if err != nil {
return err
}
filename := *dockerfileName // path to Dockerfile
if *dockerfileName == "" {
// No -f/--file was specified so use the default
*dockerfileName = api.DefaultDockerfileName
filename = filepath.Join(absRoot, *dockerfileName)
// Just to be nice ;-) look for 'dockerfile' too but only
// use it if we found it, otherwise ignore this check
if _, err = os.Lstat(filename); os.IsNotExist(err) {
tmpFN := path.Join(absRoot, strings.ToLower(*dockerfileName))
if _, err = os.Lstat(tmpFN); err == nil {
*dockerfileName = strings.ToLower(*dockerfileName)
filename = tmpFN
}
}
}
origDockerfile := *dockerfileName // used for error msg
if filename, err = filepath.Abs(filename); err != nil {
return err
}
// Verify that 'filename' is within the build context
filename, err = symlink.FollowSymlinkInScope(filename, absRoot)
if err != nil {
return fmt.Errorf("The Dockerfile (%s) must be within the build context (%s)", origDockerfile, root)
}
// Now reset the dockerfileName to be relative to the build context
*dockerfileName, err = filepath.Rel(absRoot, filename)
if err != nil {
return err
}
// And canonicalize dockerfile name to a platform-independent one
*dockerfileName, err = archive.CanonicalTarNameForPath(*dockerfileName)
if err != nil {
return fmt.Errorf("Cannot canonicalize dockerfile path %s: %v", *dockerfileName, err)
}
if _, err = os.Lstat(filename); os.IsNotExist(err) {
return fmt.Errorf("Cannot locate Dockerfile: %s", origDockerfile)
}
var includes = []string{"."}
excludes, err := utils.ReadDockerIgnore(path.Join(root, ".dockerignore"))
if err != nil {
return err
}
// If .dockerignore mentions .dockerignore or the Dockerfile
// then make sure we send both files over to the daemon
// because Dockerfile is, obviously, needed no matter what, and
// .dockerignore is needed to know if either one needs to be
// removed. The deamon will remove them for us, if needed, after it
// parses the Dockerfile.
keepThem1, _ := fileutils.Matches(".dockerignore", excludes)
keepThem2, _ := fileutils.Matches(*dockerfileName, excludes)
if keepThem1 || keepThem2 {
includes = append(includes, ".dockerignore", *dockerfileName)
}
if err := utils.ValidateContextDirectory(root, excludes); err != nil {
return fmt.Errorf("Error checking context is accessible: '%s'. Please check permissions and try again.", err)
}
options := &archive.TarOptions{
Compression: archive.Uncompressed,
ExcludePatterns: excludes,
IncludeFiles: includes,
}
context, err = archive.TarWithOptions(root, options)
if err != nil {
return err
}
}
// windows: show error message about modified file permissions
// FIXME: this is not a valid warning when the daemon is running windows. should be removed once docker engine for windows can build.
if runtime.GOOS == "windows" {
fmt.Fprintln(cli.err, `SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`)
}
var body io.Reader
// Setup an upload progress bar
// FIXME: ProgressReader shouldn't be this annoying to use
if context != nil {
sf := streamformatter.NewStreamFormatter()
body = progressreader.New(progressreader.Config{
In: context,
Out: cli.out,
Formatter: sf,
NewLines: true,
ID: "",
Action: "Sending build context to Docker daemon",
})
}
var memory int64
if *flMemoryString != "" {
parsedMemory, err := units.RAMInBytes(*flMemoryString)
if err != nil {
return err
}
memory = parsedMemory
}
var memorySwap int64
if *flMemorySwap != "" {
if *flMemorySwap == "-1" {
memorySwap = -1
} else {
parsedMemorySwap, err := units.RAMInBytes(*flMemorySwap)
if err != nil {
return err
}
memorySwap = parsedMemorySwap
}
}
// Send the build context
v := &url.Values{}
//Check if the given image name can be resolved
if *tag != "" {
repository, tag := parsers.ParseRepositoryTag(*tag)
if err := registry.ValidateRepositoryName(repository); err != nil {
return err
}
if len(tag) > 0 {
if err := tags.ValidateTagName(tag); err != nil {
return err
}
}
}
v.Set("t", *tag)
if *suppressOutput {
v.Set("q", "1")
}
if isRemote {
v.Set("remote", cmd.Arg(0))
}
if *noCache {
v.Set("nocache", "1")
}
if *rm {
v.Set("rm", "1")
} else {
v.Set("rm", "0")
}
if *forceRm {
v.Set("forcerm", "1")
}
if *pull {
v.Set("pull", "1")
}
v.Set("cpusetcpus", *flCPUSetCpus)
v.Set("cpusetmems", *flCPUSetMems)
v.Set("cpushares", strconv.FormatInt(*flCPUShares, 10))
v.Set("cpuquota", strconv.FormatInt(*flCpuQuota, 10))
v.Set("cpuperiod", strconv.FormatInt(*flCpuPeriod, 10))
v.Set("memory", strconv.FormatInt(memory, 10))
v.Set("memswap", strconv.FormatInt(memorySwap, 10))
v.Set("cgroupparent", *flCgroupParent)
v.Set("dockerfile", *dockerfileName)
headers := http.Header(make(map[string][]string))
buf, err := json.Marshal(cli.configFile.AuthConfigs)
if err != nil {
return err
}
headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf))
if context != nil {
headers.Set("Content-Type", "application/tar")
}
sopts := &streamOpts{
rawTerminal: true,
in: body,
out: cli.out,
headers: headers,
}
err = cli.stream("POST", fmt.Sprintf("/build?%s", v.Encode()), sopts)
if jerr, ok := err.(*jsonmessage.JSONError); ok {
// If no error code is set, default to 1
if jerr.Code == 0 {
jerr.Code = 1
}
return StatusError{Status: jerr.Message, StatusCode: jerr.Code}
}
return err
}

View File

@@ -6,39 +6,52 @@ import (
"errors"
"fmt"
"io"
"net"
"net/http"
"os"
"path/filepath"
"reflect"
"strings"
"text/template"
"time"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/pkg/homedir"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
// DockerCli represents the docker command line client.
// Instances of the client can be returned from NewDockerCli.
type DockerCli struct {
proto string
addr string
configFile *registry.ConfigFile
in io.ReadCloser
out io.Writer
err io.Writer
keyFile string
tlsConfig *tls.Config
scheme string
// inFd holds file descriptor of the client's STDIN, if it's a valid file
// proto holds the client protocol i.e. unix.
proto string
// addr holds the client address.
addr string
// configFile has the client configuration file
configFile *cliconfig.ConfigFile
// in holds the input stream and closer (io.ReadCloser) for the client.
in io.ReadCloser
// out holds the output stream (io.Writer) for the client.
out io.Writer
// err holds the error stream (io.Writer) for the client.
err io.Writer
// keyFile holds the key file as a string.
keyFile string
// tlsConfig holds the TLS configuration for the client, and will
// set the scheme to https in NewDockerCli if present.
tlsConfig *tls.Config
// scheme holds the scheme of the client i.e. https.
scheme string
// inFd holds the file descriptor of the client's STDIN (if valid).
inFd uintptr
// outFd holds file descriptor of the client's STDOUT, if it's a valid file
// outFd holds file descriptor of the client's STDOUT (if valid).
outFd uintptr
// isTerminalIn describes if client's STDIN is a TTY
// isTerminalIn indicates whether the client's STDIN is a TTY
isTerminalIn bool
// isTerminalOut describes if client's STDOUT is a TTY
// isTerminalOut dindicates whether the client's STDOUT is a TTY
isTerminalOut bool
transport *http.Transport
// transport holds the client transport instance.
transport *http.Transport
}
var funcMap = template.FuncMap{
@@ -48,6 +61,14 @@ var funcMap = template.FuncMap{
},
}
func (cli *DockerCli) Out() io.Writer {
return cli.out
}
func (cli *DockerCli) Err() io.Writer {
return cli.err
}
func (cli *DockerCli) getMethod(args ...string) (func(...string) error, bool) {
camelArgs := make([]string, len(args))
for i, s := range args {
@@ -64,7 +85,7 @@ func (cli *DockerCli) getMethod(args ...string) (func(...string) error, bool) {
return method.Interface().(func(...string) error), true
}
// Cmd executes the specified command
// Cmd executes the specified command.
func (cli *DockerCli) Cmd(args ...string) error {
if len(args) > 1 {
method, exists := cli.getMethod(args[:2]...)
@@ -75,14 +96,18 @@ func (cli *DockerCli) Cmd(args ...string) error {
if len(args) > 0 {
method, exists := cli.getMethod(args[0])
if !exists {
fmt.Fprintf(cli.err, "docker: '%s' is not a docker command. See 'docker --help'.\n", args[0])
os.Exit(1)
return fmt.Errorf("docker: '%s' is not a docker command.\nSee 'docker --help'.", args[0])
}
return method(args[1:]...)
}
return cli.CmdHelp()
}
// Subcmd is a subcommand of the main "docker" command.
// A subcommand represents an action that can be performed
// from the Docker command line client.
//
// To see all available subcommands, run "docker --help".
func (cli *DockerCli) Subcmd(name, signature, description string, exitOnError bool) *flag.FlagSet {
var errorHandling flag.ErrorHandling
if exitOnError {
@@ -91,30 +116,25 @@ func (cli *DockerCli) Subcmd(name, signature, description string, exitOnError bo
errorHandling = flag.ContinueOnError
}
flags := flag.NewFlagSet(name, errorHandling)
if signature != "" {
signature = " " + signature
}
flags.Usage = func() {
flags.ShortUsage()
flags.PrintDefaults()
}
flags.ShortUsage = func() {
options := ""
if signature != "" {
signature = " " + signature
}
if flags.FlagCountUndeprecated() > 0 {
options = " [OPTIONS]"
}
fmt.Fprintf(cli.out, "\nUsage: docker %s%s%s\n\n%s\n\n", name, options, signature, description)
flags.SetOutput(cli.out)
flags.PrintDefaults()
os.Exit(0)
fmt.Fprintf(flags.Out(), "\nUsage: docker %s%s%s\n\n%s\n", name, options, signature, description)
}
return flags
}
func (cli *DockerCli) LoadConfigFile() (err error) {
cli.configFile, err = registry.LoadConfig(homedir.Get())
if err != nil {
fmt.Fprintf(cli.err, "WARNING: %s\n", err)
}
return err
}
// CheckTtyInput checks if we are trying to attach to a container tty
// from a non-tty client input stream, and if so, returns an error.
func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {
// In order to attach to a container tty, input stream for the client must
// be a tty itself: redirecting or piping the client standard input is
@@ -125,6 +145,10 @@ func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {
return nil
}
// NewDockerCli returns a DockerCli instance with IO output and error streams set by in, out and err.
// The key file, protocol (i.e. unix) and address are passed in as strings, along with the tls.Config. If the tls.Config
// is set the client scheme will be set to https.
// The client will be given a 32-second timeout (see https://github.com/docker/docker/pull/8035).
func NewDockerCli(in io.ReadCloser, out, err io.Writer, keyFile string, proto, addr string, tlsConfig *tls.Config) *DockerCli {
var (
inFd uintptr
@@ -149,27 +173,21 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, keyFile string, proto, a
err = out
}
// The transport is created here for reuse during the client session
// The transport is created here for reuse during the client session.
tr := &http.Transport{
TLSClientConfig: tlsConfig,
}
utils.ConfigureTCPTransport(tr, proto, addr)
// Why 32? See issue 8035
timeout := 32 * time.Second
if proto == "unix" {
// no need in compressing for local communications
tr.DisableCompression = true
tr.Dial = func(_, _ string) (net.Conn, error) {
return net.DialTimeout(proto, addr, timeout)
}
} else {
tr.Proxy = http.ProxyFromEnvironment
tr.Dial = (&net.Dialer{Timeout: timeout}).Dial
configFile, e := cliconfig.Load(filepath.Join(homedir.Get(), ".docker"))
if e != nil {
fmt.Fprintf(err, "WARNING: Error loading config file:%v\n", e)
}
return &DockerCli{
proto: proto,
addr: addr,
configFile: configFile,
in: in,
out: out,
err: err,

17
api/client/client.go Normal file
View File

@@ -0,0 +1,17 @@
// Package client provides a command-line interface for Docker.
//
// Run "docker help SUBCOMMAND" or "docker SUBCOMMAND --help" to see more information on any Docker subcommand, including the full list of options supported for the subcommand.
// See https://docs.docker.com/installation/ for instructions on installing Docker.
package client
import "fmt"
// An StatusError reports an unsuccessful exit by a command.
type StatusError struct {
Status string
StatusCode int
}
func (e StatusError) Error() string {
return fmt.Sprintf("Status: %s, Code: %d", e.Status, e.StatusCode)
}

File diff suppressed because it is too large Load Diff

80
api/client/commit.go Normal file
View File

@@ -0,0 +1,80 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"github.com/docker/docker/api/types"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
)
// CmdCommit creates a new image from a container's changes.
//
// Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
func (cli *DockerCli) CmdCommit(args ...string) error {
cmd := cli.Subcmd("commit", "CONTAINER [REPOSITORY[:TAG]]", "Create a new image from a container's changes", true)
flPause := cmd.Bool([]string{"p", "-pause"}, true, "Pause container during commit")
flComment := cmd.String([]string{"m", "-message"}, "", "Commit message")
flAuthor := cmd.String([]string{"a", "#author", "-author"}, "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply Dockerfile instruction to the created image")
// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.
flConfig := cmd.String([]string{"#run", "#-run"}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
cmd.Require(flag.Max, 2)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var (
name = cmd.Arg(0)
repository, tag = parsers.ParseRepositoryTag(cmd.Arg(1))
)
//Check if the given image name can be resolved
if repository != "" {
if err := registry.ValidateRepositoryName(repository); err != nil {
return err
}
}
v := url.Values{}
v.Set("container", name)
v.Set("repo", repository)
v.Set("tag", tag)
v.Set("comment", *flComment)
v.Set("author", *flAuthor)
for _, change := range flChanges.GetAll() {
v.Add("changes", change)
}
if *flPause != true {
v.Set("pause", "0")
}
var (
config *runconfig.Config
response types.ContainerCommitResponse
)
if *flConfig != "" {
config = &runconfig.Config{}
if err := json.Unmarshal([]byte(*flConfig), config); err != nil {
return err
}
}
stream, _, err := cli.call("POST", "/commit?"+v.Encode(), config, nil)
if err != nil {
return err
}
if err := json.NewDecoder(stream).Decode(&response); err != nil {
return err
}
fmt.Fprintln(cli.out, response.ID)
return nil
}

57
api/client/cp.go Normal file
View File

@@ -0,0 +1,57 @@
package client
import (
"fmt"
"io"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/archive"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdCp copies files/folders from a path on the container to a directory on the host running the command.
//
// If HOSTDIR is '-', the data is written as a tar file to STDOUT.
//
// Usage: docker cp CONTAINER:PATH HOSTDIR
func (cli *DockerCli) CmdCp(args ...string) error {
cmd := cli.Subcmd("cp", "CONTAINER:PATH HOSTDIR|-", "Copy files/folders from a PATH on the container to a HOSTDIR on the host\nrunning the command. Use '-' to write the data as a tar file to STDOUT.", true)
cmd.Require(flag.Exact, 2)
cmd.ParseFlags(args, true)
// deal with path name with `:`
info := strings.SplitN(cmd.Arg(0), ":", 2)
if len(info) != 2 {
return fmt.Errorf("Error: Path not specified")
}
cfg := &types.CopyConfig{
Resource: info[1],
}
stream, statusCode, err := cli.call("POST", "/containers/"+info[0]+"/copy", cfg, nil)
if stream != nil {
defer stream.Close()
}
if statusCode == 404 {
return fmt.Errorf("No such container: %v", info[0])
}
if err != nil {
return err
}
hostPath := cmd.Arg(1)
if statusCode == 200 {
if hostPath == "-" {
_, err = io.Copy(cli.out, stream)
} else {
err = archive.Untar(stream, hostPath, &archive.TarOptions{NoLchown: true})
}
if err != nil {
return err
}
}
return nil
}

160
api/client/create.go Normal file
View File

@@ -0,0 +1,160 @@
package client
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/url"
"os"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/graph/tags"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
func (cli *DockerCli) pullImage(image string) error {
return cli.pullImageCustomOut(image, cli.out)
}
func (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {
v := url.Values{}
repos, tag := parsers.ParseRepositoryTag(image)
// pull only the image tagged 'latest' if no tag was specified
if tag == "" {
tag = tags.DEFAULTTAG
}
v.Set("fromImage", repos)
v.Set("tag", tag)
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(repos)
if err != nil {
return err
}
// Resolve the Auth config relevant for this server
authConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)
buf, err := json.Marshal(authConfig)
if err != nil {
return err
}
registryAuthHeader := []string{
base64.URLEncoding.EncodeToString(buf),
}
sopts := &streamOpts{
rawTerminal: true,
out: out,
headers: map[string][]string{"X-Registry-Auth": registryAuthHeader},
}
if err := cli.stream("POST", "/images/create?"+v.Encode(), sopts); err != nil {
return err
}
return nil
}
type cidFile struct {
path string
file *os.File
written bool
}
func newCIDFile(path string) (*cidFile, error) {
if _, err := os.Stat(path); err == nil {
return nil, fmt.Errorf("Container ID file found, make sure the other container isn't running or delete %s", path)
}
f, err := os.Create(path)
if err != nil {
return nil, fmt.Errorf("Failed to create the container ID file: %s", err)
}
return &cidFile{path: path, file: f}, nil
}
func (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runconfig.HostConfig, cidfile, name string) (*types.ContainerCreateResponse, error) {
containerValues := url.Values{}
if name != "" {
containerValues.Set("name", name)
}
mergedConfig := runconfig.MergeConfigs(config, hostConfig)
var containerIDFile *cidFile
if cidfile != "" {
var err error
if containerIDFile, err = newCIDFile(cidfile); err != nil {
return nil, err
}
defer containerIDFile.Close()
}
//create the container
stream, statusCode, err := cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil)
//if image not found try to pull it
if statusCode == 404 && strings.Contains(err.Error(), config.Image) {
repo, tag := parsers.ParseRepositoryTag(config.Image)
if tag == "" {
tag = tags.DEFAULTTAG
}
fmt.Fprintf(cli.err, "Unable to find image '%s' locally\n", utils.ImageReference(repo, tag))
// we don't want to write to stdout anything apart from container.ID
if err = cli.pullImageCustomOut(config.Image, cli.err); err != nil {
return nil, err
}
// Retry
if stream, _, err = cli.call("POST", "/containers/create?"+containerValues.Encode(), mergedConfig, nil); err != nil {
return nil, err
}
} else if err != nil {
return nil, err
}
var response types.ContainerCreateResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
return nil, err
}
for _, warning := range response.Warnings {
fmt.Fprintf(cli.err, "WARNING: %s\n", warning)
}
if containerIDFile != nil {
if err = containerIDFile.Write(response.ID); err != nil {
return nil, err
}
}
return &response, nil
}
// CmdCreate creates a new container from a given image.
//
// Usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...]
func (cli *DockerCli) CmdCreate(args ...string) error {
cmd := cli.Subcmd("create", "IMAGE [COMMAND] [ARG...]", "Create a new container", true)
// These are flags not stored in Config/HostConfig
var (
flName = cmd.String([]string{"-name"}, "", "Assign a name to the container")
)
config, hostConfig, cmd, err := runconfig.Parse(cmd, args)
if err != nil {
cmd.ReportError(err.Error(), true)
os.Exit(1)
}
if config.Image == "" {
cmd.Usage()
return nil
}
response, err := cli.createContainer(config, hostConfig, hostConfig.ContainerIDFile, *flName)
if err != nil {
return err
}
fmt.Fprintf(cli.out, "%s\n", response.ID)
return nil
}

52
api/client/diff.go Normal file
View File

@@ -0,0 +1,52 @@
package client
import (
"encoding/json"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/archive"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdDiff shows changes on a container's filesystem.
//
// Each changed file is printed on a separate line, prefixed with a single
// character that indicates the status of the file: C (modified), A (added),
// or D (deleted).
//
// Usage: docker diff CONTAINER
func (cli *DockerCli) CmdDiff(args ...string) error {
cmd := cli.Subcmd("diff", "CONTAINER", "Inspect changes on a container's filesystem", true)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
if cmd.Arg(0) == "" {
return fmt.Errorf("Container name cannot be empty")
}
rdr, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/changes", nil, nil)
if err != nil {
return err
}
changes := []types.ContainerChange{}
if err := json.NewDecoder(rdr).Decode(&changes); err != nil {
return err
}
for _, change := range changes {
var kind string
switch change.Kind {
case archive.ChangeModify:
kind = "C"
case archive.ChangeAdd:
kind = "A"
case archive.ChangeDelete:
kind = "D"
}
fmt.Fprintf(cli.out, "%s %s\n", kind, change.Path)
}
return nil
}

60
api/client/events.go Normal file
View File

@@ -0,0 +1,60 @@
package client
import (
"net/url"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/timeutils"
)
// CmdEvents prints a live stream of real time events from the server.
//
// Usage: docker events [OPTIONS]
func (cli *DockerCli) CmdEvents(args ...string) error {
cmd := cli.Subcmd("events", "", "Get real time events from the server", true)
since := cmd.String([]string{"#since", "-since"}, "", "Show all events created since timestamp")
until := cmd.String([]string{"-until"}, "", "Stream events until this timestamp")
flFilter := opts.NewListOpts(nil)
cmd.Var(&flFilter, []string{"f", "-filter"}, "Filter output based on conditions provided")
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
var (
v = url.Values{}
eventFilterArgs = filters.Args{}
)
// Consolidate all filter flags, and sanity check them early.
// They'll get process in the daemon/server.
for _, f := range flFilter.GetAll() {
var err error
eventFilterArgs, err = filters.ParseFlag(f, eventFilterArgs)
if err != nil {
return err
}
}
if *since != "" {
v.Set("since", timeutils.GetTimestamp(*since))
}
if *until != "" {
v.Set("until", timeutils.GetTimestamp(*until))
}
if len(eventFilterArgs) > 0 {
filterJSON, err := filters.ToParam(eventFilterArgs)
if err != nil {
return err
}
v.Set("filters", filterJSON)
}
sopts := &streamOpts{
rawTerminal: true,
out: cli.out,
}
if err := cli.stream("GET", "/events?"+v.Encode(), sopts); err != nil {
return err
}
return nil
}

131
api/client/exec.go Normal file
View File

@@ -0,0 +1,131 @@
package client
import (
"encoding/json"
"fmt"
"io"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/runconfig"
)
// CmdExec runs a command in a running container.
//
// Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
func (cli *DockerCli) CmdExec(args ...string) error {
cmd := cli.Subcmd("exec", "CONTAINER COMMAND [ARG...]", "Run a command in a running container", true)
execConfig, err := runconfig.ParseExec(cmd, args)
// just in case the ParseExec does not exit
if execConfig.Container == "" || err != nil {
return StatusError{StatusCode: 1}
}
stream, _, err := cli.call("POST", "/containers/"+execConfig.Container+"/exec", execConfig, nil)
if err != nil {
return err
}
var response types.ContainerExecCreateResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
return err
}
execID := response.ID
if execID == "" {
fmt.Fprintf(cli.out, "exec ID empty")
return nil
}
//Temp struct for execStart so that we don't need to transfer all the execConfig
execStartCheck := &types.ExecStartCheck{
Detach: execConfig.Detach,
Tty: execConfig.Tty,
}
if !execConfig.Detach {
if err := cli.CheckTtyInput(execConfig.AttachStdin, execConfig.Tty); err != nil {
return err
}
} else {
if _, _, err := readBody(cli.call("POST", "/exec/"+execID+"/start", execStartCheck, nil)); err != nil {
return err
}
// For now don't print this - wait for when we support exec wait()
// fmt.Fprintf(cli.out, "%s\n", execID)
return nil
}
// Interactive exec requested.
var (
out, stderr io.Writer
in io.ReadCloser
hijacked = make(chan io.Closer)
errCh chan error
)
// Block the return until the chan gets closed
defer func() {
logrus.Debugf("End of CmdExec(), Waiting for hijack to finish.")
if _, ok := <-hijacked; ok {
fmt.Fprintln(cli.err, "Hijack did not finish (chan still open)")
}
}()
if execConfig.AttachStdin {
in = cli.in
}
if execConfig.AttachStdout {
out = cli.out
}
if execConfig.AttachStderr {
if execConfig.Tty {
stderr = cli.out
} else {
stderr = cli.err
}
}
errCh = promise.Go(func() error {
return cli.hijack("POST", "/exec/"+execID+"/start", execConfig.Tty, in, out, stderr, hijacked, execConfig)
})
// Acknowledge the hijack before starting
select {
case closer := <-hijacked:
// Make sure that hijack gets closed when returning. (result
// in closing hijack chan and freeing server's goroutines.
if closer != nil {
defer closer.Close()
}
case err := <-errCh:
if err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
}
if execConfig.Tty && cli.isTerminalIn {
if err := cli.monitorTtySize(execID, true); err != nil {
fmt.Fprintf(cli.err, "Error monitoring TTY size: %s\n", err)
}
}
if err := <-errCh; err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
var status int
if _, status, err = getExecExitCode(cli, execID); err != nil {
return err
}
if status != 0 {
return StatusError{StatusCode: status}
}
return nil
}

46
api/client/export.go Normal file
View File

@@ -0,0 +1,46 @@
package client
import (
"errors"
"io"
"os"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdExport exports a filesystem as a tar archive.
//
// The tar archive is streamed to STDOUT by default or written to a file.
//
// Usage: docker export [OPTIONS] CONTAINER
func (cli *DockerCli) CmdExport(args ...string) error {
cmd := cli.Subcmd("export", "CONTAINER", "Export a filesystem as a tar archive (streamed to STDOUT by default)", true)
outfile := cmd.String([]string{"o", "-output"}, "", "Write to a file, instead of STDOUT")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
var (
output io.Writer = cli.out
err error
)
if *outfile != "" {
output, err = os.Create(*outfile)
if err != nil {
return err
}
} else if cli.isTerminalOut {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
}
image := cmd.Arg(0)
sopts := &streamOpts{
rawTerminal: true,
out: output,
}
if err := cli.stream("GET", "/containers/"+image+"/export", sopts); err != nil {
return err
}
return nil
}

34
api/client/help.go Normal file
View File

@@ -0,0 +1,34 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdHelp displays information on a Docker command.
//
// If more than one command is specified, information is only shown for the first command.
//
// Usage: docker help COMMAND or docker COMMAND --help
func (cli *DockerCli) CmdHelp(args ...string) error {
if len(args) > 1 {
method, exists := cli.getMethod(args[:2]...)
if exists {
method("--help")
return nil
}
}
if len(args) > 0 {
method, exists := cli.getMethod(args[0])
if !exists {
return fmt.Errorf("docker: '%s' is not a docker command. See 'docker --help'.", args[0])
}
method("--help")
return nil
}
flag.Usage()
return nil
}

View File

@@ -13,7 +13,7 @@ import (
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github.com/docker/docker/autogen/dockerversion"
"github.com/docker/docker/pkg/promise"
@@ -142,6 +142,13 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
if err != nil {
return err
}
// Add CLI Config's HTTP Headers BEFORE we set the Docker headers
// then the user can't change OUR headers
for k, v := range cli.configFile.HttpHeaders {
req.Header.Set(k, v)
}
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION)
req.Header.Set("Content-Type", "text/plain")
req.Header.Set("Connection", "Upgrade")
@@ -211,7 +218,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
} else {
_, err = stdcopy.StdCopy(stdout, stderr, br)
}
log.Debugf("[hijack] End of stdout")
logrus.Debugf("[hijack] End of stdout")
return err
})
}
@@ -219,14 +226,14 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
sendStdin := promise.Go(func() error {
if in != nil {
io.Copy(rwc, in)
log.Debugf("[hijack] End of stdin")
logrus.Debugf("[hijack] End of stdin")
}
if conn, ok := rwc.(interface {
CloseWrite() error
}); ok {
if err := conn.CloseWrite(); err != nil {
log.Debugf("Couldn't send EOF: %s", err)
logrus.Debugf("Couldn't send EOF: %s", err)
}
}
// Discard errors due to pipe interruption
@@ -235,14 +242,14 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea
if stdout != nil || stderr != nil {
if err := <-receiveStdout; err != nil {
log.Debugf("Error receiveStdout: %s", err)
logrus.Debugf("Error receiveStdout: %s", err)
return err
}
}
if !cli.isTerminalIn {
if err := <-sendStdin; err != nil {
log.Debugf("Error sendStdin: %s", err)
logrus.Debugf("Error sendStdin: %s", err)
return err
}
}

73
api/client/history.go Normal file
View File

@@ -0,0 +1,73 @@
package client
import (
"encoding/json"
"fmt"
"text/tabwriter"
"time"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/pkg/units"
)
// CmdHistory shows the history of an image.
//
// Usage: docker history [OPTIONS] IMAGE
func (cli *DockerCli) CmdHistory(args ...string) error {
cmd := cli.Subcmd("history", "IMAGE", "Show the history of an image", true)
human := cmd.Bool([]string{"H", "-human"}, true, "Print sizes and dates in human readable format")
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
rdr, _, err := cli.call("GET", "/images/"+cmd.Arg(0)+"/history", nil, nil)
if err != nil {
return err
}
history := []types.ImageHistory{}
if err := json.NewDecoder(rdr).Decode(&history); err != nil {
return err
}
w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
if !*quiet {
fmt.Fprintln(w, "IMAGE\tCREATED\tCREATED BY\tSIZE\tCOMMENT")
}
for _, entry := range history {
if *noTrunc {
fmt.Fprintf(w, entry.ID)
} else {
fmt.Fprintf(w, stringid.TruncateID(entry.ID))
}
if !*quiet {
if *human {
fmt.Fprintf(w, "\t%s ago\t", units.HumanDuration(time.Now().UTC().Sub(time.Unix(entry.Created, 0))))
} else {
fmt.Fprintf(w, "\t%s\t", time.Unix(entry.Created, 0).Format(time.RFC3339))
}
if *noTrunc {
fmt.Fprintf(w, "%s\t", entry.CreatedBy)
} else {
fmt.Fprintf(w, "%s\t", stringutils.Truncate(entry.CreatedBy, 45))
}
if *human {
fmt.Fprintf(w, "%s\t", units.HumanSize(float64(entry.Size)))
} else {
fmt.Fprintf(w, "%d\t", entry.Size)
}
fmt.Fprintf(w, "%s", entry.Comment)
}
fmt.Fprintf(w, "\n")
}
w.Flush()
return nil
}

126
api/client/images.go Normal file
View File

@@ -0,0 +1,126 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"text/tabwriter"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/units"
"github.com/docker/docker/utils"
)
// CmdImages lists the images in a specified repository, or all top-level images if no repository is specified.
//
// Usage: docker images [OPTIONS] [REPOSITORY]
func (cli *DockerCli) CmdImages(args ...string) error {
cmd := cli.Subcmd("images", "[REPOSITORY]", "List images", true)
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only show numeric IDs")
all := cmd.Bool([]string{"a", "-all"}, false, "Show all images (default hides intermediate images)")
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
showDigests := cmd.Bool([]string{"-digests"}, false, "Show digests")
flFilter := opts.NewListOpts(nil)
cmd.Var(&flFilter, []string{"f", "-filter"}, "Filter output based on conditions provided")
cmd.Require(flag.Max, 1)
cmd.ParseFlags(args, true)
// Consolidate all filter flags, and sanity check them early.
// They'll get process in the daemon/server.
imageFilterArgs := filters.Args{}
for _, f := range flFilter.GetAll() {
var err error
imageFilterArgs, err = filters.ParseFlag(f, imageFilterArgs)
if err != nil {
return err
}
}
matchName := cmd.Arg(0)
v := url.Values{}
if len(imageFilterArgs) > 0 {
filterJSON, err := filters.ToParam(imageFilterArgs)
if err != nil {
return err
}
v.Set("filters", filterJSON)
}
if cmd.NArg() == 1 {
// FIXME rename this parameter, to not be confused with the filters flag
v.Set("filter", matchName)
}
if *all {
v.Set("all", "1")
}
rdr, _, err := cli.call("GET", "/images/json?"+v.Encode(), nil, nil)
if err != nil {
return err
}
images := []types.Image{}
if err := json.NewDecoder(rdr).Decode(&images); err != nil {
return err
}
w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
if !*quiet {
if *showDigests {
fmt.Fprintln(w, "REPOSITORY\tTAG\tDIGEST\tIMAGE ID\tCREATED\tVIRTUAL SIZE")
} else {
fmt.Fprintln(w, "REPOSITORY\tTAG\tIMAGE ID\tCREATED\tVIRTUAL SIZE")
}
}
for _, image := range images {
ID := image.ID
if !*noTrunc {
ID = stringid.TruncateID(ID)
}
repoTags := image.RepoTags
repoDigests := image.RepoDigests
if len(repoTags) == 1 && repoTags[0] == "<none>:<none>" && len(repoDigests) == 1 && repoDigests[0] == "<none>@<none>" {
// dangling image - clear out either repoTags or repoDigsts so we only show it once below
repoDigests = []string{}
}
// combine the tags and digests lists
tagsAndDigests := append(repoTags, repoDigests...)
for _, repoAndRef := range tagsAndDigests {
repo, ref := parsers.ParseRepositoryTag(repoAndRef)
// default tag and digest to none - if there's a value, it'll be set below
tag := "<none>"
digest := "<none>"
if utils.DigestReference(ref) {
digest = ref
} else {
tag = ref
}
if !*quiet {
if *showDigests {
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s ago\t%s\n", repo, tag, digest, ID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(image.Created), 0))), units.HumanSize(float64(image.VirtualSize)))
} else {
fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\n", repo, tag, ID, units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(image.Created), 0))), units.HumanSize(float64(image.VirtualSize)))
}
} else {
fmt.Fprintln(w, ID)
}
}
}
if !*quiet {
w.Flush()
}
return nil
}

64
api/client/import.go Normal file
View File

@@ -0,0 +1,64 @@
package client
import (
"fmt"
"io"
"net/url"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
)
// CmdImport creates an empty filesystem image, imports the contents of the tarball into the image, and optionally tags the image.
//
// The URL argument is the address of a tarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) file. If the URL is '-', then the tar file is read from STDIN.
//
// Usage: docker import [OPTIONS] URL [REPOSITORY[:TAG]]
func (cli *DockerCli) CmdImport(args ...string) error {
cmd := cli.Subcmd("import", "URL|- [REPOSITORY[:TAG]]", "Create an empty filesystem image and import the contents of the\ntarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then\noptionally tag it.", true)
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply Dockerfile instruction to the created image")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var (
v = url.Values{}
src = cmd.Arg(0)
repository = cmd.Arg(1)
)
v.Set("fromSrc", src)
v.Set("repo", repository)
for _, change := range flChanges.GetAll() {
v.Add("changes", change)
}
if cmd.NArg() == 3 {
fmt.Fprintf(cli.err, "[DEPRECATED] The format 'URL|- [REPOSITORY [TAG]]' has been deprecated. Please use URL|- [REPOSITORY[:TAG]]\n")
v.Set("tag", cmd.Arg(2))
}
if repository != "" {
//Check if the given image name can be resolved
repo, _ := parsers.ParseRepositoryTag(repository)
if err := registry.ValidateRepositoryName(repo); err != nil {
return err
}
}
var in io.Reader
if src == "-" {
in = cli.in
}
sopts := &streamOpts{
rawTerminal: true,
in: in,
out: cli.out,
}
return cli.stream("POST", "/images/create?"+v.Encode(), sopts)
}

91
api/client/info.go Normal file
View File

@@ -0,0 +1,91 @@
package client
import (
"encoding/json"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/ioutils"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/units"
)
// CmdInfo displays system-wide information.
//
// Usage: docker info
func (cli *DockerCli) CmdInfo(args ...string) error {
cmd := cli.Subcmd("info", "", "Display system-wide information", true)
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
rdr, _, err := cli.call("GET", "/info", nil, nil)
if err != nil {
return err
}
info := &types.Info{}
if err := json.NewDecoder(rdr).Decode(info); err != nil {
return fmt.Errorf("Error reading remote info: %v", err)
}
fmt.Fprintf(cli.out, "Containers: %d\n", info.Containers)
fmt.Fprintf(cli.out, "Images: %d\n", info.Images)
ioutils.FprintfIfNotEmpty(cli.out, "Storage Driver: %s\n", info.Driver)
if info.DriverStatus != nil {
for _, pair := range info.DriverStatus {
fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1])
}
}
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
ioutils.FprintfIfNotEmpty(cli.out, "ID: %s\n", info.ID)
if info.Debug {
fmt.Fprintf(cli.out, "Debug mode (server): %v\n", info.Debug)
fmt.Fprintf(cli.out, "File Descriptors: %d\n", info.NFd)
fmt.Fprintf(cli.out, "Goroutines: %d\n", info.NGoroutines)
fmt.Fprintf(cli.out, "System Time: %s\n", info.SystemTime)
fmt.Fprintf(cli.out, "EventsListeners: %d\n", info.NEventsListener)
fmt.Fprintf(cli.out, "Init SHA1: %s\n", info.InitSha1)
fmt.Fprintf(cli.out, "Init Path: %s\n", info.InitPath)
fmt.Fprintf(cli.out, "Docker Root Dir: %s\n", info.DockerRootDir)
}
ioutils.FprintfIfNotEmpty(cli.out, "Http Proxy: %s\n", info.HttpProxy)
ioutils.FprintfIfNotEmpty(cli.out, "Https Proxy: %s\n", info.HttpsProxy)
ioutils.FprintfIfNotEmpty(cli.out, "No Proxy: %s\n", info.NoProxy)
if info.IndexServerAddress != "" {
u := cli.configFile.AuthConfigs[info.IndexServerAddress].Username
if len(u) > 0 {
fmt.Fprintf(cli.out, "Username: %v\n", u)
fmt.Fprintf(cli.out, "Registry: %v\n", info.IndexServerAddress)
}
}
if !info.MemoryLimit {
fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
}
if !info.SwapLimit {
fmt.Fprintf(cli.err, "WARNING: No swap limit support\n")
}
if !info.IPv4Forwarding {
fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled.\n")
}
if info.Labels != nil {
fmt.Fprintln(cli.out, "Labels:")
for _, attribute := range info.Labels {
fmt.Fprintf(cli.out, " %s\n", attribute)
}
}
if info.ExperimentalBuild {
fmt.Fprintf(cli.out, "Experimental: true\n")
}
return nil
}

121
api/client/inspect.go Normal file
View File

@@ -0,0 +1,121 @@
package client
import (
"bytes"
"encoding/json"
"fmt"
"io"
"strings"
"text/template"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdInspect displays low-level information on one or more containers or images.
//
// Usage: docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...]
func (cli *DockerCli) CmdInspect(args ...string) error {
cmd := cli.Subcmd("inspect", "CONTAINER|IMAGE [CONTAINER|IMAGE...]", "Return low-level information on a container or image", true)
tmplStr := cmd.String([]string{"f", "#format", "-format"}, "", "Format the output using the given go template")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var tmpl *template.Template
if *tmplStr != "" {
var err error
if tmpl, err = template.New("").Funcs(funcMap).Parse(*tmplStr); err != nil {
return StatusError{StatusCode: 64,
Status: "Template parsing error: " + err.Error()}
}
}
indented := new(bytes.Buffer)
indented.WriteString("[\n")
status := 0
isImage := false
for _, name := range cmd.Args() {
obj, _, err := readBody(cli.call("GET", "/containers/"+name+"/json", nil, nil))
if err != nil {
obj, _, err = readBody(cli.call("GET", "/images/"+name+"/json", nil, nil))
isImage = true
if err != nil {
if strings.Contains(err.Error(), "No such") {
fmt.Fprintf(cli.err, "Error: No such image or container: %s\n", name)
} else {
fmt.Fprintf(cli.err, "%s", err)
}
status = 1
continue
}
}
if tmpl == nil {
if err = json.Indent(indented, obj, "", " "); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
status = 1
continue
}
} else {
rdr := bytes.NewReader(obj)
dec := json.NewDecoder(rdr)
if isImage {
inspPtr := types.ImageInspect{}
if err := dec.Decode(&inspPtr); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
status = 1
continue
}
if err := tmpl.Execute(cli.out, inspPtr); err != nil {
rdr.Seek(0, 0)
var raw interface{}
if err := dec.Decode(&raw); err != nil {
return err
}
if err = tmpl.Execute(cli.out, raw); err != nil {
return err
}
}
} else {
inspPtr := types.ContainerJSON{}
if err := dec.Decode(&inspPtr); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
status = 1
continue
}
if err := tmpl.Execute(cli.out, inspPtr); err != nil {
rdr.Seek(0, 0)
var raw interface{}
if err := dec.Decode(&raw); err != nil {
return err
}
if err = tmpl.Execute(cli.out, raw); err != nil {
return err
}
}
}
cli.out.Write([]byte{'\n'})
}
indented.WriteString(",")
}
if indented.Len() > 1 {
// Remove trailing ','
indented.Truncate(indented.Len() - 1)
}
indented.WriteString("]\n")
if tmpl == nil {
if _, err := io.Copy(cli.out, indented); err != nil {
return err
}
}
if status != 0 {
return StatusError{StatusCode: status}
}
return nil
}

32
api/client/kill.go Normal file
View File

@@ -0,0 +1,32 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdKill kills one or more running container using SIGKILL or a specified signal.
//
// Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdKill(args ...string) error {
cmd := cli.Subcmd("kill", "CONTAINER [CONTAINER...]", "Kill a running container using SIGKILL or a specified signal", true)
signal := cmd.String([]string{"s", "-signal"}, "KILL", "Signal to send to the container")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/kill?signal=%s", name, *signal), nil, nil)); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to kill containers: %v", errNames)
}
return nil
}

41
api/client/load.go Normal file
View File

@@ -0,0 +1,41 @@
package client
import (
"io"
"os"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdLoad loads an image from a tar archive.
//
// The tar archive is read from STDIN by default, or from a tar archive file.
//
// Usage: docker load [OPTIONS]
func (cli *DockerCli) CmdLoad(args ...string) error {
cmd := cli.Subcmd("load", "", "Load an image from a tar archive on STDIN", true)
infile := cmd.String([]string{"i", "-input"}, "", "Read from a tar archive file, instead of STDIN")
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
var (
input io.Reader = cli.in
err error
)
if *infile != "" {
input, err = os.Open(*infile)
if err != nil {
return err
}
}
sopts := &streamOpts{
rawTerminal: true,
in: input,
out: cli.out,
}
if err := cli.stream("POST", "/images/load", sopts); err != nil {
return err
}
return nil
}

144
api/client/login.go Normal file
View File

@@ -0,0 +1,144 @@
package client
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/cliconfig"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/registry"
)
// CmdLogin logs in or registers a user to a Docker registry service.
//
// If no server is specified, the user will be logged into or registered to the registry's index server.
//
// Usage: docker login SERVER
func (cli *DockerCli) CmdLogin(args ...string) error {
cmd := cli.Subcmd("login", "[SERVER]", "Register or log in to a Docker registry server, if no server is\nspecified \""+registry.IndexServerAddress()+"\" is the default.", true)
cmd.Require(flag.Max, 1)
var username, password, email string
cmd.StringVar(&username, []string{"u", "-username"}, "", "Username")
cmd.StringVar(&password, []string{"p", "-password"}, "", "Password")
cmd.StringVar(&email, []string{"e", "-email"}, "", "Email")
cmd.ParseFlags(args, true)
serverAddress := registry.IndexServerAddress()
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
}
promptDefault := func(prompt string, configDefault string) {
if configDefault == "" {
fmt.Fprintf(cli.out, "%s: ", prompt)
} else {
fmt.Fprintf(cli.out, "%s (%s): ", prompt, configDefault)
}
}
readInput := func(in io.Reader, out io.Writer) string {
reader := bufio.NewReader(in)
line, _, err := reader.ReadLine()
if err != nil {
fmt.Fprintln(out, err.Error())
os.Exit(1)
}
return string(line)
}
authconfig, ok := cli.configFile.AuthConfigs[serverAddress]
if !ok {
authconfig = cliconfig.AuthConfig{}
}
if username == "" {
promptDefault("Username", authconfig.Username)
username = readInput(cli.in, cli.out)
username = strings.Trim(username, " ")
if username == "" {
username = authconfig.Username
}
}
// Assume that a different username means they may not want to use
// the password or email from the config file, so prompt them
if username != authconfig.Username {
if password == "" {
oldState, err := term.SaveState(cli.inFd)
if err != nil {
return err
}
fmt.Fprintf(cli.out, "Password: ")
term.DisableEcho(cli.inFd, oldState)
password = readInput(cli.in, cli.out)
fmt.Fprint(cli.out, "\n")
term.RestoreTerminal(cli.inFd, oldState)
if password == "" {
return fmt.Errorf("Error : Password Required")
}
}
if email == "" {
promptDefault("Email", authconfig.Email)
email = readInput(cli.in, cli.out)
if email == "" {
email = authconfig.Email
}
}
} else {
// However, if they don't override the username use the
// password or email from the cmd line if specified. IOW, allow
// then to change/override them. And if not specified, just
// use what's in the config file
if password == "" {
password = authconfig.Password
}
if email == "" {
email = authconfig.Email
}
}
authconfig.Username = username
authconfig.Password = password
authconfig.Email = email
authconfig.ServerAddress = serverAddress
cli.configFile.AuthConfigs[serverAddress] = authconfig
stream, statusCode, err := cli.call("POST", "/auth", cli.configFile.AuthConfigs[serverAddress], nil)
if statusCode == 401 {
delete(cli.configFile.AuthConfigs, serverAddress)
if err2 := cli.configFile.Save(); err2 != nil {
fmt.Fprintf(cli.out, "WARNING: could not save config file: %v\n", err2)
}
return err
}
if err != nil {
return err
}
var response types.AuthResponse
if err := json.NewDecoder(stream).Decode(&response); err != nil {
// Upon error, remove entry
delete(cli.configFile.AuthConfigs, serverAddress)
return err
}
if err := cli.configFile.Save(); err != nil {
return fmt.Errorf("Error saving config file: %v", err)
}
fmt.Fprintf(cli.out, "WARNING: login credentials saved in %s\n", cli.configFile.Filename())
if response.Status != "" {
fmt.Fprintf(cli.out, "%s\n", response.Status)
}
return nil
}

36
api/client/logout.go Normal file
View File

@@ -0,0 +1,36 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/registry"
)
// CmdLogout logs a user out from a Docker registry.
//
// If no server is specified, the user will be logged out from the registry's index server.
//
// Usage: docker logout [SERVER]
func (cli *DockerCli) CmdLogout(args ...string) error {
cmd := cli.Subcmd("logout", "[SERVER]", "Log out from a Docker registry, if no server is\nspecified \""+registry.IndexServerAddress()+"\" is the default.", true)
cmd.Require(flag.Max, 1)
cmd.ParseFlags(args, true)
serverAddress := registry.IndexServerAddress()
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
}
if _, ok := cli.configFile.AuthConfigs[serverAddress]; !ok {
fmt.Fprintf(cli.out, "Not logged in to %s\n", serverAddress)
} else {
fmt.Fprintf(cli.out, "Remove login credentials for %s\n", serverAddress)
delete(cli.configFile.AuthConfigs, serverAddress)
if err := cli.configFile.Save(); err != nil {
return fmt.Errorf("Failed to save docker config: %v", err)
}
}
return nil
}

68
api/client/logs.go Normal file
View File

@@ -0,0 +1,68 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/timeutils"
)
// CmdLogs fetches the logs of a given container.
//
// docker logs [OPTIONS] CONTAINER
func (cli *DockerCli) CmdLogs(args ...string) error {
var (
cmd = cli.Subcmd("logs", "CONTAINER", "Fetch the logs of a container", true)
follow = cmd.Bool([]string{"f", "-follow"}, false, "Follow log output")
since = cmd.String([]string{"-since"}, "", "Show logs since timestamp")
times = cmd.Bool([]string{"t", "-timestamps"}, false, "Show timestamps")
tail = cmd.String([]string{"-tail"}, "all", "Number of lines to show from the end of the logs")
)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
stream, _, err := cli.call("GET", "/containers/"+name+"/json", nil, nil)
if err != nil {
return err
}
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return err
}
if logType := c.HostConfig.LogConfig.Type; logType != "json-file" {
return fmt.Errorf("\"logs\" command is supported only for \"json-file\" logging driver (got: %s)", logType)
}
v := url.Values{}
v.Set("stdout", "1")
v.Set("stderr", "1")
if *since != "" {
v.Set("since", timeutils.GetTimestamp(*since))
}
if *times {
v.Set("timestamps", "1")
}
if *follow {
v.Set("follow", "1")
}
v.Set("tail", *tail)
sopts := &streamOpts{
rawTerminal: c.Config.Tty,
out: cli.out,
err: cli.err,
}
return cli.stream("GET", "/containers/"+name+"/logs?"+v.Encode(), sopts)
}

30
api/client/pause.go Normal file
View File

@@ -0,0 +1,30 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdPause pauses all processes within one or more containers.
//
// Usage: docker pause CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdPause(args ...string) error {
cmd := cli.Subcmd("pause", "CONTAINER [CONTAINER...]", "Pause all processes within a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/pause", name), nil, nil)); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to pause containers: %v", errNames)
}
return nil
}

64
api/client/port.go Normal file
View File

@@ -0,0 +1,64 @@
package client
import (
"encoding/json"
"fmt"
"strings"
"github.com/docker/docker/nat"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdPort lists port mappings for a container.
// If a private port is specified, it also shows the public-facing port that is NATed to the private port.
//
// Usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]]
func (cli *DockerCli) CmdPort(args ...string) error {
cmd := cli.Subcmd("port", "CONTAINER [PRIVATE_PORT[/PROTO]]", "List port mappings for the CONTAINER, or lookup the public-facing port that\nis NAT-ed to the PRIVATE_PORT", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
if err != nil {
return err
}
var c struct {
NetworkSettings struct {
Ports nat.PortMap
}
}
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return err
}
if cmd.NArg() == 2 {
var (
port = cmd.Arg(1)
proto = "tcp"
parts = strings.SplitN(port, "/", 2)
)
if len(parts) == 2 && len(parts[1]) != 0 {
port = parts[0]
proto = parts[1]
}
natPort := port + "/" + proto
if frontends, exists := c.NetworkSettings.Ports[nat.Port(port+"/"+proto)]; exists && frontends != nil {
for _, frontend := range frontends {
fmt.Fprintf(cli.out, "%s:%s\n", frontend.HostIp, frontend.HostPort)
}
return nil
}
return fmt.Errorf("Error: No public port '%s' published for %s", natPort, cmd.Arg(0))
}
for from, frontends := range c.NetworkSettings.Ports {
for _, frontend := range frontends {
fmt.Fprintf(cli.out, "%s -> %s:%s\n", from, frontend.HostIp, frontend.HostPort)
}
}
return nil
}

175
api/client/ps.go Normal file
View File

@@ -0,0 +1,175 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
"text/tabwriter"
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/opts"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/pkg/units"
)
// CmdPs outputs a list of Docker containers.
//
// Usage: docker ps [OPTIONS]
func (cli *DockerCli) CmdPs(args ...string) error {
var (
err error
psFilterArgs = filters.Args{}
v = url.Values{}
cmd = cli.Subcmd("ps", "", "List containers", true)
quiet = cmd.Bool([]string{"q", "-quiet"}, false, "Only display numeric IDs")
size = cmd.Bool([]string{"s", "-size"}, false, "Display total file sizes")
all = cmd.Bool([]string{"a", "-all"}, false, "Show all containers (default shows just running)")
noTrunc = cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
nLatest = cmd.Bool([]string{"l", "-latest"}, false, "Show the latest created container, include non-running")
since = cmd.String([]string{"#sinceId", "#-since-id", "-since"}, "", "Show created since Id or Name, include non-running")
before = cmd.String([]string{"#beforeId", "#-before-id", "-before"}, "", "Show only container created before Id or Name")
last = cmd.Int([]string{"n"}, -1, "Show n last created containers, include non-running")
flFilter = opts.NewListOpts(nil)
)
cmd.Require(flag.Exact, 0)
cmd.Var(&flFilter, []string{"f", "-filter"}, "Filter output based on conditions provided")
cmd.ParseFlags(args, true)
if *last == -1 && *nLatest {
*last = 1
}
if *all {
v.Set("all", "1")
}
if *last != -1 {
v.Set("limit", strconv.Itoa(*last))
}
if *since != "" {
v.Set("since", *since)
}
if *before != "" {
v.Set("before", *before)
}
if *size {
v.Set("size", "1")
}
// Consolidate all filter flags, and sanity check them.
// They'll get processed in the daemon/server.
for _, f := range flFilter.GetAll() {
if psFilterArgs, err = filters.ParseFlag(f, psFilterArgs); err != nil {
return err
}
}
if len(psFilterArgs) > 0 {
filterJSON, err := filters.ToParam(psFilterArgs)
if err != nil {
return err
}
v.Set("filters", filterJSON)
}
rdr, _, err := cli.call("GET", "/containers/json?"+v.Encode(), nil, nil)
if err != nil {
return err
}
containers := []types.Container{}
if err := json.NewDecoder(rdr).Decode(&containers); err != nil {
return err
}
w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
if !*quiet {
fmt.Fprint(w, "CONTAINER ID\tIMAGE\tCOMMAND\tCREATED\tSTATUS\tPORTS\tNAMES")
if *size {
fmt.Fprintln(w, "\tSIZE")
} else {
fmt.Fprint(w, "\n")
}
}
stripNamePrefix := func(ss []string) []string {
for i, s := range ss {
ss[i] = s[1:]
}
return ss
}
for _, container := range containers {
ID := container.ID
if !*noTrunc {
ID = stringid.TruncateID(ID)
}
if *quiet {
fmt.Fprintln(w, ID)
continue
}
var (
names = stripNamePrefix(container.Names)
command = strconv.Quote(container.Command)
)
if !*noTrunc {
command = stringutils.Truncate(command, 20)
// only display the default name for the container with notrunc is passed
for _, name := range names {
if len(strings.Split(name, "/")) == 1 {
names = []string{name}
break
}
}
}
image := container.Image
if image == "" {
image = "<no image>"
}
fmt.Fprintf(w, "%s\t%s\t%s\t%s ago\t%s\t%s\t%s\t", ID, image, command,
units.HumanDuration(time.Now().UTC().Sub(time.Unix(int64(container.Created), 0))),
container.Status, api.DisplayablePorts(container.Ports), strings.Join(names, ","))
if *size {
if container.SizeRootFs > 0 {
fmt.Fprintf(w, "%s (virtual %s)\n", units.HumanSize(float64(container.SizeRw)), units.HumanSize(float64(container.SizeRootFs)))
} else {
fmt.Fprintf(w, "%s\n", units.HumanSize(float64(container.SizeRw)))
}
continue
}
fmt.Fprint(w, "\n")
}
if !*quiet {
w.Flush()
}
return nil
}

47
api/client/pull.go Normal file
View File

@@ -0,0 +1,47 @@
package client
import (
"fmt"
"net/url"
"github.com/docker/docker/graph/tags"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
// CmdPull pulls an image or a repository from the registry.
//
// Usage: docker pull [OPTIONS] IMAGENAME[:TAG|@DIGEST]
func (cli *DockerCli) CmdPull(args ...string) error {
cmd := cli.Subcmd("pull", "NAME[:TAG|@DIGEST]", "Pull an image or a repository from the registry", true)
allTags := cmd.Bool([]string{"a", "-all-tags"}, false, "Download all tagged images in the repository")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
var (
v = url.Values{}
remote = cmd.Arg(0)
newRemote = remote
)
taglessRemote, tag := parsers.ParseRepositoryTag(remote)
if tag == "" && !*allTags {
newRemote = utils.ImageReference(taglessRemote, tags.DEFAULTTAG)
}
if tag != "" && *allTags {
return fmt.Errorf("tag can't be used with --all-tags/-a")
}
v.Set("fromImage", newRemote)
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(taglessRemote)
if err != nil {
return err
}
_, _, err = cli.clientRequestAttemptLogin("POST", "/images/create?"+v.Encode(), nil, cli.out, repoInfo.Index, "pull")
return err
}

49
api/client/push.go Normal file
View File

@@ -0,0 +1,49 @@
package client
import (
"fmt"
"net/url"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
)
// CmdPush pushes an image or repository to the registry.
//
// Usage: docker push NAME[:TAG]
func (cli *DockerCli) CmdPush(args ...string) error {
cmd := cli.Subcmd("push", "NAME[:TAG]", "Push an image or a repository to the registry", true)
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
remote, tag := parsers.ParseRepositoryTag(name)
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(remote)
if err != nil {
return err
}
// Resolve the Auth config relevant for this server
authConfig := registry.ResolveAuthConfig(cli.configFile, repoInfo.Index)
// If we're not using a custom registry, we know the restrictions
// applied to repository names and can warn the user in advance.
// Custom repositories can have different rules, and we must also
// allow pushing by image ID.
if repoInfo.Official {
username := authConfig.Username
if username == "" {
username = "<user>"
}
return fmt.Errorf("You cannot push a \"root\" repository. Please rename your repository to <user>/<repo> (ex: %s/%s)", username, repoInfo.LocalName)
}
v := url.Values{}
v.Set("tag", tag)
_, _, err = cli.clientRequestAttemptLogin("POST", "/images/"+remote+"/push?"+v.Encode(), nil, cli.out, repoInfo.Index, "push")
return err
}

25
api/client/rename.go Normal file
View File

@@ -0,0 +1,25 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdRename renames a container.
//
// Usage: docker rename OLD_NAME NEW_NAME
func (cli *DockerCli) CmdRename(args ...string) error {
cmd := cli.Subcmd("rename", "OLD_NAME NEW_NAME", "Rename a container", true)
cmd.Require(flag.Exact, 2)
cmd.ParseFlags(args, true)
oldName := cmd.Arg(0)
newName := cmd.Arg(1)
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/rename?name=%s", oldName, newName), nil, nil)); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
return fmt.Errorf("Error: failed to rename container named %s", oldName)
}
return nil
}

38
api/client/restart.go Normal file
View File

@@ -0,0 +1,38 @@
package client
import (
"fmt"
"net/url"
"strconv"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdRestart restarts one or more running containers.
//
// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdRestart(args ...string) error {
cmd := cli.Subcmd("restart", "CONTAINER [CONTAINER...]", "Restart a running container", true)
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Seconds to wait for stop before killing the container")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
v := url.Values{}
v.Set("t", strconv.Itoa(*nSeconds))
var errNames []string
for _, name := range cmd.Args() {
_, _, err := readBody(cli.call("POST", "/containers/"+name+"/restart?"+v.Encode(), nil, nil))
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to restart containers: %v", errNames)
}
return nil
}

54
api/client/rm.go Normal file
View File

@@ -0,0 +1,54 @@
package client
import (
"fmt"
"net/url"
"strings"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdRm removes one or more containers.
//
// Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdRm(args ...string) error {
cmd := cli.Subcmd("rm", "CONTAINER [CONTAINER...]", "Remove one or more containers", true)
v := cmd.Bool([]string{"v", "-volumes"}, false, "Remove the volumes associated with the container")
link := cmd.Bool([]string{"l", "#link", "-link"}, false, "Remove the specified link")
force := cmd.Bool([]string{"f", "-force"}, false, "Force the removal of a running container (uses SIGKILL)")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
val := url.Values{}
if *v {
val.Set("v", "1")
}
if *link {
val.Set("link", "1")
}
if *force {
val.Set("force", "1")
}
var errNames []string
for _, name := range cmd.Args() {
if name == "" {
return fmt.Errorf("Container name cannot be empty")
}
name = strings.Trim(name, "/")
_, _, err := readBody(cli.call("DELETE", "/containers/"+name+"?"+val.Encode(), nil, nil))
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to remove containers: %v", errNames)
}
return nil
}

59
api/client/rmi.go Normal file
View File

@@ -0,0 +1,59 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdRmi removes all images with the specified name(s).
//
// Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]
func (cli *DockerCli) CmdRmi(args ...string) error {
var (
cmd = cli.Subcmd("rmi", "IMAGE [IMAGE...]", "Remove one or more images", true)
force = cmd.Bool([]string{"f", "-force"}, false, "Force removal of the image")
noprune = cmd.Bool([]string{"-no-prune"}, false, "Do not delete untagged parents")
)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
v := url.Values{}
if *force {
v.Set("force", "1")
}
if *noprune {
v.Set("noprune", "1")
}
var errNames []string
for _, name := range cmd.Args() {
rdr, _, err := cli.call("DELETE", "/images/"+name+"?"+v.Encode(), nil, nil)
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
dels := []types.ImageDelete{}
if err := json.NewDecoder(rdr).Decode(&dels); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
continue
}
for _, del := range dels {
if del.Deleted != "" {
fmt.Fprintf(cli.out, "Deleted: %s\n", del.Deleted)
} else {
fmt.Fprintf(cli.out, "Untagged: %s\n", del.Untagged)
}
}
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to remove images: %v", errNames)
}
return nil
}

247
api/client/run.go Normal file
View File

@@ -0,0 +1,247 @@
package client
import (
"fmt"
"io"
"net/url"
"os"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/runconfig"
"github.com/docker/libnetwork/resolvconf/dns"
)
func (cid *cidFile) Close() error {
cid.file.Close()
if !cid.written {
if err := os.Remove(cid.path); err != nil {
return fmt.Errorf("failed to remove the CID file '%s': %s \n", cid.path, err)
}
}
return nil
}
func (cid *cidFile) Write(id string) error {
if _, err := cid.file.Write([]byte(id)); err != nil {
return fmt.Errorf("Failed to write the container ID to the file: %s", err)
}
cid.written = true
return nil
}
// CmdRun runs a command in a new container.
//
// Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
func (cli *DockerCli) CmdRun(args ...string) error {
cmd := cli.Subcmd("run", "IMAGE [COMMAND] [ARG...]", "Run a command in a new container", true)
// These are flags not stored in Config/HostConfig
var (
flAutoRemove = cmd.Bool([]string{"-rm"}, false, "Automatically remove the container when it exits")
flDetach = cmd.Bool([]string{"d", "-detach"}, false, "Run container in background and print container ID")
flSigProxy = cmd.Bool([]string{"-sig-proxy"}, true, "Proxy received signals to the process")
flName = cmd.String([]string{"-name"}, "", "Assign a name to the container")
flAttach *opts.ListOpts
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
ErrConflictRestartPolicyAndAutoRemove = fmt.Errorf("Conflicting options: --restart and --rm")
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
)
config, hostConfig, cmd, err := runconfig.Parse(cmd, args)
// just in case the Parse does not exit
if err != nil {
cmd.ReportError(err.Error(), true)
os.Exit(1)
}
if len(hostConfig.Dns) > 0 {
// check the DNS settings passed via --dns against
// localhost regexp to warn if they are trying to
// set a DNS to a localhost address
for _, dnsIP := range hostConfig.Dns {
if dns.IsLocalhost(dnsIP) {
fmt.Fprintf(cli.err, "WARNING: Localhost DNS setting (--dns=%s) may fail in containers.\n", dnsIP)
break
}
}
}
if config.Image == "" {
cmd.Usage()
return nil
}
if !*flDetach {
if err := cli.CheckTtyInput(config.AttachStdin, config.Tty); err != nil {
return err
}
} else {
if fl := cmd.Lookup("-attach"); fl != nil {
flAttach = fl.Value.(*opts.ListOpts)
if flAttach.Len() != 0 {
return ErrConflictAttachDetach
}
}
if *flAutoRemove {
return ErrConflictDetachAutoRemove
}
config.AttachStdin = false
config.AttachStdout = false
config.AttachStderr = false
config.StdinOnce = false
}
// Disable flSigProxy when in TTY mode
sigProxy := *flSigProxy
if config.Tty {
sigProxy = false
}
createResponse, err := cli.createContainer(config, hostConfig, hostConfig.ContainerIDFile, *flName)
if err != nil {
return err
}
if sigProxy {
sigc := cli.forwardAllSignals(createResponse.ID)
defer signal.StopCatch(sigc)
}
var (
waitDisplayID chan struct{}
errCh chan error
)
if !config.AttachStdout && !config.AttachStderr {
// Make this asynchronous to allow the client to write to stdin before having to read the ID
waitDisplayID = make(chan struct{})
go func() {
defer close(waitDisplayID)
fmt.Fprintf(cli.out, "%s\n", createResponse.ID)
}()
}
if *flAutoRemove && (hostConfig.RestartPolicy.IsAlways() || hostConfig.RestartPolicy.IsOnFailure()) {
return ErrConflictRestartPolicyAndAutoRemove
}
// We need to instantiate the chan because the select needs it. It can
// be closed but can't be uninitialized.
hijacked := make(chan io.Closer)
// Block the return until the chan gets closed
defer func() {
logrus.Debugf("End of CmdRun(), Waiting for hijack to finish.")
if _, ok := <-hijacked; ok {
fmt.Fprintln(cli.err, "Hijack did not finish (chan still open)")
}
}()
if config.AttachStdin || config.AttachStdout || config.AttachStderr {
var (
out, stderr io.Writer
in io.ReadCloser
v = url.Values{}
)
v.Set("stream", "1")
if config.AttachStdin {
v.Set("stdin", "1")
in = cli.in
}
if config.AttachStdout {
v.Set("stdout", "1")
out = cli.out
}
if config.AttachStderr {
v.Set("stderr", "1")
if config.Tty {
stderr = cli.out
} else {
stderr = cli.err
}
}
errCh = promise.Go(func() error {
return cli.hijack("POST", "/containers/"+createResponse.ID+"/attach?"+v.Encode(), config.Tty, in, out, stderr, hijacked, nil)
})
} else {
close(hijacked)
}
// Acknowledge the hijack before starting
select {
case closer := <-hijacked:
// Make sure that the hijack gets closed when returning (results
// in closing the hijack chan and freeing server's goroutines)
if closer != nil {
defer closer.Close()
}
case err := <-errCh:
if err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
}
defer func() {
if *flAutoRemove {
if _, _, err = readBody(cli.call("DELETE", "/containers/"+createResponse.ID+"?v=1", nil, nil)); err != nil {
fmt.Fprintf(cli.err, "Error deleting container: %s\n", err)
}
}
}()
//start the container
if _, _, err = readBody(cli.call("POST", "/containers/"+createResponse.ID+"/start", nil, nil)); err != nil {
return err
}
if (config.AttachStdin || config.AttachStdout || config.AttachStderr) && config.Tty && cli.isTerminalOut {
if err := cli.monitorTtySize(createResponse.ID, false); err != nil {
fmt.Fprintf(cli.err, "Error monitoring TTY size: %s\n", err)
}
}
if errCh != nil {
if err := <-errCh; err != nil {
logrus.Debugf("Error hijack: %s", err)
return err
}
}
// Detached mode: wait for the id to be displayed and return.
if !config.AttachStdout && !config.AttachStderr {
// Detached mode
<-waitDisplayID
return nil
}
var status int
// Attached mode
if *flAutoRemove {
// Autoremove: wait for the container to finish, retrieve
// the exit code and remove the container
if _, _, err := readBody(cli.call("POST", "/containers/"+createResponse.ID+"/wait", nil, nil)); err != nil {
return err
}
if _, status, err = getExitCode(cli, createResponse.ID); err != nil {
return err
}
} else {
// No Autoremove: Simply retrieve the exit code
if !config.Tty {
// In non-TTY mode, we can't detach, so we must wait for container exit
if status, err = waitForExit(cli, createResponse.ID); err != nil {
return err
}
} else {
// In TTY mode, there is a race: if the process dies too slowly, the state could
// be updated after the getExitCode call and result in the wrong exit code being reported
if _, status, err = getExitCode(cli, createResponse.ID); err != nil {
return err
}
}
}
if status != 0 {
return StatusError{StatusCode: status}
}
return nil
}

57
api/client/save.go Normal file
View File

@@ -0,0 +1,57 @@
package client
import (
"errors"
"io"
"net/url"
"os"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdSave saves one or more images to a tar archive.
//
// The tar archive is written to STDOUT by default, or written to a file.
//
// Usage: docker save [OPTIONS] IMAGE [IMAGE...]
func (cli *DockerCli) CmdSave(args ...string) error {
cmd := cli.Subcmd("save", "IMAGE [IMAGE...]", "Save an image(s) to a tar archive (streamed to STDOUT by default)", true)
outfile := cmd.String([]string{"o", "-output"}, "", "Write to an file, instead of STDOUT")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var (
output io.Writer = cli.out
err error
)
if *outfile != "" {
output, err = os.Create(*outfile)
if err != nil {
return err
}
} else if cli.isTerminalOut {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
}
sopts := &streamOpts{
rawTerminal: true,
out: output,
}
if len(cmd.Args()) == 1 {
image := cmd.Arg(0)
if err := cli.stream("GET", "/images/"+image+"/get", sopts); err != nil {
return err
}
} else {
v := url.Values{}
for _, arg := range cmd.Args() {
v.Add("names", arg)
}
if err := cli.stream("GET", "/images/get?"+v.Encode(), sopts); err != nil {
return err
}
}
return nil
}

84
api/client/search.go Normal file
View File

@@ -0,0 +1,84 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"sort"
"strings"
"text/tabwriter"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/stringutils"
"github.com/docker/docker/registry"
)
// ByStars sorts search results in ascending order by number of stars.
type ByStars []registry.SearchResult
func (r ByStars) Len() int { return len(r) }
func (r ByStars) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r ByStars) Less(i, j int) bool { return r[i].StarCount < r[j].StarCount }
// CmdSearch searches the Docker Hub for images.
//
// Usage: docker search [OPTIONS] TERM
func (cli *DockerCli) CmdSearch(args ...string) error {
cmd := cli.Subcmd("search", "TERM", "Search the Docker Hub for images", true)
noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Don't truncate output")
trusted := cmd.Bool([]string{"#t", "#trusted", "#-trusted"}, false, "Only show trusted builds")
automated := cmd.Bool([]string{"-automated"}, false, "Only show automated builds")
stars := cmd.Uint([]string{"s", "#stars", "-stars"}, 0, "Only displays with at least x stars")
cmd.Require(flag.Exact, 1)
cmd.ParseFlags(args, true)
name := cmd.Arg(0)
v := url.Values{}
v.Set("term", name)
// Resolve the Repository name from fqn to hostname + name
taglessRemote, _ := parsers.ParseRepositoryTag(name)
repoInfo, err := registry.ParseRepositoryInfo(taglessRemote)
if err != nil {
return err
}
rdr, _, err := cli.clientRequestAttemptLogin("GET", "/images/search?"+v.Encode(), nil, nil, repoInfo.Index, "search")
if err != nil {
return err
}
results := ByStars{}
if err := json.NewDecoder(rdr).Decode(&results); err != nil {
return err
}
sort.Sort(sort.Reverse(results))
w := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)
fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tAUTOMATED\n")
for _, res := range results {
if ((*automated || *trusted) && (!res.IsTrusted && !res.IsAutomated)) || (int(*stars) > res.StarCount) {
continue
}
desc := strings.Replace(res.Description, "\n", " ", -1)
desc = strings.Replace(desc, "\r", " ", -1)
if !*noTrunc && len(desc) > 45 {
desc = stringutils.Truncate(desc, 42) + "..."
}
fmt.Fprintf(w, "%s\t%s\t%d\t", res.Name, desc, res.StarCount)
if res.IsOfficial {
fmt.Fprint(w, "[OK]")
}
fmt.Fprint(w, "\t")
if res.IsAutomated || res.IsTrusted {
fmt.Fprint(w, "[OK]")
}
fmt.Fprint(w, "\n")
}
w.Flush()
return nil
}

167
api/client/start.go Normal file
View File

@@ -0,0 +1,167 @@
package client
import (
"encoding/json"
"fmt"
"io"
"net/url"
"os"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/signal"
)
func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
sigc := make(chan os.Signal, 128)
signal.CatchAll(sigc)
go func() {
for s := range sigc {
if s == signal.SIGCHLD {
continue
}
var sig string
for sigStr, sigN := range signal.SignalMap {
if sigN == s {
sig = sigStr
break
}
}
if sig == "" {
fmt.Fprintf(cli.err, "Unsupported signal: %v. Discarding.\n", s)
}
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/kill?signal=%s", cid, sig), nil, nil)); err != nil {
logrus.Debugf("Error sending signal: %s", err)
}
}
}()
return sigc
}
// CmdStart starts one or more stopped containers.
//
// Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStart(args ...string) error {
var (
cErr chan error
tty bool
cmd = cli.Subcmd("start", "CONTAINER [CONTAINER...]", "Start one or more stopped containers", true)
attach = cmd.Bool([]string{"a", "-attach"}, false, "Attach STDOUT/STDERR and forward signals")
openStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's STDIN")
)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
if *attach || *openStdin {
if cmd.NArg() > 1 {
return fmt.Errorf("You cannot start and attach multiple containers at once.")
}
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/json", nil, nil)
if err != nil {
return err
}
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return err
}
tty = c.Config.Tty
if !tty {
sigc := cli.forwardAllSignals(cmd.Arg(0))
defer signal.StopCatch(sigc)
}
var in io.ReadCloser
v := url.Values{}
v.Set("stream", "1")
if *openStdin && c.Config.OpenStdin {
v.Set("stdin", "1")
in = cli.in
}
v.Set("stdout", "1")
v.Set("stderr", "1")
hijacked := make(chan io.Closer)
// Block the return until the chan gets closed
defer func() {
logrus.Debugf("CmdStart() returned, defer waiting for hijack to finish.")
if _, ok := <-hijacked; ok {
fmt.Fprintln(cli.err, "Hijack did not finish (chan still open)")
}
cli.in.Close()
}()
cErr = promise.Go(func() error {
return cli.hijack("POST", "/containers/"+cmd.Arg(0)+"/attach?"+v.Encode(), tty, in, cli.out, cli.err, hijacked, nil)
})
// Acknowledge the hijack before starting
select {
case closer := <-hijacked:
// Make sure that the hijack gets closed when returning (results
// in closing the hijack chan and freeing server's goroutines)
if closer != nil {
defer closer.Close()
}
case err := <-cErr:
if err != nil {
return err
}
}
}
var encounteredError error
var errNames []string
for _, name := range cmd.Args() {
_, _, err := readBody(cli.call("POST", "/containers/"+name+"/start", nil, nil))
if err != nil {
if !*attach && !*openStdin {
// attach and openStdin is false means it could be starting multiple containers
// when a container start failed, show the error message and start next
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
encounteredError = err
}
} else {
if !*attach && !*openStdin {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
}
if len(errNames) > 0 {
encounteredError = fmt.Errorf("Error: failed to start containers: %v", errNames)
}
if encounteredError != nil {
return encounteredError
}
if *openStdin || *attach {
if tty && cli.isTerminalOut {
if err := cli.monitorTtySize(cmd.Arg(0), false); err != nil {
fmt.Fprintf(cli.err, "Error monitoring TTY size: %s\n", err)
}
}
if attchErr := <-cErr; attchErr != nil {
return attchErr
}
_, status, err := getExitCode(cli, cmd.Arg(0))
if err != nil {
return err
}
if status != 0 {
return StatusError{StatusCode: status}
}
}
return nil
}

198
api/client/stats.go Normal file
View File

@@ -0,0 +1,198 @@
package client
import (
"encoding/json"
"fmt"
"io"
"net/url"
"sort"
"strings"
"sync"
"text/tabwriter"
"time"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/units"
)
type containerStats struct {
Name string
CPUPercentage float64
Memory float64
MemoryLimit float64
MemoryPercentage float64
NetworkRx float64
NetworkTx float64
mu sync.RWMutex
err error
}
func (s *containerStats) Collect(cli *DockerCli, streamStats bool) {
v := url.Values{}
if streamStats {
v.Set("stream", "1")
} else {
v.Set("stream", "0")
}
stream, _, err := cli.call("GET", "/containers/"+s.Name+"/stats?"+v.Encode(), nil, nil)
if err != nil {
s.mu.Lock()
s.err = err
s.mu.Unlock()
return
}
defer stream.Close()
var (
previousCPU uint64
previousSystem uint64
dec = json.NewDecoder(stream)
u = make(chan error, 1)
)
go func() {
for {
var v *types.Stats
if err := dec.Decode(&v); err != nil {
u <- err
return
}
var (
memPercent = float64(v.MemoryStats.Usage) / float64(v.MemoryStats.Limit) * 100.0
cpuPercent = 0.0
)
previousCPU = v.PreCpuStats.CpuUsage.TotalUsage
previousSystem = v.PreCpuStats.SystemUsage
cpuPercent = calculateCPUPercent(previousCPU, previousSystem, v)
s.mu.Lock()
s.CPUPercentage = cpuPercent
s.Memory = float64(v.MemoryStats.Usage)
s.MemoryLimit = float64(v.MemoryStats.Limit)
s.MemoryPercentage = memPercent
s.NetworkRx = float64(v.Network.RxBytes)
s.NetworkTx = float64(v.Network.TxBytes)
s.mu.Unlock()
u <- nil
if !streamStats {
return
}
}
}()
for {
select {
case <-time.After(2 * time.Second):
// zero out the values if we have not received an update within
// the specified duration.
s.mu.Lock()
s.CPUPercentage = 0
s.Memory = 0
s.MemoryPercentage = 0
s.mu.Unlock()
case err := <-u:
if err != nil {
s.mu.Lock()
s.err = err
s.mu.Unlock()
return
}
}
if !streamStats {
return
}
}
}
func (s *containerStats) Display(w io.Writer) error {
s.mu.RLock()
defer s.mu.RUnlock()
if s.err != nil {
return s.err
}
fmt.Fprintf(w, "%s\t%.2f%%\t%s/%s\t%.2f%%\t%s/%s\n",
s.Name,
s.CPUPercentage,
units.HumanSize(s.Memory), units.HumanSize(s.MemoryLimit),
s.MemoryPercentage,
units.HumanSize(s.NetworkRx), units.HumanSize(s.NetworkTx))
return nil
}
// CmdStats displays a live stream of resource usage statistics for one or more containers.
//
// This shows real-time information on CPU usage, memory usage, and network I/O.
//
// Usage: docker stats CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStats(args ...string) error {
cmd := cli.Subcmd("stats", "CONTAINER [CONTAINER...]", "Display a live stream of one or more containers' resource usage statistics", true)
noStream := cmd.Bool([]string{"-no-stream"}, false, "Disable streaming stats and only pull the first result")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
names := cmd.Args()
sort.Strings(names)
var (
cStats []*containerStats
w = tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
)
printHeader := func() {
if !*noStream {
fmt.Fprint(cli.out, "\033[2J")
fmt.Fprint(cli.out, "\033[H")
}
io.WriteString(w, "CONTAINER\tCPU %\tMEM USAGE/LIMIT\tMEM %\tNET I/O\n")
}
for _, n := range names {
s := &containerStats{Name: n}
cStats = append(cStats, s)
go s.Collect(cli, !*noStream)
}
// do a quick pause so that any failed connections for containers that do not exist are able to be
// evicted before we display the initial or default values.
time.Sleep(1500 * time.Millisecond)
var errs []string
for _, c := range cStats {
c.mu.Lock()
if c.err != nil {
errs = append(errs, fmt.Sprintf("%s: %v", c.Name, c.err))
}
c.mu.Unlock()
}
if len(errs) > 0 {
return fmt.Errorf("%s", strings.Join(errs, ", "))
}
for range time.Tick(500 * time.Millisecond) {
printHeader()
toRemove := []int{}
for i, s := range cStats {
if err := s.Display(w); err != nil && !*noStream {
toRemove = append(toRemove, i)
}
}
for j := len(toRemove) - 1; j >= 0; j-- {
i := toRemove[j]
cStats = append(cStats[:i], cStats[i+1:]...)
}
if len(cStats) == 0 {
return nil
}
w.Flush()
if *noStream {
break
}
}
return nil
}
func calculateCPUPercent(previousCPU, previousSystem uint64, v *types.Stats) float64 {
var (
cpuPercent = 0.0
// calculate the change for the cpu usage of the container in between readings
cpuDelta = float64(v.CpuStats.CpuUsage.TotalUsage - previousCPU)
// calculate the change for the entire system between readings
systemDelta = float64(v.CpuStats.SystemUsage - previousSystem)
)
if systemDelta > 0.0 && cpuDelta > 0.0 {
cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CpuStats.CpuUsage.PercpuUsage)) * 100.0
}
return cpuPercent
}

View File

@@ -0,0 +1,29 @@
package client
import (
"bytes"
"sync"
"testing"
)
func TestDisplay(t *testing.T) {
c := &containerStats{
Name: "app",
CPUPercentage: 30.0,
Memory: 100 * 1024 * 1024.0,
MemoryLimit: 2048 * 1024 * 1024.0,
MemoryPercentage: 100.0 / 2048.0 * 100.0,
NetworkRx: 100 * 1024 * 1024,
NetworkTx: 800 * 1024 * 1024,
mu: sync.RWMutex{},
}
var b bytes.Buffer
if err := c.Display(&b); err != nil {
t.Fatalf("c.Display() gave error: %s", err)
}
got := b.String()
want := "app\t30.00%\t104.9 MB/2.147 GB\t4.88%\t104.9 MB/838.9 MB\n"
if got != want {
t.Fatalf("c.Display() = %q, want %q", got, want)
}
}

40
api/client/stop.go Normal file
View File

@@ -0,0 +1,40 @@
package client
import (
"fmt"
"net/url"
"strconv"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdStop stops one or more running containers.
//
// A running container is stopped by first sending SIGTERM and then SIGKILL if the container fails to stop within a grace period (the default is 10 seconds).
//
// Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdStop(args ...string) error {
cmd := cli.Subcmd("stop", "CONTAINER [CONTAINER...]", "Stop a running container by sending SIGTERM and then SIGKILL after a\ngrace period", true)
nSeconds := cmd.Int([]string{"t", "-time"}, 10, "Seconds to wait for stop before killing it")
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
v := url.Values{}
v.Set("t", strconv.Itoa(*nSeconds))
var errNames []string
for _, name := range cmd.Args() {
_, _, err := readBody(cli.call("POST", "/containers/"+name+"/stop?"+v.Encode(), nil, nil))
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to stop containers: %v", errNames)
}
return nil
}

41
api/client/tag.go Normal file
View File

@@ -0,0 +1,41 @@
package client
import (
"net/url"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
)
// CmdTag tags an image into a repository.
//
// Usage: docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
func (cli *DockerCli) CmdTag(args ...string) error {
cmd := cli.Subcmd("tag", "IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]", "Tag an image into a repository", true)
force := cmd.Bool([]string{"f", "#force", "-force"}, false, "Force")
cmd.Require(flag.Exact, 2)
cmd.ParseFlags(args, true)
var (
repository, tag = parsers.ParseRepositoryTag(cmd.Arg(1))
v = url.Values{}
)
//Check if the given image name can be resolved
if err := registry.ValidateRepositoryName(repository); err != nil {
return err
}
v.Set("repo", repository)
v.Set("tag", tag)
if *force {
v.Set("force", "1")
}
if _, _, err := readBody(cli.call("POST", "/images/"+cmd.Arg(0)+"/tag?"+v.Encode(), nil, nil)); err != nil {
return err
}
return nil
}

46
api/client/top.go Normal file
View File

@@ -0,0 +1,46 @@
package client
import (
"encoding/json"
"fmt"
"net/url"
"strings"
"text/tabwriter"
"github.com/docker/docker/api/types"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdTop displays the running processes of a container.
//
// Usage: docker top CONTAINER
func (cli *DockerCli) CmdTop(args ...string) error {
cmd := cli.Subcmd("top", "CONTAINER [ps OPTIONS]", "Display the running processes of a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
val := url.Values{}
if cmd.NArg() > 1 {
val.Set("ps_args", strings.Join(cmd.Args()[1:], " "))
}
stream, _, err := cli.call("GET", "/containers/"+cmd.Arg(0)+"/top?"+val.Encode(), nil, nil)
if err != nil {
return err
}
procList := types.ContainerProcessList{}
if err := json.NewDecoder(stream).Decode(&procList); err != nil {
return err
}
w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
fmt.Fprintln(w, strings.Join(procList.Titles, "\t"))
for _, proc := range procList.Processes {
fmt.Fprintln(w, strings.Join(proc, "\t"))
}
w.Flush()
return nil
}

30
api/client/unpause.go Normal file
View File

@@ -0,0 +1,30 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdUnpause unpauses all processes within a container, for one or more containers.
//
// Usage: docker unpause CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdUnpause(args ...string) error {
cmd := cli.Subcmd("unpause", "CONTAINER [CONTAINER...]", "Unpause all processes within a container", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {
if _, _, err := readBody(cli.call("POST", fmt.Sprintf("/containers/%s/unpause", name), nil, nil)); err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to unpause containers: %v", errNames)
}
return nil
}

View File

@@ -17,21 +17,23 @@ import (
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/autogen/dockerversion"
"github.com/docker/docker/engine"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/signal"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/docker/pkg/term"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
var (
ErrConnectionRefused = errors.New("Cannot connect to the Docker daemon. Is 'docker -d' running on this host?")
errConnectionRefused = errors.New("Cannot connect to the Docker daemon. Is 'docker -d' running on this host?")
)
// HTTPClient creates a new HTP client with the cli's client transport instance.
func (cli *DockerCli) HTTPClient() *http.Client {
return &http.Client{Transport: cli.transport}
}
@@ -39,18 +41,8 @@ func (cli *DockerCli) HTTPClient() *http.Client {
func (cli *DockerCli) encodeData(data interface{}) (*bytes.Buffer, error) {
params := bytes.NewBuffer(nil)
if data != nil {
if env, ok := data.(engine.Env); ok {
if err := env.Encode(params); err != nil {
return nil, err
}
} else {
buf, err := json.Marshal(data)
if err != nil {
return nil, err
}
if _, err := params.Write(buf); err != nil {
return nil, err
}
if err := json.NewEncoder(params).Encode(data); err != nil {
return nil, err
}
}
return params, nil
@@ -65,14 +57,23 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
if err != nil {
return nil, "", -1, err
}
// Add CLI Config's HTTP Headers BEFORE we set the Docker headers
// then the user can't change OUR headers
for k, v := range cli.configFile.HttpHeaders {
req.Header.Set(k, v)
}
req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION)
req.URL.Host = cli.addr
req.URL.Scheme = cli.scheme
if headers != nil {
for k, v := range headers {
req.Header[k] = v
}
}
if expectedPayload && req.Header.Get("Content-Type") == "" {
req.Header.Set("Content-Type", "text/plain")
}
@@ -84,13 +85,12 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
}
if err != nil {
if strings.Contains(err.Error(), "connection refused") {
return nil, "", statusCode, ErrConnectionRefused
return nil, "", statusCode, errConnectionRefused
}
if cli.tlsConfig == nil {
return nil, "", statusCode, fmt.Errorf("%v. Are you trying to connect to a TLS-enabled daemon without TLS?", err)
}
return nil, "", statusCode, fmt.Errorf("An error occurred trying to connect: %v", err)
}
@@ -109,7 +109,7 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
}
func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reader, out io.Writer, index *registry.IndexInfo, cmdName string) (io.ReadCloser, int, error) {
cmdAttempt := func(authConfig registry.AuthConfig) (io.ReadCloser, int, error) {
cmdAttempt := func(authConfig cliconfig.AuthConfig) (io.ReadCloser, int, error) {
buf, err := json.Marshal(authConfig)
if err != nil {
return nil, -1, err
@@ -140,14 +140,14 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
}
// Resolve the Auth config relevant for this server
authConfig := cli.configFile.ResolveAuthConfig(index)
authConfig := registry.ResolveAuthConfig(cli.configFile, index)
body, statusCode, err := cmdAttempt(authConfig)
if statusCode == http.StatusUnauthorized {
fmt.Fprintf(cli.out, "\nPlease login prior to %s:\n", cmdName)
if err = cli.CmdLogin(index.GetAuthConfigKey()); err != nil {
return nil, -1, err
}
authConfig = cli.configFile.ResolveAuthConfig(index)
authConfig = registry.ResolveAuthConfig(cli.configFile, index)
return cmdAttempt(authConfig)
}
return body, statusCode, err
@@ -169,33 +169,38 @@ func (cli *DockerCli) call(method, path string, data interface{}, headers map[st
body, _, statusCode, err := cli.clientRequest(method, path, params, headers)
return body, statusCode, err
}
func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer, headers map[string][]string) error {
return cli.streamHelper(method, path, true, in, out, nil, headers)
type streamOpts struct {
rawTerminal bool
in io.Reader
out io.Writer
err io.Writer
headers map[string][]string
}
func (cli *DockerCli) streamHelper(method, path string, setRawTerminal bool, in io.Reader, stdout, stderr io.Writer, headers map[string][]string) error {
body, contentType, _, err := cli.clientRequest(method, path, in, headers)
func (cli *DockerCli) stream(method, path string, opts *streamOpts) error {
body, contentType, _, err := cli.clientRequest(method, path, opts.in, opts.headers)
if err != nil {
return err
}
return cli.streamBody(body, contentType, setRawTerminal, stdout, stderr)
return cli.streamBody(body, contentType, opts.rawTerminal, opts.out, opts.err)
}
func (cli *DockerCli) streamBody(body io.ReadCloser, contentType string, setRawTerminal bool, stdout, stderr io.Writer) error {
func (cli *DockerCli) streamBody(body io.ReadCloser, contentType string, rawTerminal bool, stdout, stderr io.Writer) error {
defer body.Close()
if api.MatchesContentType(contentType, "application/json") {
return utils.DisplayJSONMessagesStream(body, stdout, cli.outFd, cli.isTerminalOut)
return jsonmessage.DisplayJSONMessagesStream(body, stdout, cli.outFd, cli.isTerminalOut)
}
if stdout != nil || stderr != nil {
// When TTY is ON, use regular copy
var err error
if setRawTerminal {
if rawTerminal {
_, err = io.Copy(stdout, body)
} else {
_, err = stdcopy.StdCopy(stdout, stderr, body)
}
log.Debugf("[stream] End of stdout")
logrus.Debugf("[stream] End of stdout")
return err
}
return nil
@@ -218,7 +223,7 @@ func (cli *DockerCli) resizeTty(id string, isExec bool) {
}
if _, _, err := readBody(cli.call("POST", path+v.Encode(), nil, nil)); err != nil {
log.Debugf("Error resize: %s", err)
logrus.Debugf("Error resize: %s", err)
}
}
@@ -228,11 +233,12 @@ func waitForExit(cli *DockerCli, containerID string) (int, error) {
return -1, err
}
var out engine.Env
if err := out.Decode(stream); err != nil {
var res types.ContainerWaitResponse
if err := json.NewDecoder(stream).Decode(&res); err != nil {
return -1, err
}
return out.GetInt("StatusCode"), nil
return res.StatusCode, nil
}
// getExitCode perform an inspect on the container. It returns
@@ -241,19 +247,18 @@ func getExitCode(cli *DockerCli, containerID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/containers/"+containerID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != ErrConnectionRefused {
if err != errConnectionRefused {
return false, -1, err
}
return false, -1, nil
}
var result engine.Env
if err := result.Decode(stream); err != nil {
var c types.ContainerJSON
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return false, -1, err
}
state := result.GetSubEnv("State")
return state.GetBool("Running"), state.GetInt("ExitCode"), nil
return c.State.Running, c.State.ExitCode, nil
}
// getExecExitCode perform an inspect on the exec command. It returns
@@ -262,18 +267,24 @@ func getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/exec/"+execID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != ErrConnectionRefused {
if err != errConnectionRefused {
return false, -1, err
}
return false, -1, nil
}
var result engine.Env
if err := result.Decode(stream); err != nil {
//TODO: Should we reconsider having a type in api/types?
//this is a response to exex/id/json not container
var c struct {
Running bool
ExitCode int
}
if err := json.NewDecoder(stream).Decode(&c); err != nil {
return false, -1, err
}
return result.GetBool("Running"), result.GetInt("ExitCode"), nil
return c.Running, c.ExitCode, nil
}
func (cli *DockerCli) monitorTtySize(id string, isExec bool) error {
@@ -281,23 +292,23 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error {
if runtime.GOOS == "windows" {
go func() {
prevW, prevH := cli.getTtySize()
prevH, prevW := cli.getTtySize()
for {
time.Sleep(time.Millisecond * 250)
w, h := cli.getTtySize()
h, w := cli.getTtySize()
if prevW != w || prevH != h {
cli.resizeTty(id, isExec)
}
prevW = w
prevH = h
prevW = w
}
}()
} else {
sigchan := make(chan os.Signal, 1)
gosignal.Notify(sigchan, signal.SIGWINCH)
go func() {
for _ = range sigchan {
for range sigchan {
cli.resizeTty(id, isExec)
}
}()
@@ -311,7 +322,7 @@ func (cli *DockerCli) getTtySize() (int, int) {
}
ws, err := term.GetWinsize(cli.outFd)
if err != nil {
log.Debugf("Error getting size: %s", err)
logrus.Debugf("Error getting size: %s", err)
if ws == nil {
return 0, 0
}

61
api/client/version.go Normal file
View File

@@ -0,0 +1,61 @@
package client
import (
"encoding/json"
"fmt"
"runtime"
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/autogen/dockerversion"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/utils"
)
// CmdVersion shows Docker version information.
//
// Available version information is shown for: client Docker version, client API version, client Go version, client Git commit, client OS/Arch, server Docker version, server API version, server Go version, server Git commit, and server OS/Arch.
//
// Usage: docker version
func (cli *DockerCli) CmdVersion(args ...string) error {
cmd := cli.Subcmd("version", "", "Show the Docker version information.", true)
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
if dockerversion.VERSION != "" {
fmt.Fprintf(cli.out, "Client version: %s\n", dockerversion.VERSION)
}
fmt.Fprintf(cli.out, "Client API version: %s\n", api.APIVERSION)
fmt.Fprintf(cli.out, "Go version (client): %s\n", runtime.Version())
if dockerversion.GITCOMMIT != "" {
fmt.Fprintf(cli.out, "Git commit (client): %s\n", dockerversion.GITCOMMIT)
}
fmt.Fprintf(cli.out, "OS/Arch (client): %s/%s\n", runtime.GOOS, runtime.GOARCH)
if utils.ExperimentalBuild() {
fmt.Fprintf(cli.out, "Experimental (client): true\n")
}
stream, _, err := cli.call("GET", "/version", nil, nil)
if err != nil {
return err
}
var v types.Version
if err := json.NewDecoder(stream).Decode(&v); err != nil {
fmt.Fprintf(cli.err, "Error reading remote version: %s\n", err)
return err
}
fmt.Fprintf(cli.out, "Server version: %s\n", v.Version)
if v.ApiVersion != "" {
fmt.Fprintf(cli.out, "Server API version: %s\n", v.ApiVersion)
}
fmt.Fprintf(cli.out, "Go version (server): %s\n", v.GoVersion)
fmt.Fprintf(cli.out, "Git commit (server): %s\n", v.GitCommit)
fmt.Fprintf(cli.out, "OS/Arch (server): %s/%s\n", v.Os, v.Arch)
if v.Experimental {
fmt.Fprintf(cli.out, "Experimental (server): true\n")
}
return nil
}

34
api/client/wait.go Normal file
View File

@@ -0,0 +1,34 @@
package client
import (
"fmt"
flag "github.com/docker/docker/pkg/mflag"
)
// CmdWait blocks until a container stops, then prints its exit code.
//
// If more than one container is specified, this will wait synchronously on each container.
//
// Usage: docker wait CONTAINER [CONTAINER...]
func (cli *DockerCli) CmdWait(args ...string) error {
cmd := cli.Subcmd("wait", "CONTAINER [CONTAINER...]", "Block until a container stops, then print its exit code.", true)
cmd.Require(flag.Min, 1)
cmd.ParseFlags(args, true)
var errNames []string
for _, name := range cmd.Args() {
status, err := waitForExit(cli, name)
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
errNames = append(errNames, name)
} else {
fmt.Fprintf(cli.out, "%d\n", status)
}
}
if len(errNames) > 0 {
return fmt.Errorf("Error: failed to wait containers: %v", errNames)
}
return nil
}

View File

@@ -3,34 +3,30 @@ package api
import (
"fmt"
"mime"
"os"
"path/filepath"
"sort"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/parsers"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/pkg/version"
"github.com/docker/libtrust"
)
// Common constants for daemon and client.
const (
APIVERSION version.Version = "1.18"
DEFAULTHTTPHOST = "127.0.0.1"
DEFAULTUNIXSOCKET = "/var/run/docker.sock"
DefaultDockerfileName string = "Dockerfile"
APIVERSION version.Version = "1.19" // Current REST API version
DefaultDockerfileName string = "Dockerfile" // Default filename with Docker commands, read by docker build
)
func ValidateHost(val string) (string, error) {
host, err := parsers.ParseHost(DEFAULTHTTPHOST, DEFAULTUNIXSOCKET, val)
if err != nil {
return val, err
}
return host, nil
}
type ByPrivatePort []types.Port
// TODO remove, used on < 1.5 in getContainersJSON
func DisplayablePorts(ports *engine.Table) string {
func (r ByPrivatePort) Len() int { return len(r) }
func (r ByPrivatePort) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r ByPrivatePort) Less(i, j int) bool { return r[i].PrivatePort < r[j].PrivatePort }
func DisplayablePorts(ports []types.Port) string {
var (
result = []string{}
hostMappings = []string{}
@@ -39,21 +35,20 @@ func DisplayablePorts(ports *engine.Table) string {
)
firstInGroupMap = make(map[string]int)
lastInGroupMap = make(map[string]int)
ports.SetKey("PrivatePort")
ports.Sort()
for _, port := range ports.Data {
sort.Sort(ByPrivatePort(ports))
for _, port := range ports {
var (
current = port.GetInt("PrivatePort")
portKey = port.Get("Type")
current = port.PrivatePort
portKey = port.Type
firstInGroup int
lastInGroup int
)
if port.Get("IP") != "" {
if port.GetInt("PublicPort") != current {
hostMappings = append(hostMappings, fmt.Sprintf("%s:%d->%d/%s", port.Get("IP"), port.GetInt("PublicPort"), port.GetInt("PrivatePort"), port.Get("Type")))
if port.IP != "" {
if port.PublicPort != current {
hostMappings = append(hostMappings, fmt.Sprintf("%s:%d->%d/%s", port.IP, port.PublicPort, port.PrivatePort, port.Type))
continue
}
portKey = fmt.Sprintf("%s/%s", port.Get("IP"), port.Get("Type"))
portKey = fmt.Sprintf("%s/%s", port.IP, port.Type)
}
firstInGroup = firstInGroupMap[portKey]
lastInGroup = lastInGroupMap[portKey]
@@ -104,7 +99,7 @@ func FormGroup(key string, start, last int) string {
func MatchesContentType(contentType, expectedType string) bool {
mimetype, _, err := mime.ParseMediaType(contentType)
if err != nil {
log.Errorf("Error parsing media type: %s error: %v", contentType, err)
logrus.Errorf("Error parsing media type: %s error: %v", contentType, err)
}
return err == nil && mimetype == expectedType
}
@@ -112,7 +107,7 @@ func MatchesContentType(contentType, expectedType string) bool {
// LoadOrCreateTrustKey attempts to load the libtrust key at the given path,
// otherwise generates a new one
func LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) {
err := os.MkdirAll(filepath.Dir(trustKeyPath), 0700)
err := system.MkdirAll(filepath.Dir(trustKeyPath), 0700)
if err != nil {
return nil, err
}

29
api/server/form.go Normal file
View File

@@ -0,0 +1,29 @@
package server
import (
"net/http"
"strconv"
"strings"
)
func boolValue(r *http.Request, k string) bool {
s := strings.ToLower(strings.TrimSpace(r.FormValue(k)))
return !(s == "" || s == "0" || s == "no" || s == "false" || s == "none")
}
// boolValueOrDefault returns the default bool passed if the query param is
// missing, otherwise it's just a proxy to boolValue above
func boolValueOrDefault(r *http.Request, k string, d bool) bool {
if _, ok := r.Form[k]; !ok {
return d
}
return boolValue(r, k)
}
func int64ValueOrZero(r *http.Request, k string) int64 {
val, err := strconv.ParseInt(r.FormValue(k), 10, 64)
if err != nil {
return 0
}
return val
}

70
api/server/form_test.go Normal file
View File

@@ -0,0 +1,70 @@
package server
import (
"net/http"
"net/url"
"testing"
)
func TestBoolValue(t *testing.T) {
cases := map[string]bool{
"": false,
"0": false,
"no": false,
"false": false,
"none": false,
"1": true,
"yes": true,
"true": true,
"one": true,
"100": true,
}
for c, e := range cases {
v := url.Values{}
v.Set("test", c)
r, _ := http.NewRequest("POST", "", nil)
r.Form = v
a := boolValue(r, "test")
if a != e {
t.Fatalf("Value: %s, expected: %v, actual: %v", c, e, a)
}
}
}
func TestBoolValueOrDefault(t *testing.T) {
r, _ := http.NewRequest("GET", "", nil)
if !boolValueOrDefault(r, "queryparam", true) {
t.Fatal("Expected to get true default value, got false")
}
v := url.Values{}
v.Set("param", "")
r, _ = http.NewRequest("GET", "", nil)
r.Form = v
if boolValueOrDefault(r, "param", true) {
t.Fatal("Expected not to get true")
}
}
func TestInt64ValueOrZero(t *testing.T) {
cases := map[string]int64{
"": 0,
"asdf": 0,
"0": 0,
"1": 1,
}
for c, e := range cases {
v := url.Values{}
v.Set("test", c)
r, _ := http.NewRequest("POST", "", nil)
r.Form = v
a := int64ValueOrZero(r, "test")
if a != e {
t.Fatalf("Value: %s, expected: %v, actual: %v", c, e, a)
}
}
}

38
api/server/profiler.go Normal file
View File

@@ -0,0 +1,38 @@
package server
import (
"expvar"
"fmt"
"net/http"
"net/http/pprof"
"github.com/gorilla/mux"
)
func ProfilerSetup(mainRouter *mux.Router, path string) {
var r = mainRouter.PathPrefix(path).Subrouter()
r.HandleFunc("/vars", expVars)
r.HandleFunc("/pprof/", pprof.Index)
r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
r.HandleFunc("/pprof/profile", pprof.Profile)
r.HandleFunc("/pprof/symbol", pprof.Symbol)
r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP)
r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP)
}
// Replicated from expvar.go as not public.
func expVars(w http.ResponseWriter, r *http.Request) {
first := true
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "{\n")
expvar.Do(func(kv expvar.KeyValue) {
if !first {
fmt.Fprintf(w, ",\n")
}
first = false
fmt.Fprintf(w, "%q: %s", kv.Key, kv.Value)
})
fmt.Fprintf(w, "\n}\n")
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,102 +4,95 @@ package server
import (
"fmt"
"net"
"net/http"
"os"
"syscall"
"strconv"
"github.com/docker/docker/engine"
"github.com/docker/docker/daemon"
"github.com/docker/docker/pkg/sockets"
"github.com/docker/docker/pkg/systemd"
"github.com/docker/libnetwork/portallocator"
)
// NewServer sets up the required Server and does protocol specific checking.
func NewServer(proto, addr string, job *engine.Job) (Server, error) {
// Basic error and sanity checking
// newServer sets up the required serverClosers and does protocol specific checking.
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
var (
err error
ls []net.Listener
)
switch proto {
case "fd":
return nil, serveFd(addr, job)
case "tcp":
return setupTcpHttp(addr, job)
case "unix":
return setupUnixHttp(addr, job)
default:
return nil, fmt.Errorf("Invalid protocol format.")
}
}
func setupUnixHttp(addr string, job *engine.Job) (*HttpServer, error) {
r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version"))
if err := syscall.Unlink(addr); err != nil && !os.IsNotExist(err) {
return nil, err
}
mask := syscall.Umask(0777)
defer syscall.Umask(mask)
l, err := newListener("unix", addr, job.GetenvBool("BufferRequests"))
if err != nil {
return nil, err
}
if err := setSocketGroup(addr, job.Getenv("SocketGroup")); err != nil {
return nil, err
}
if err := os.Chmod(addr, 0660); err != nil {
return nil, err
}
return &HttpServer{&http.Server{Addr: addr, Handler: r}, l}, nil
}
// serveFd creates an http.Server and sets it up to serve given a socket activated
// argument.
func serveFd(addr string, job *engine.Job) error {
r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version"))
ls, e := systemd.ListenFD(addr)
if e != nil {
return e
}
chErrors := make(chan error, len(ls))
// We don't want to start serving on these sockets until the
// daemon is initialized and installed. Otherwise required handlers
// won't be ready.
<-activationLock
// Since ListenFD will return one or more sockets we have
// to create a go func to spawn off multiple serves
for i := range ls {
listener := ls[i]
go func() {
httpSrv := http.Server{Handler: r}
chErrors <- httpSrv.Serve(listener)
}()
}
for i := 0; i < len(ls); i++ {
err := <-chErrors
ls, err = systemd.ListenFD(addr)
if err != nil {
return err
return nil, err
}
// We don't want to start serving on these sockets until the
// daemon is initialized and installed. Otherwise required handlers
// won't be ready.
<-s.start
case "tcp":
l, err := s.initTcpSocket(addr)
if err != nil {
return nil, err
}
ls = append(ls, l)
case "unix":
l, err := sockets.NewUnixSocket(addr, s.cfg.SocketGroup, s.start)
if err != nil {
return nil, err
}
ls = append(ls, l)
default:
return nil, fmt.Errorf("Invalid protocol format: %q", proto)
}
return nil
var res []serverCloser
for _, l := range ls {
res = append(res, &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
})
}
return res, nil
}
// Called through eng.Job("acceptconnections")
func AcceptConnections(job *engine.Job) engine.Status {
func (s *Server) AcceptConnections(d *daemon.Daemon) {
// Tell the init daemon we are accepting requests
s.daemon = d
go systemd.SdNotify("READY=1")
// close the lock so the listeners start accepting connections
select {
case <-activationLock:
case <-s.start:
default:
close(activationLock)
close(s.start)
}
}
func allocateDaemonPort(addr string) error {
host, port, err := net.SplitHostPort(addr)
if err != nil {
return err
}
return engine.StatusOK
intPort, err := strconv.Atoi(port)
if err != nil {
return err
}
var hostIPs []net.IP
if parsedIP := net.ParseIP(host); parsedIP != nil {
hostIPs = append(hostIPs, parsedIP)
} else if hostIPs, err = net.LookupIP(host); err != nil {
return fmt.Errorf("failed to lookup %s address in host specification", host)
}
pa := portallocator.Get()
for _, hostIP := range hostIPs {
if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
}
}
return nil
}

View File

@@ -1,553 +0,0 @@
package server
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"reflect"
"strings"
"testing"
"github.com/docker/docker/api"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/version"
)
func TestGetBoolParam(t *testing.T) {
if ret, err := getBoolParam("true"); err != nil || !ret {
t.Fatalf("true -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("True"); err != nil || !ret {
t.Fatalf("True -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("1"); err != nil || !ret {
t.Fatalf("1 -> true, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam(""); err != nil || ret {
t.Fatalf("\"\" -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("false"); err != nil || ret {
t.Fatalf("false -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("0"); err != nil || ret {
t.Fatalf("0 -> false, nil | got %t %s", ret, err)
}
if ret, err := getBoolParam("faux"); err == nil || ret {
t.Fatalf("faux -> false, err | got %t %s", ret, err)
}
}
func TesthttpError(t *testing.T) {
r := httptest.NewRecorder()
httpError(r, fmt.Errorf("No such method"))
if r.Code != http.StatusNotFound {
t.Fatalf("Expected %d, got %d", http.StatusNotFound, r.Code)
}
httpError(r, fmt.Errorf("This accound hasn't been activated"))
if r.Code != http.StatusForbidden {
t.Fatalf("Expected %d, got %d", http.StatusForbidden, r.Code)
}
httpError(r, fmt.Errorf("Some error"))
if r.Code != http.StatusInternalServerError {
t.Fatalf("Expected %d, got %d", http.StatusInternalServerError, r.Code)
}
}
func TestGetVersion(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("version", func(job *engine.Job) engine.Status {
called = true
v := &engine.Env{}
v.SetJson("Version", "42.1")
v.Set("ApiVersion", "1.1.1.1.1")
v.Set("GoVersion", "2.42")
v.Set("Os", "Linux")
v.Set("Arch", "x86_64")
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/version", nil, eng, t)
if !called {
t.Fatalf("handler was not called")
}
v := readEnv(r.Body, t)
if v.Get("Version") != "42.1" {
t.Fatalf("%#v\n", v)
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
}
func TestGetInfo(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("info", func(job *engine.Job) engine.Status {
called = true
v := &engine.Env{}
v.SetInt("Containers", 1)
v.SetInt("Images", 42000)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/info", nil, eng, t)
if !called {
t.Fatalf("handler was not called")
}
v := readEnv(r.Body, t)
if v.GetInt("Images") != 42000 {
t.Fatalf("%#v\n", v)
}
if v.GetInt("Containers") != 1 {
t.Fatalf("%#v\n", v)
}
assertContentType(r, "application/json", t)
}
func TestGetImagesJSON(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("images", func(job *engine.Job) engine.Status {
called = true
v := createEnvFromGetImagesJSONStruct(sampleImage)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/images/json", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
assertHttpNotError(r, t)
assertContentType(r, "application/json", t)
var observed getImagesJSONStruct
if err := json.Unmarshal(r.Body.Bytes(), &observed); err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(observed, sampleImage) {
t.Errorf("Expected %#v but got %#v", sampleImage, observed)
}
}
func TestGetImagesJSONFilter(t *testing.T) {
eng := engine.New()
filter := "nothing"
eng.Register("images", func(job *engine.Job) engine.Status {
filter = job.Getenv("filter")
return engine.StatusOK
})
serveRequest("GET", "/images/json?filter=aaaa", nil, eng, t)
if filter != "aaaa" {
t.Errorf("%#v", filter)
}
}
func TestGetImagesJSONFilters(t *testing.T) {
eng := engine.New()
filter := "nothing"
eng.Register("images", func(job *engine.Job) engine.Status {
filter = job.Getenv("filters")
return engine.StatusOK
})
serveRequest("GET", "/images/json?filters=nnnn", nil, eng, t)
if filter != "nnnn" {
t.Errorf("%#v", filter)
}
}
func TestGetImagesJSONAll(t *testing.T) {
eng := engine.New()
allFilter := "-1"
eng.Register("images", func(job *engine.Job) engine.Status {
allFilter = job.Getenv("all")
return engine.StatusOK
})
serveRequest("GET", "/images/json?all=1", nil, eng, t)
if allFilter != "1" {
t.Errorf("%#v", allFilter)
}
}
func TestGetImagesJSONLegacyFormat(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("images", func(job *engine.Job) engine.Status {
called = true
outsLegacy := engine.NewTable("Created", 0)
outsLegacy.Add(createEnvFromGetImagesJSONStruct(sampleImage))
if _, err := outsLegacy.WriteListTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequestUsingVersion("GET", "/images/json", "1.6", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
assertHttpNotError(r, t)
assertContentType(r, "application/json", t)
images := engine.NewTable("Created", 0)
if _, err := images.ReadListFrom(r.Body.Bytes()); err != nil {
t.Fatal(err)
}
if images.Len() != 1 {
t.Fatalf("Expected 1 image, %d found", images.Len())
}
image := images.Data[0]
if image.Get("Tag") != "test-tag" {
t.Errorf("Expected tag 'test-tag', found '%s'", image.Get("Tag"))
}
if image.Get("Repository") != "test-name" {
t.Errorf("Expected repository 'test-name', found '%s'", image.Get("Repository"))
}
}
func TestGetContainersByName(t *testing.T) {
eng := engine.New()
name := "container_name"
var called bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
called = true
if job.Args[0] != name {
t.Errorf("name != '%s': %#v", name, job.Args[0])
}
if api.APIVERSION.LessThan("1.12") && !job.GetenvBool("dirty") {
t.Errorf("dirty env variable not set")
} else if api.APIVERSION.GreaterThanOrEqualTo("1.12") && job.GetenvBool("dirty") {
t.Errorf("dirty env variable set when it shouldn't")
}
v := &engine.Env{}
v.SetBool("dirty", true)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/containers/"+name+"/json", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
assertContentType(r, "application/json", t)
var stdoutJson interface{}
if err := json.Unmarshal(r.Body.Bytes(), &stdoutJson); err != nil {
t.Fatalf("%#v", err)
}
if stdoutJson.(map[string]interface{})["dirty"].(float64) != 1 {
t.Fatalf("%#v", stdoutJson)
}
}
func TestGetEvents(t *testing.T) {
eng := engine.New()
var called bool
eng.Register("events", func(job *engine.Job) engine.Status {
called = true
since := job.Getenv("since")
if since != "1" {
t.Fatalf("'since' should be 1, found %#v instead", since)
}
until := job.Getenv("until")
if until != "0" {
t.Fatalf("'until' should be 0, found %#v instead", until)
}
v := &engine.Env{}
v.Set("since", since)
v.Set("until", until)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/events?since=1&until=0", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
assertContentType(r, "application/json", t)
var stdout_json struct {
Since int
Until int
}
if err := json.Unmarshal(r.Body.Bytes(), &stdout_json); err != nil {
t.Fatal(err)
}
if stdout_json.Since != 1 {
t.Errorf("since != 1: %#v", stdout_json.Since)
}
if stdout_json.Until != 0 {
t.Errorf("until != 0: %#v", stdout_json.Until)
}
}
func TestLogs(t *testing.T) {
eng := engine.New()
var inspect bool
var logs bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
inspect = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
return engine.StatusOK
})
expected := "logs"
eng.Register("logs", func(job *engine.Job) engine.Status {
logs = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
follow := job.Getenv("follow")
if follow != "1" {
t.Fatalf("follow: %s, must be 1", follow)
}
stdout := job.Getenv("stdout")
if stdout != "1" {
t.Fatalf("stdout %s, must be 1", stdout)
}
stderr := job.Getenv("stderr")
if stderr != "" {
t.Fatalf("stderr %s, must be empty", stderr)
}
timestamps := job.Getenv("timestamps")
if timestamps != "1" {
t.Fatalf("timestamps %s, must be 1", timestamps)
}
job.Stdout.Write([]byte(expected))
return engine.StatusOK
})
r := serveRequest("GET", "/containers/test/logs?follow=1&stdout=1&timestamps=1", nil, eng, t)
if r.Code != http.StatusOK {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusOK)
}
if !inspect {
t.Fatal("container_inspect job was not called")
}
if !logs {
t.Fatal("logs job was not called")
}
res := r.Body.String()
if res != expected {
t.Fatalf("Output %s, expected %s", res, expected)
}
}
func TestLogsNoStreams(t *testing.T) {
eng := engine.New()
var inspect bool
var logs bool
eng.Register("container_inspect", func(job *engine.Job) engine.Status {
inspect = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != "test" {
t.Fatalf("Container name %s, must be test", job.Args[0])
}
return engine.StatusOK
})
eng.Register("logs", func(job *engine.Job) engine.Status {
logs = true
return engine.StatusOK
})
r := serveRequest("GET", "/containers/test/logs", nil, eng, t)
if r.Code != http.StatusBadRequest {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusBadRequest)
}
if inspect {
t.Fatal("container_inspect job was called, but it shouldn't")
}
if logs {
t.Fatal("logs job was called, but it shouldn't")
}
res := strings.TrimSpace(r.Body.String())
expected := "Bad parameters: you must choose at least one stream"
if !strings.Contains(res, expected) {
t.Fatalf("Output %s, expected %s in it", res, expected)
}
}
func TestGetImagesHistory(t *testing.T) {
eng := engine.New()
imageName := "docker-test-image"
var called bool
eng.Register("history", func(job *engine.Job) engine.Status {
called = true
if len(job.Args) == 0 {
t.Fatal("Job arguments is empty")
}
if job.Args[0] != imageName {
t.Fatalf("name != '%s': %#v", imageName, job.Args[0])
}
v := &engine.Env{}
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/images/"+imageName+"/history", nil, eng, t)
if !called {
t.Fatalf("handler was not called")
}
if r.Code != http.StatusOK {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusOK)
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
}
func TestGetImagesByName(t *testing.T) {
eng := engine.New()
name := "image_name"
var called bool
eng.Register("image_inspect", func(job *engine.Job) engine.Status {
called = true
if job.Args[0] != name {
t.Fatalf("name != '%s': %#v", name, job.Args[0])
}
if api.APIVERSION.LessThan("1.12") && !job.GetenvBool("dirty") {
t.Fatal("dirty env variable not set")
} else if api.APIVERSION.GreaterThanOrEqualTo("1.12") && job.GetenvBool("dirty") {
t.Fatal("dirty env variable set when it shouldn't")
}
v := &engine.Env{}
v.SetBool("dirty", true)
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
})
r := serveRequest("GET", "/images/"+name+"/json", nil, eng, t)
if !called {
t.Fatal("handler was not called")
}
if r.HeaderMap.Get("Content-Type") != "application/json" {
t.Fatalf("%#v\n", r)
}
var stdoutJson interface{}
if err := json.Unmarshal(r.Body.Bytes(), &stdoutJson); err != nil {
t.Fatalf("%#v", err)
}
if stdoutJson.(map[string]interface{})["dirty"].(float64) != 1 {
t.Fatalf("%#v", stdoutJson)
}
}
func TestDeleteContainers(t *testing.T) {
eng := engine.New()
name := "foo"
var called bool
eng.Register("rm", func(job *engine.Job) engine.Status {
called = true
if len(job.Args) == 0 {
t.Fatalf("Job arguments is empty")
}
if job.Args[0] != name {
t.Fatalf("name != '%s': %#v", name, job.Args[0])
}
return engine.StatusOK
})
r := serveRequest("DELETE", "/containers/"+name, nil, eng, t)
if !called {
t.Fatalf("handler was not called")
}
if r.Code != http.StatusNoContent {
t.Fatalf("Got status %d, expected %d", r.Code, http.StatusNoContent)
}
}
func serveRequest(method, target string, body io.Reader, eng *engine.Engine, t *testing.T) *httptest.ResponseRecorder {
return serveRequestUsingVersion(method, target, api.APIVERSION, body, eng, t)
}
func serveRequestUsingVersion(method, target string, version version.Version, body io.Reader, eng *engine.Engine, t *testing.T) *httptest.ResponseRecorder {
r := httptest.NewRecorder()
req, err := http.NewRequest(method, target, body)
if err != nil {
t.Fatal(err)
}
ServeRequest(eng, version, r, req)
return r
}
func readEnv(src io.Reader, t *testing.T) *engine.Env {
out := engine.NewOutput()
v, err := out.AddEnv()
if err != nil {
t.Fatal(err)
}
if _, err := io.Copy(out, src); err != nil {
t.Fatal(err)
}
out.Close()
return v
}
func toJson(data interface{}, t *testing.T) io.Reader {
var buf bytes.Buffer
if err := json.NewEncoder(&buf).Encode(data); err != nil {
t.Fatal(err)
}
return &buf
}
func assertContentType(recorder *httptest.ResponseRecorder, content_type string, t *testing.T) {
if recorder.HeaderMap.Get("Content-Type") != content_type {
t.Fatalf("%#v\n", recorder)
}
}
// XXX: Duplicated from integration/utils_test.go, but maybe that's OK as that
// should die as soon as we converted all integration tests?
// assertHttpNotError expect the given response to not have an error.
// Otherwise the it causes the test to fail.
func assertHttpNotError(r *httptest.ResponseRecorder, t *testing.T) {
// Non-error http status are [200, 400)
if r.Code < http.StatusOK || r.Code >= http.StatusBadRequest {
t.Fatal(fmt.Errorf("Unexpected http error: %v", r.Code))
}
}
func createEnvFromGetImagesJSONStruct(data getImagesJSONStruct) *engine.Env {
v := &engine.Env{}
v.SetList("RepoTags", data.RepoTags)
v.Set("Id", data.Id)
v.SetInt64("Created", data.Created)
v.SetInt64("Size", data.Size)
v.SetInt64("VirtualSize", data.VirtualSize)
return v
}
type getImagesJSONStruct struct {
RepoTags []string
Id string
Created int64
Size int64
VirtualSize int64
}
var sampleImage getImagesJSONStruct = getImagesJSONStruct{
RepoTags: []string{"test-name:test-tag"},
Id: "ID",
Created: 999,
Size: 777,
VirtualSize: 666,
}

View File

@@ -3,29 +3,48 @@
package server
import (
"fmt"
"errors"
"net"
"net/http"
"github.com/docker/docker/engine"
"github.com/docker/docker/daemon"
)
// NewServer sets up the required Server and does protocol specific checking.
func NewServer(proto, addr string, job *engine.Job) (Server, error) {
// Basic error and sanity checking
func (s *Server) newServer(proto, addr string) (serverCloser, error) {
var (
err error
l net.Listener
)
switch proto {
case "tcp":
return setupTcpHttp(addr, job)
l, err = s.initTcpSocket(addr)
if err != nil {
return nil, err
}
default:
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
}
return &HttpServer{
&http.Server{
Addr: addr,
Handler: s.router,
},
l,
}, nil
}
// Called through eng.Job("acceptconnections")
func AcceptConnections(job *engine.Job) engine.Status {
func (s *Server) AcceptConnections(d *daemon.Daemon) {
s.daemon = d
// close the lock so the listeners start accepting connections
if activationLock != nil {
close(activationLock)
select {
case <-s.start:
default:
close(s.start)
}
return engine.StatusOK
}
func allocateDaemonPort(addr string) error {
return nil
}

View File

@@ -81,6 +81,7 @@ type Network struct {
type Stats struct {
Read time.Time `json:"read"`
Network Network `json:"network,omitempty"`
PreCpuStats CpuStats `json:"precpu_stats,omitempty"`
CpuStats CpuStats `json:"cpu_stats,omitempty"`
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
BlkioStats BlkioStats `json:"blkio_stats,omitempty"`

View File

@@ -1,5 +1,13 @@
package types
import (
"time"
"github.com/docker/docker/daemon/network"
"github.com/docker/docker/pkg/version"
"github.com/docker/docker/runconfig"
)
// ContainerCreateResponse contains the information returned to a client on the
// creation of a new container.
type ContainerCreateResponse struct {
@@ -9,3 +17,226 @@ type ContainerCreateResponse struct {
// Warnings are any warnings encountered during the creation of the container.
Warnings []string `json:"Warnings"`
}
// POST /containers/{name:.*}/exec
type ContainerExecCreateResponse struct {
// ID is the exec ID.
ID string `json:"Id"`
}
// POST /auth
type AuthResponse struct {
// Status is the authentication status
Status string `json:"Status"`
}
// POST "/containers/"+containerID+"/wait"
type ContainerWaitResponse struct {
// StatusCode is the status code of the wait job
StatusCode int `json:"StatusCode"`
}
// POST "/commit?container="+containerID
type ContainerCommitResponse struct {
ID string `json:"Id"`
}
// GET "/containers/{name:.*}/changes"
type ContainerChange struct {
Kind int
Path string
}
// GET "/images/{name:.*}/history"
type ImageHistory struct {
ID string `json:"Id"`
Created int64
CreatedBy string
Tags []string
Size int64
Comment string
}
// DELETE "/images/{name:.*}"
type ImageDelete struct {
Untagged string `json:",omitempty"`
Deleted string `json:",omitempty"`
}
// GET "/images/json"
type Image struct {
ID string `json:"Id"`
ParentId string
RepoTags []string
RepoDigests []string
Created int
Size int
VirtualSize int
Labels map[string]string
}
// GET "/images/{name:.*}/json"
type ImageInspect struct {
Id string
Parent string
Comment string
Created time.Time
Container string
ContainerConfig *runconfig.Config
DockerVersion string
Author string
Config *runconfig.Config
Architecture string
Os string
Size int64
VirtualSize int64
}
// GET "/containers/json"
type Port struct {
IP string `json:",omitempty"`
PrivatePort int
PublicPort int `json:",omitempty"`
Type string
}
type Container struct {
ID string `json:"Id"`
Names []string
Image string
Command string
Created int
Ports []Port
SizeRw int `json:",omitempty"`
SizeRootFs int `json:",omitempty"`
Labels map[string]string
Status string
}
// POST "/containers/"+containerID+"/copy"
type CopyConfig struct {
Resource string
}
// GET "/containers/{name:.*}/top"
type ContainerProcessList struct {
Processes [][]string
Titles []string
}
type Version struct {
Version string
ApiVersion version.Version
GitCommit string
GoVersion string
Os string
Arch string
KernelVersion string `json:",omitempty"`
Experimental bool `json:",omitempty"`
}
// GET "/info"
type Info struct {
ID string
Containers int
Images int
Driver string
DriverStatus [][2]string
MemoryLimit bool
SwapLimit bool
CpuCfsPeriod bool
CpuCfsQuota bool
IPv4Forwarding bool
Debug bool
NFd int
OomKillDisable bool
NGoroutines int
SystemTime string
ExecutionDriver string
LoggingDriver string
NEventsListener int
KernelVersion string
OperatingSystem string
IndexServerAddress string
RegistryConfig interface{}
InitSha1 string
InitPath string
NCPU int
MemTotal int64
DockerRootDir string
HttpProxy string
HttpsProxy string
NoProxy string
Name string
Labels []string
ExperimentalBuild bool
}
// This struct is a temp struct used by execStart
// Config fields is part of ExecConfig in runconfig package
type ExecStartCheck struct {
// ExecStart will first check if it's detached
Detach bool
// Check if there's a tty
Tty bool
}
type ContainerState struct {
Running bool
Paused bool
Restarting bool
OOMKilled bool
Dead bool
Pid int
ExitCode int
Error string
StartedAt time.Time
FinishedAt time.Time
}
// GET "/containers/{name:.*}/json"
type ContainerJSONBase struct {
Id string
Created time.Time
Path string
Args []string
State *ContainerState
Image string
NetworkSettings *network.Settings
ResolvConfPath string
HostnamePath string
HostsPath string
LogPath string
Name string
RestartCount int
Driver string
ExecDriver string
MountLabel string
ProcessLabel string
Volumes map[string]string
VolumesRW map[string]bool
AppArmorProfile string
ExecIDs []string
HostConfig *runconfig.HostConfig
}
type ContainerJSON struct {
*ContainerJSONBase
Config *runconfig.Config
}
// backcompatibility struct along with ContainerConfig
type ContainerJSONRaw struct {
*ContainerJSONBase
Config *ContainerConfig
}
type ContainerConfig struct {
*runconfig.Config
// backward compatibility, they now live in HostConfig
Memory int64
MemorySwap int64
CpuShares int64
Cpuset string
}

155
builder/bflag.go Normal file
View File

@@ -0,0 +1,155 @@
package builder
import (
"fmt"
"strings"
)
type FlagType int
const (
boolType FlagType = iota
stringType
)
type BuilderFlags struct {
Args []string // actual flags/args from cmd line
flags map[string]*Flag
used map[string]*Flag
Err error
}
type Flag struct {
bf *BuilderFlags
name string
flagType FlagType
Value string
}
func NewBuilderFlags() *BuilderFlags {
return &BuilderFlags{
flags: make(map[string]*Flag),
used: make(map[string]*Flag),
}
}
func (bf *BuilderFlags) AddBool(name string, def bool) *Flag {
flag := bf.addFlag(name, boolType)
if flag == nil {
return nil
}
if def {
flag.Value = "true"
} else {
flag.Value = "false"
}
return flag
}
func (bf *BuilderFlags) AddString(name string, def string) *Flag {
flag := bf.addFlag(name, stringType)
if flag == nil {
return nil
}
flag.Value = def
return flag
}
func (bf *BuilderFlags) addFlag(name string, flagType FlagType) *Flag {
if _, ok := bf.flags[name]; ok {
bf.Err = fmt.Errorf("Duplicate flag defined: %s", name)
return nil
}
newFlag := &Flag{
bf: bf,
name: name,
flagType: flagType,
}
bf.flags[name] = newFlag
return newFlag
}
func (fl *Flag) IsUsed() bool {
if _, ok := fl.bf.used[fl.name]; ok {
return true
}
return false
}
func (fl *Flag) IsTrue() bool {
if fl.flagType != boolType {
// Should never get here
panic(fmt.Errorf("Trying to use IsTrue on a non-boolean: %s", fl.name))
}
return fl.Value == "true"
}
func (bf *BuilderFlags) Parse() error {
// If there was an error while defining the possible flags
// go ahead and bubble it back up here since we didn't do it
// earlier in the processing
if bf.Err != nil {
return fmt.Errorf("Error setting up flags: %s", bf.Err)
}
for _, arg := range bf.Args {
if !strings.HasPrefix(arg, "--") {
return fmt.Errorf("Arg should start with -- : %s", arg)
}
if arg == "--" {
return nil
}
arg = arg[2:]
value := ""
index := strings.Index(arg, "=")
if index >= 0 {
value = arg[index+1:]
arg = arg[:index]
}
flag, ok := bf.flags[arg]
if !ok {
return fmt.Errorf("Unknown flag: %s", arg)
}
if _, ok = bf.used[arg]; ok {
return fmt.Errorf("Duplicate flag specified: %s", arg)
}
bf.used[arg] = flag
switch flag.flagType {
case boolType:
// value == "" is only ok if no "=" was specified
if index >= 0 && value == "" {
return fmt.Errorf("Missing a value on flag: %s", arg)
}
lower := strings.ToLower(value)
if lower == "" {
flag.Value = "true"
} else if lower == "true" || lower == "false" {
flag.Value = lower
} else {
return fmt.Errorf("Expecting boolean value for flag %s, not: %s", arg, value)
}
case stringType:
if index < 0 {
return fmt.Errorf("Missing a value on flag: %s", arg)
}
flag.Value = value
default:
panic(fmt.Errorf("No idea what kind of flag we have! Should never get here!"))
}
}
return nil
}

187
builder/bflag_test.go Normal file
View File

@@ -0,0 +1,187 @@
package builder
import (
"testing"
)
func TestBuilderFlags(t *testing.T) {
var expected string
var err error
// ---
bf := NewBuilderFlags()
bf.Args = []string{}
if err := bf.Parse(); err != nil {
t.Fatalf("Test1 of %q was supposed to work: %s", bf.Args, err)
}
// ---
bf = NewBuilderFlags()
bf.Args = []string{"--"}
if err := bf.Parse(); err != nil {
t.Fatalf("Test2 of %q was supposed to work: %s", bf.Args, err)
}
// ---
bf = NewBuilderFlags()
flStr1 := bf.AddString("str1", "")
flBool1 := bf.AddBool("bool1", false)
bf.Args = []string{}
if err = bf.Parse(); err != nil {
t.Fatalf("Test3 of %q was supposed to work: %s", bf.Args, err)
}
if flStr1.IsUsed() == true {
t.Fatalf("Test3 - str1 was not used!")
}
if flBool1.IsUsed() == true {
t.Fatalf("Test3 - bool1 was not used!")
}
// ---
bf = NewBuilderFlags()
flStr1 = bf.AddString("str1", "HI")
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{}
if err = bf.Parse(); err != nil {
t.Fatalf("Test4 of %q was supposed to work: %s", bf.Args, err)
}
if flStr1.Value != "HI" {
t.Fatalf("Str1 was supposed to default to: HI")
}
if flBool1.IsTrue() {
t.Fatalf("Bool1 was supposed to default to: false")
}
if flStr1.IsUsed() == true {
t.Fatalf("Str1 was not used!")
}
if flBool1.IsUsed() == true {
t.Fatalf("Bool1 was not used!")
}
// ---
bf = NewBuilderFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1"}
if err = bf.Parse(); err == nil {
t.Fatalf("Test %q was supposed to fail", bf.Args)
}
// ---
bf = NewBuilderFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1="}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
expected = ""
if flStr1.Value != expected {
t.Fatalf("Str1 (%q) should be: %q", flStr1.Value, expected)
}
// ---
bf = NewBuilderFlags()
flStr1 = bf.AddString("str1", "HI")
bf.Args = []string{"--str1=BYE"}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
expected = "BYE"
if flStr1.Value != expected {
t.Fatalf("Str1 (%q) should be: %q", flStr1.Value, expected)
}
// ---
bf = NewBuilderFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1"}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
if !flBool1.IsTrue() {
t.Fatalf("Test-b1 Bool1 was supposed to be true")
}
// ---
bf = NewBuilderFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=true"}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
if !flBool1.IsTrue() {
t.Fatalf("Test-b2 Bool1 was supposed to be true")
}
// ---
bf = NewBuilderFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=false"}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
if flBool1.IsTrue() {
t.Fatalf("Test-b3 Bool1 was supposed to be false")
}
// ---
bf = NewBuilderFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1=false1"}
if err = bf.Parse(); err == nil {
t.Fatalf("Test %q was supposed to fail", bf.Args)
}
// ---
bf = NewBuilderFlags()
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool2"}
if err = bf.Parse(); err == nil {
t.Fatalf("Test %q was supposed to fail", bf.Args)
}
// ---
bf = NewBuilderFlags()
flStr1 = bf.AddString("str1", "HI")
flBool1 = bf.AddBool("bool1", false)
bf.Args = []string{"--bool1", "--str1=BYE"}
if err = bf.Parse(); err != nil {
t.Fatalf("Test %q was supposed to work: %s", bf.Args, err)
}
if flStr1.Value != "BYE" {
t.Fatalf("Teset %s, str1 should be BYE", bf.Args)
}
if !flBool1.IsTrue() {
t.Fatalf("Teset %s, bool1 should be true", bf.Args)
}
}

View File

@@ -16,7 +16,6 @@ const (
Expose = "expose"
Volume = "volume"
User = "user"
Insert = "insert"
)
// Commands is list of all Dockerfile commands
@@ -35,5 +34,4 @@ var Commands = map[string]struct{}{
Expose: {},
Volume: {},
User: {},
Insert: {},
}

View File

@@ -12,10 +12,11 @@ import (
"io/ioutil"
"path/filepath"
"regexp"
"runtime"
"sort"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/nat"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/runconfig"
@@ -38,6 +39,9 @@ func nullDispatch(b *Builder, args []string, attributes map[string]bool, origina
// in the dockerfile available from the next statement on via ${foo}.
//
func env(b *Builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("ENV is not supported on Windows.")
}
if len(args) == 0 {
return fmt.Errorf("ENV requires at least one argument")
}
@@ -47,6 +51,26 @@ func env(b *Builder, args []string, attributes map[string]bool, original string)
return fmt.Errorf("Bad input to ENV, too many args")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
// TODO/FIXME/NOT USED
// Just here to show how to use the builder flags stuff within the
// context of a builder command. Will remove once we actually add
// a builder command to something!
/*
flBool1 := b.BuilderFlags.AddBool("bool1", false)
flStr1 := b.BuilderFlags.AddString("str1", "HI")
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
fmt.Printf("Bool1:%v\n", flBool1)
fmt.Printf("Str1:%v\n", flStr1)
*/
commitStr := "ENV"
for j := 0; j < len(args); j++ {
@@ -81,6 +105,10 @@ func maintainer(b *Builder, args []string, attributes map[string]bool, original
return fmt.Errorf("MAINTAINER requires exactly one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
b.maintainer = args[0]
return b.commit("", b.Config.Cmd, fmt.Sprintf("MAINTAINER %s", b.maintainer))
}
@@ -98,6 +126,10 @@ func label(b *Builder, args []string, attributes map[string]bool, original strin
return fmt.Errorf("Bad input to LABEL, too many args")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
commitStr := "LABEL"
if b.Config.Labels == nil {
@@ -126,6 +158,10 @@ func add(b *Builder, args []string, attributes map[string]bool, original string)
return fmt.Errorf("ADD requires at least two arguments")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
return b.runContextCommand(args, true, true, "ADD")
}
@@ -138,6 +174,10 @@ func dispatchCopy(b *Builder, args []string, attributes map[string]bool, origina
return fmt.Errorf("COPY requires at least two arguments")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
return b.runContextCommand(args, false, false, "COPY")
}
@@ -150,6 +190,10 @@ func from(b *Builder, args []string, attributes map[string]bool, original string
return fmt.Errorf("FROM requires one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
name := args[0]
if name == NoBaseImageSpecifier {
@@ -166,12 +210,12 @@ func from(b *Builder, args []string, attributes map[string]bool, original string
}
}
if err != nil {
if b.Daemon.Graph().IsNotExist(err) {
if b.Daemon.Graph().IsNotExist(err, name) {
image, err = b.pullImage(name)
}
// note that the top level err will still be !nil here if IsNotExist is
// not the error. This approach just simplifies hte logic a bit.
// not the error. This approach just simplifies the logic a bit.
if err != nil {
return err
}
@@ -194,6 +238,10 @@ func onbuild(b *Builder, args []string, attributes map[string]bool, original str
return fmt.Errorf("ONBUILD requires at least one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
triggerInstruction := strings.ToUpper(strings.TrimSpace(args[0]))
switch triggerInstruction {
case "ONBUILD":
@@ -217,6 +265,10 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
return fmt.Errorf("WORKDIR requires exactly one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
workdir := args[0]
if !filepath.IsAbs(workdir) {
@@ -231,10 +283,11 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
// RUN some command yo
//
// run a command and commit the image. Args are automatically prepended with
// 'sh -c' in the event there is only one argument. The difference in
// processing:
// 'sh -c' under linux or 'cmd /S /C' under Windows, in the event there is
// only one argument. The difference in processing:
//
// RUN echo hi # sh -c echo hi
// RUN echo hi # sh -c echo hi (Linux)
// RUN echo hi # cmd /S /C echo hi (Windows)
// RUN [ "echo", "hi" ] # echo hi
//
func run(b *Builder, args []string, attributes map[string]bool, original string) error {
@@ -242,10 +295,18 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
return fmt.Errorf("Please provide a source image with `from` prior to run")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
args = handleJsonArgs(args, attributes)
if !attributes["json"] {
args = append([]string{"/bin/sh", "-c"}, args...)
if runtime.GOOS != "windows" {
args = append([]string{"/bin/sh", "-c"}, args...)
} else {
args = append([]string{"cmd", "/S /C"}, args...)
}
}
runCmd := flag.NewFlagSet("run", flag.ContinueOnError)
@@ -262,9 +323,9 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
b.Config.Cmd = config.Cmd
runconfig.Merge(b.Config, config)
defer func(cmd []string) { b.Config.Cmd = cmd }(cmd)
defer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)
log.Debugf("[BUILDER] Command to be executed: %v", b.Config.Cmd)
logrus.Debugf("[BUILDER] Command to be executed: %v", b.Config.Cmd)
hit, err := b.probeCache()
if err != nil {
@@ -301,13 +362,23 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
// Argument handling is the same as RUN.
//
func cmd(b *Builder, args []string, attributes map[string]bool, original string) error {
b.Config.Cmd = handleJsonArgs(args, attributes)
if !attributes["json"] {
b.Config.Cmd = append([]string{"/bin/sh", "-c"}, b.Config.Cmd...)
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
if err := b.commit("", b.Config.Cmd, fmt.Sprintf("CMD %q", b.Config.Cmd)); err != nil {
cmdSlice := handleJsonArgs(args, attributes)
if !attributes["json"] {
if runtime.GOOS != "windows" {
cmdSlice = append([]string{"/bin/sh", "-c"}, cmdSlice...)
} else {
cmdSlice = append([]string{"cmd", "/S /C"}, cmdSlice...)
}
}
b.Config.Cmd = runconfig.NewCommand(cmdSlice...)
if err := b.commit("", b.Config.Cmd, fmt.Sprintf("CMD %q", cmdSlice)); err != nil {
return err
}
@@ -320,25 +391,33 @@ func cmd(b *Builder, args []string, attributes map[string]bool, original string)
// ENTRYPOINT /usr/sbin/nginx
//
// Set the entrypoint (which defaults to sh -c) to /usr/sbin/nginx. Will
// accept the CMD as the arguments to /usr/sbin/nginx.
// Set the entrypoint (which defaults to sh -c on linux, or cmd /S /C on Windows) to
// /usr/sbin/nginx. Will accept the CMD as the arguments to /usr/sbin/nginx.
//
// Handles command processing similar to CMD and RUN, only b.Config.Entrypoint
// is initialized at NewBuilder time instead of through argument parsing.
//
func entrypoint(b *Builder, args []string, attributes map[string]bool, original string) error {
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
parsed := handleJsonArgs(args, attributes)
switch {
case attributes["json"]:
// ENTRYPOINT ["echo", "hi"]
b.Config.Entrypoint = parsed
b.Config.Entrypoint = runconfig.NewEntrypoint(parsed...)
case len(parsed) == 0:
// ENTRYPOINT []
b.Config.Entrypoint = nil
default:
// ENTRYPOINT echo hi
b.Config.Entrypoint = []string{"/bin/sh", "-c", parsed[0]}
if runtime.GOOS != "windows" {
b.Config.Entrypoint = runconfig.NewEntrypoint("/bin/sh", "-c", parsed[0])
} else {
b.Config.Entrypoint = runconfig.NewEntrypoint("cmd", "/S /C", parsed[0])
}
}
// when setting the entrypoint if a CMD was not explicitly set then
@@ -366,6 +445,10 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
return fmt.Errorf("EXPOSE requires at least one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
if b.Config.ExposedPorts == nil {
b.Config.ExposedPorts = make(nat.PortSet)
}
@@ -406,10 +489,18 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
// ENTRYPOINT/CMD at container run time.
//
func user(b *Builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("USER is not supported on Windows.")
}
if len(args) != 1 {
return fmt.Errorf("USER requires exactly one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
b.Config.User = args[0]
return b.commit("", b.Config.Cmd, fmt.Sprintf("USER %v", args))
}
@@ -419,10 +510,17 @@ func user(b *Builder, args []string, attributes map[string]bool, original string
// Expose the volume /foo for use. Will also accept the JSON array form.
//
func volume(b *Builder, args []string, attributes map[string]bool, original string) error {
if runtime.GOOS == "windows" {
return fmt.Errorf("VOLUME is not supported on Windows.")
}
if len(args) == 0 {
return fmt.Errorf("VOLUME requires at least one argument")
}
if err := b.BuilderFlags.Parse(); err != nil {
return err
}
if b.Config.Volumes == nil {
b.Config.Volumes = map[string]struct{}{}
}
@@ -438,8 +536,3 @@ func volume(b *Builder, args []string, attributes map[string]bool, original stri
}
return nil
}
// INSERT is no longer accepted, but we still parse it.
func insert(b *Builder, args []string, attributes map[string]bool, original string) error {
return fmt.Errorf("INSERT has been deprecated. Please use ADD instead")
}

View File

@@ -1,4 +1,4 @@
// builder is the evaluation step in the Dockerfile parse/evaluate pipeline.
// Package builder is the evaluation step in the Dockerfile parse/evaluate pipeline.
//
// It incorporates a dispatch table based on the parser.Node values (see the
// parser package for more information) that are yielded from the parser itself.
@@ -20,32 +20,27 @@
package builder
import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github.com/docker/docker/builder/command"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/daemon"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/common"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/tarsum"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
var (
ErrDockerfileEmpty = errors.New("Dockerfile cannot be empty")
)
// Environment variable interpolation will happen on these statements only.
var replaceEnvAllowed = map[string]struct{}{
command.Env: {},
@@ -76,7 +71,6 @@ func init() {
command.Expose: expose,
command.Volume: volume,
command.User: user,
command.Insert: insert,
}
}
@@ -84,7 +78,6 @@ func init() {
// processing as it evaluates the parsing result.
type Builder struct {
Daemon *daemon.Daemon
Engine *engine.Engine
// effectively stdio for the run. Because it is not stdio, I said
// "Effectively". Do not use stdio anywhere in this package for any reason.
@@ -105,12 +98,12 @@ type Builder struct {
// the final configs of the Dockerfile but dont want the layers
disableCommit bool
AuthConfig *registry.AuthConfig
AuthConfigFile *registry.ConfigFile
AuthConfig *cliconfig.AuthConfig
ConfigFile *cliconfig.ConfigFile
// Deprecated, original writer used for ImagePull. To be removed.
OutOld io.Writer
StreamFormatter *utils.StreamFormatter
StreamFormatter *streamformatter.StreamFormatter
Config *runconfig.Config // runconfig for cmd, run, entrypoint etc.
@@ -122,15 +115,20 @@ type Builder struct {
image string // image name for commit processing
maintainer string // maintainer name. could probably be removed.
cmdSet bool // indicates is CMD was set in current Dockerfile
BuilderFlags *BuilderFlags // current cmd's BuilderFlags - temporary
context tarsum.TarSum // the context is a tarball that is uploaded by the client
contextPath string // the path of the temporary directory the local context is unpacked to (server side)
noBaseImage bool // indicates that this build does not start from any base image, but is being built from an empty file system.
// Set resource restrictions for build containers
cpuSetCpus string
cpuShares int64
memory int64
memorySwap int64
cpuSetCpus string
cpuSetMems string
cpuShares int64
cpuPeriod int64
cpuQuota int64
cgroupParent string
memory int64
memorySwap int64
cancelled <-chan struct{} // When closed, job was cancelled.
}
@@ -154,7 +152,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
defer func() {
if err := os.RemoveAll(b.contextPath); err != nil {
log.Debugf("[BUILDER] failed to remove temporary context: %s", err)
logrus.Debugf("[BUILDER] failed to remove temporary context: %s", err)
}
}()
@@ -170,7 +168,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
for i, n := range b.dockerfile.Children {
select {
case <-b.cancelled:
log.Debug("Builder: build cancelled!")
logrus.Debug("Builder: build cancelled!")
fmt.Fprintf(b.OutStream, "Build cancelled")
return "", fmt.Errorf("Build cancelled")
default:
@@ -182,7 +180,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
}
return "", err
}
fmt.Fprintf(b.OutStream, " ---> %s\n", common.TruncateID(b.image))
fmt.Fprintf(b.OutStream, " ---> %s\n", stringid.TruncateID(b.image))
if b.Remove {
b.clearTmp()
}
@@ -192,7 +190,7 @@ func (b *Builder) Run(context io.Reader) (string, error) {
return "", fmt.Errorf("No image was generated. Is your Dockerfile empty?")
}
fmt.Fprintf(b.OutStream, "Successfully built %s\n", common.TruncateID(b.image))
fmt.Fprintf(b.OutStream, "Successfully built %s\n", stringid.TruncateID(b.image))
return b.image, nil
}
@@ -225,7 +223,7 @@ func (b *Builder) readDockerfile() error {
return fmt.Errorf("Cannot locate specified Dockerfile: %s", origFile)
}
if fi.Size() == 0 {
return ErrDockerfileEmpty
return fmt.Errorf("The Dockerfile (%s) cannot be empty", origFile)
}
f, err := os.Open(filename)
@@ -280,9 +278,14 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
cmd := ast.Value
attrs := ast.Attributes
original := ast.Original
flags := ast.Flags
strs := []string{}
msg := fmt.Sprintf("Step %d : %s", stepN, strings.ToUpper(cmd))
if len(ast.Flags) > 0 {
msg += " " + strings.Join(ast.Flags, " ")
}
if cmd == "onbuild" {
if ast.Next == nil {
return fmt.Errorf("ONBUILD requires at least one argument")
@@ -290,6 +293,11 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
ast = ast.Next.Children[0]
strs = append(strs, ast.Value)
msg += " " + ast.Value
if len(ast.Flags) > 0 {
msg += " " + strings.Join(ast.Flags, " ")
}
}
// count the number of nodes that we are going to traverse first
@@ -329,6 +337,8 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
// XXX yes, we skip any cmds that are not valid; the parser should have
// picked these out already.
if f, ok := evaluateTable[cmd]; ok {
b.BuilderFlags = NewBuilderFlags()
b.BuilderFlags.Args = flags
return f(b, strList, attrs, original)
}

View File

@@ -19,23 +19,24 @@ import (
"syscall"
"time"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/daemon"
"github.com/docker/docker/graph"
imagepkg "github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/common"
"github.com/docker/docker/pkg/httputils"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/pkg/tarsum"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
func (b *Builder) readContext(context io.Reader) error {
@@ -61,7 +62,7 @@ func (b *Builder) readContext(context io.Reader) error {
return nil
}
func (b *Builder) commit(id string, autoCmd []string, comment string) error {
func (b *Builder) commit(id string, autoCmd *runconfig.Command, comment string) error {
if b.disableCommit {
return nil
}
@@ -71,8 +72,8 @@ func (b *Builder) commit(id string, autoCmd []string, comment string) error {
b.Config.Image = b.image
if id == "" {
cmd := b.Config.Cmd
b.Config.Cmd = []string{"/bin/sh", "-c", "#(nop) " + comment}
defer func(cmd []string) { b.Config.Cmd = cmd }(cmd)
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", "#(nop) "+comment)
defer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)
hit, err := b.probeCache()
if err != nil {
@@ -146,8 +147,16 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
// do the copy (e.g. hash value if cached). Don't actually do
// the copy until we've looked at all src files
for _, orig := range args[0 : len(args)-1] {
err := calcCopyInfo(b, cmdName, &copyInfos, orig, dest, allowRemote, allowDecompression)
if err != nil {
if err := calcCopyInfo(
b,
cmdName,
&copyInfos,
orig,
dest,
allowRemote,
allowDecompression,
true,
); err != nil {
return err
}
}
@@ -182,8 +191,8 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
}
cmd := b.Config.Cmd
b.Config.Cmd = []string{"/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest)}
defer func(cmd []string) { b.Config.Cmd = cmd }(cmd)
b.Config.Cmd = runconfig.NewCommand("/bin/sh", "-c", fmt.Sprintf("#(nop) %s %s in %s", cmdName, srcHash, dest))
defer func(cmd *runconfig.Command) { b.Config.Cmd = cmd }(cmd)
hit, err := b.probeCache()
if err != nil {
@@ -217,7 +226,7 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowDecomp
return nil
}
func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath string, destPath string, allowRemote bool, allowDecompression bool) error {
func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath string, destPath string, allowRemote bool, allowDecompression bool, allowWildcards bool) error {
if origPath != "" && origPath[0] == '/' && len(origPath) > 1 {
origPath = origPath[1:]
@@ -250,7 +259,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
*cInfos = append(*cInfos, &ci)
// Initiate the download
resp, err := utils.Download(ci.origPath)
resp, err := httputils.Download(ci.origPath)
if err != nil {
return err
}
@@ -342,7 +351,7 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
}
// Deal with wildcards
if ContainsWildcards(origPath) {
if allowWildcards && ContainsWildcards(origPath) {
for _, fileInfo := range b.context.GetSums() {
if fileInfo.Name() == "" {
continue
@@ -352,7 +361,9 @@ func calcCopyInfo(b *Builder, cmdName string, cInfos *[]*copyInfo, origPath stri
continue
}
calcCopyInfo(b, cmdName, cInfos, fileInfo.Name(), destPath, allowRemote, allowDecompression)
// Note we set allowWildcards to false in case the name has
// a * in it
calcCopyInfo(b, cmdName, cInfos, fileInfo.Name(), destPath, allowRemote, allowDecompression, false)
}
return nil
}
@@ -434,24 +445,27 @@ func (b *Builder) pullImage(name string) (*imagepkg.Image, error) {
if tag == "" {
tag = "latest"
}
job := b.Engine.Job("pull", remote, tag)
pullRegistryAuth := b.AuthConfig
if len(b.AuthConfigFile.Configs) > 0 {
if len(b.ConfigFile.AuthConfigs) > 0 {
// The request came with a full auth config file, we prefer to use that
repoInfo, err := registry.ResolveRepositoryInfo(job, remote)
repoInfo, err := b.Daemon.RegistryService.ResolveRepository(remote)
if err != nil {
return nil, err
}
resolvedAuth := b.AuthConfigFile.ResolveAuthConfig(repoInfo.Index)
resolvedAuth := registry.ResolveAuthConfig(b.ConfigFile, repoInfo.Index)
pullRegistryAuth = &resolvedAuth
}
job.SetenvBool("json", b.StreamFormatter.Json())
job.SetenvBool("parallel", true)
job.SetenvJson("authConfig", pullRegistryAuth)
job.Stdout.Add(ioutils.NopWriteCloser(b.OutOld))
if err := job.Run(); err != nil {
imagePullConfig := &graph.ImagePullConfig{
AuthConfig: pullRegistryAuth,
OutStream: ioutils.NopWriteCloser(b.OutOld),
}
if err := b.Daemon.Repositories().Pull(remote, tag, imagePullConfig); err != nil {
return nil, err
}
image, err := b.Daemon.Repositories().LookupImage(name)
if err != nil {
return nil, err
@@ -476,7 +490,7 @@ func (b *Builder) processImageFrom(img *imagepkg.Image) error {
fmt.Fprintf(b.ErrStream, "# Executing %d build triggers\n", nTriggers)
}
// Copy the ONBUILD triggers, and remove them from the config, since the config will be commited.
// Copy the ONBUILD triggers, and remove them from the config, since the config will be committed.
onBuildTriggers := b.Config.OnBuild
b.Config.OnBuild = []string{}
@@ -521,13 +535,13 @@ func (b *Builder) probeCache() (bool, error) {
return false, err
}
if cache == nil {
log.Debugf("[BUILDER] Cache miss")
logrus.Debugf("[BUILDER] Cache miss")
b.cacheBusted = true
return false, nil
}
fmt.Fprintf(b.OutStream, " ---> Using cache\n")
log.Debugf("[BUILDER] Use cached version")
logrus.Debugf("[BUILDER] Use cached version")
b.image = cache.ID
return true, nil
}
@@ -539,10 +553,15 @@ func (b *Builder) create() (*daemon.Container, error) {
b.Config.Image = b.image
hostConfig := &runconfig.HostConfig{
CpuShares: b.cpuShares,
CpusetCpus: b.cpuSetCpus,
Memory: b.memory,
MemorySwap: b.memorySwap,
CpuShares: b.cpuShares,
CpuPeriod: b.cpuPeriod,
CpuQuota: b.cpuQuota,
CpusetCpus: b.cpuSetCpus,
CpusetMems: b.cpuSetMems,
CgroupParent: b.cgroupParent,
Memory: b.memory,
MemorySwap: b.memorySwap,
NetworkMode: "bridge",
}
config := *b.Config
@@ -557,14 +576,15 @@ func (b *Builder) create() (*daemon.Container, error) {
}
b.TmpContainers[c.ID] = struct{}{}
fmt.Fprintf(b.OutStream, " ---> Running in %s\n", common.TruncateID(c.ID))
fmt.Fprintf(b.OutStream, " ---> Running in %s\n", stringid.TruncateID(c.ID))
if len(config.Cmd) > 0 {
if config.Cmd.Len() > 0 {
// override the entry point that may have been picked up from the base image
c.Path = config.Cmd[0]
c.Args = config.Cmd[1:]
s := config.Cmd.Slice()
c.Path = s[0]
c.Args = s[1:]
} else {
config.Cmd = []string{}
config.Cmd = runconfig.NewCommand()
}
return c, nil
@@ -573,7 +593,7 @@ func (b *Builder) create() (*daemon.Container, error) {
func (b *Builder) run(c *daemon.Container) error {
var errCh chan error
if b.Verbose {
errCh = b.Daemon.Attach(&c.StreamConfig, c.Config.OpenStdin, c.Config.StdinOnce, c.Config.Tty, nil, b.OutStream, b.ErrStream)
errCh = c.Attach(nil, b.OutStream, b.ErrStream)
}
//start the container
@@ -586,7 +606,7 @@ func (b *Builder) run(c *daemon.Container) error {
go func() {
select {
case <-b.cancelled:
log.Debugln("Build cancelled, killing container:", c.ID)
logrus.Debugln("Build cancelled, killing container:", c.ID)
c.Kill()
case <-finished:
}
@@ -601,11 +621,10 @@ func (b *Builder) run(c *daemon.Container) error {
// Wait for it to finish
if ret, _ := c.WaitStop(-1 * time.Second); ret != 0 {
err := &utils.JSONError{
Message: fmt.Sprintf("The command %v returned a non-zero code: %d", b.Config.Cmd, ret),
return &jsonmessage.JSONError{
Message: fmt.Sprintf("The command '%s' returned a non-zero code: %d", b.Config.Cmd.ToString(), ret),
Code: ret,
}
return err
}
return nil
@@ -637,14 +656,12 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
err error
destExists = true
origPath = path.Join(b.contextPath, orig)
destPath = path.Join(container.RootfsPath(), dest)
destPath string
)
if destPath != container.RootfsPath() {
destPath, err = symlink.FollowSymlinkInScope(destPath, container.RootfsPath())
if err != nil {
return err
}
destPath, err = container.GetResourcePath(dest)
if err != nil {
return err
}
// Preserve the trailing '/'
@@ -687,7 +704,7 @@ func (b *Builder) addContext(container *daemon.Container, orig, dest string, dec
if err := chrootarchive.UntarPath(origPath, tarDest); err == nil {
return nil
} else if err != io.EOF {
log.Debugf("Couldn't untar %s to %s: %s", origPath, tarDest, err)
logrus.Debugf("Couldn't untar %s to %s: %s", origPath, tarDest, err)
}
}
@@ -747,17 +764,15 @@ func fixPermissions(source, destination string, uid, gid int, destExisted bool)
func (b *Builder) clearTmp() {
for c := range b.TmpContainers {
tmp, err := b.Daemon.Get(c)
if err != nil {
fmt.Fprint(b.OutStream, err.Error())
rmConfig := &daemon.ContainerRmConfig{
ForceRemove: true,
RemoveVolume: true,
}
if err := b.Daemon.Rm(tmp); err != nil {
fmt.Fprintf(b.OutStream, "Error removing intermediate container %s: %v\n", common.TruncateID(c), err)
if err := b.Daemon.ContainerRm(c, rmConfig); err != nil {
fmt.Fprintf(b.OutStream, "Error removing intermediate container %s: %v\n", stringid.TruncateID(c), err)
return
}
b.Daemon.DeleteVolumes(tmp.VolumePaths())
delete(b.TmpContainers, c)
fmt.Fprintf(b.OutStream, "Removing intermediate container %s\n", common.TruncateID(c))
fmt.Fprintf(b.OutStream, "Removing intermediate container %s\n", stringid.TruncateID(c))
}
}

View File

@@ -2,20 +2,22 @@ package builder
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strings"
"sync"
"github.com/docker/docker/api"
"github.com/docker/docker/builder/parser"
"github.com/docker/docker/cliconfig"
"github.com/docker/docker/daemon"
"github.com/docker/docker/engine"
"github.com/docker/docker/graph"
"github.com/docker/docker/graph/tags"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/httputils"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
@@ -34,169 +36,171 @@ var validCommitCommands = map[string]bool{
"onbuild": true,
}
type BuilderJob struct {
Engine *engine.Engine
Daemon *daemon.Daemon
type Config struct {
DockerfileName string
RemoteURL string
RepoName string
SuppressOutput bool
NoCache bool
Remove bool
ForceRemove bool
Pull bool
Memory int64
MemorySwap int64
CpuShares int64
CpuPeriod int64
CpuQuota int64
CpuSetCpus string
CpuSetMems string
CgroupParent string
AuthConfig *cliconfig.AuthConfig
ConfigFile *cliconfig.ConfigFile
Stdout io.Writer
Context io.ReadCloser
// When closed, the job has been cancelled.
// Note: not all jobs implement cancellation.
// See Job.Cancel() and Job.WaitCancelled()
cancelled chan struct{}
cancelOnce sync.Once
}
func (b *BuilderJob) Install() {
b.Engine.Register("build", b.CmdBuild)
b.Engine.Register("build_config", b.CmdBuildConfig)
// When called, causes the Job.WaitCancelled channel to unblock.
func (b *Config) Cancel() {
b.cancelOnce.Do(func() {
close(b.cancelled)
})
}
func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status {
if len(job.Args) != 0 {
return job.Errorf("Usage: %s\n", job.Name)
// Returns a channel which is closed ("never blocks") when the job is cancelled.
func (b *Config) WaitCancelled() <-chan struct{} {
return b.cancelled
}
func NewBuildConfig() *Config {
return &Config{
AuthConfig: &cliconfig.AuthConfig{},
ConfigFile: &cliconfig.ConfigFile{},
cancelled: make(chan struct{}),
}
}
func Build(d *daemon.Daemon, buildConfig *Config) error {
var (
dockerfileName = job.Getenv("dockerfile")
remoteURL = job.Getenv("remote")
repoName = job.Getenv("t")
suppressOutput = job.GetenvBool("q")
noCache = job.GetenvBool("nocache")
rm = job.GetenvBool("rm")
forceRm = job.GetenvBool("forcerm")
pull = job.GetenvBool("pull")
memory = job.GetenvInt64("memory")
memorySwap = job.GetenvInt64("memswap")
cpuShares = job.GetenvInt64("cpushares")
cpuSetCpus = job.Getenv("cpusetcpus")
authConfig = &registry.AuthConfig{}
configFile = &registry.ConfigFile{}
tag string
context io.ReadCloser
repoName string
tag string
context io.ReadCloser
)
job.GetenvJson("authConfig", authConfig)
job.GetenvJson("configFile", configFile)
repoName, tag = parsers.ParseRepositoryTag(repoName)
repoName, tag = parsers.ParseRepositoryTag(buildConfig.RepoName)
if repoName != "" {
if err := registry.ValidateRepositoryName(repoName); err != nil {
return job.Error(err)
return err
}
if len(tag) > 0 {
if err := graph.ValidateTagName(tag); err != nil {
return job.Error(err)
if err := tags.ValidateTagName(tag); err != nil {
return err
}
}
}
if remoteURL == "" {
context = ioutil.NopCloser(job.Stdin)
} else if urlutil.IsGitURL(remoteURL) {
if !urlutil.IsGitTransport(remoteURL) {
remoteURL = "https://" + remoteURL
}
root, err := ioutil.TempDir("", "docker-build-git")
if buildConfig.RemoteURL == "" {
context = ioutil.NopCloser(buildConfig.Context)
} else if urlutil.IsGitURL(buildConfig.RemoteURL) {
root, err := utils.GitClone(buildConfig.RemoteURL)
if err != nil {
return job.Error(err)
return err
}
defer os.RemoveAll(root)
if output, err := exec.Command("git", "clone", "--recursive", remoteURL, root).CombinedOutput(); err != nil {
return job.Errorf("Error trying to use git: %s (%s)", err, output)
}
c, err := archive.Tar(root, archive.Uncompressed)
if err != nil {
return job.Error(err)
return err
}
context = c
} else if urlutil.IsURL(remoteURL) {
f, err := utils.Download(remoteURL)
} else if urlutil.IsURL(buildConfig.RemoteURL) {
f, err := httputils.Download(buildConfig.RemoteURL)
if err != nil {
return job.Error(err)
return err
}
defer f.Body.Close()
dockerFile, err := ioutil.ReadAll(f.Body)
if err != nil {
return job.Error(err)
return err
}
// When we're downloading just a Dockerfile put it in
// the default name - don't allow the client to move/specify it
dockerfileName = api.DefaultDockerfileName
buildConfig.DockerfileName = api.DefaultDockerfileName
c, err := archive.Generate(dockerfileName, string(dockerFile))
c, err := archive.Generate(buildConfig.DockerfileName, string(dockerFile))
if err != nil {
return job.Error(err)
return err
}
context = c
}
defer context.Close()
sf := utils.NewStreamFormatter(job.GetenvBool("json"))
sf := streamformatter.NewJSONStreamFormatter()
builder := &Builder{
Daemon: b.Daemon,
Engine: b.Engine,
OutStream: &utils.StdoutFormater{
Writer: job.Stdout,
Daemon: d,
OutStream: &streamformatter.StdoutFormater{
Writer: buildConfig.Stdout,
StreamFormatter: sf,
},
ErrStream: &utils.StderrFormater{
Writer: job.Stdout,
ErrStream: &streamformatter.StderrFormater{
Writer: buildConfig.Stdout,
StreamFormatter: sf,
},
Verbose: !suppressOutput,
UtilizeCache: !noCache,
Remove: rm,
ForceRemove: forceRm,
Pull: pull,
OutOld: job.Stdout,
Verbose: !buildConfig.SuppressOutput,
UtilizeCache: !buildConfig.NoCache,
Remove: buildConfig.Remove,
ForceRemove: buildConfig.ForceRemove,
Pull: buildConfig.Pull,
OutOld: buildConfig.Stdout,
StreamFormatter: sf,
AuthConfig: authConfig,
AuthConfigFile: configFile,
dockerfileName: dockerfileName,
cpuShares: cpuShares,
cpuSetCpus: cpuSetCpus,
memory: memory,
memorySwap: memorySwap,
cancelled: job.WaitCancelled(),
AuthConfig: buildConfig.AuthConfig,
ConfigFile: buildConfig.ConfigFile,
dockerfileName: buildConfig.DockerfileName,
cpuShares: buildConfig.CpuShares,
cpuPeriod: buildConfig.CpuPeriod,
cpuQuota: buildConfig.CpuQuota,
cpuSetCpus: buildConfig.CpuSetCpus,
cpuSetMems: buildConfig.CpuSetMems,
cgroupParent: buildConfig.CgroupParent,
memory: buildConfig.Memory,
memorySwap: buildConfig.MemorySwap,
cancelled: buildConfig.WaitCancelled(),
}
id, err := builder.Run(context)
if err != nil {
return job.Error(err)
return err
}
if repoName != "" {
b.Daemon.Repositories().Set(repoName, tag, id, true)
return d.Repositories().Tag(repoName, tag, id, true)
}
return engine.StatusOK
return nil
}
func (b *BuilderJob) CmdBuildConfig(job *engine.Job) engine.Status {
if len(job.Args) != 0 {
return job.Errorf("Usage: %s\n", job.Name)
}
var (
changes = job.GetenvList("changes")
newConfig runconfig.Config
)
if err := job.GetenvJson("config", &newConfig); err != nil {
return job.Error(err)
}
func BuildFromConfig(d *daemon.Daemon, c *runconfig.Config, changes []string) (*runconfig.Config, error) {
ast, err := parser.Parse(bytes.NewBufferString(strings.Join(changes, "\n")))
if err != nil {
return job.Error(err)
return nil, err
}
// ensure that the commands are valid
for _, n := range ast.Children {
if !validCommitCommands[n.Value] {
return job.Errorf("%s is not a valid change command", n.Value)
return nil, fmt.Errorf("%s is not a valid change command", n.Value)
}
}
builder := &Builder{
Daemon: b.Daemon,
Engine: b.Engine,
Config: &newConfig,
Daemon: d,
Config: c,
OutStream: ioutil.Discard,
ErrStream: ioutil.Discard,
disableCommit: true,
@@ -204,12 +208,36 @@ func (b *BuilderJob) CmdBuildConfig(job *engine.Job) engine.Status {
for i, n := range ast.Children {
if err := builder.dispatch(i, n); err != nil {
return job.Error(err)
return nil, err
}
}
if err := json.NewEncoder(job.Stdout).Encode(builder.Config); err != nil {
return job.Error(err)
}
return engine.StatusOK
return builder.Config, nil
}
func Commit(d *daemon.Daemon, name string, c *daemon.ContainerCommitConfig) (string, error) {
container, err := d.Get(name)
if err != nil {
return "", err
}
if c.Config == nil {
c.Config = &runconfig.Config{}
}
newConfig, err := BuildFromConfig(d, c.Config, c.Changes)
if err != nil {
return "", err
}
if err := runconfig.Merge(newConfig, container.Config); err != nil {
return "", err
}
img, err := d.Commit(container, c.Repo, c.Tag, c.Comment, c.Author, c.Pause, newConfig)
if err != nil {
return "", err
}
return img.ID, nil
}

View File

@@ -233,23 +233,24 @@ func parseString(rest string) (*Node, map[string]bool, error) {
// parseJSON converts JSON arrays to an AST.
func parseJSON(rest string) (*Node, map[string]bool, error) {
var myJson []interface{}
if err := json.Unmarshal([]byte(rest), &myJson); err != nil {
if err := json.NewDecoder(strings.NewReader(rest)).Decode(&myJson); err != nil {
return nil, nil, err
}
var top, prev *Node
for _, str := range myJson {
if s, ok := str.(string); !ok {
s, ok := str.(string)
if !ok {
return nil, nil, errDockerfileNotStringArray
} else {
node := &Node{Value: s}
if prev == nil {
top = node
} else {
prev.Next = node
}
prev = node
}
node := &Node{Value: s}
if prev == nil {
top = node
} else {
prev.Next = node
}
prev = node
}
return top, map[string]bool{"json": true}, nil
@@ -278,7 +279,7 @@ func parseMaybeJSON(rest string) (*Node, map[string]bool, error) {
}
// parseMaybeJSONToList determines if the argument appears to be a JSON array. If
// so, passes to parseJSON; if not, attmpts to parse it as a whitespace
// so, passes to parseJSON; if not, attempts to parse it as a whitespace
// delimited string.
func parseMaybeJSONToList(rest string) (*Node, map[string]bool, error) {
node, attrs, err := parseJSON(rest)

View File

@@ -29,6 +29,7 @@ type Node struct {
Children []*Node // the children of this sexp
Attributes map[string]bool // special attributes for this node
Original string // original line used before parsing
Flags []string // only top Node should have this set
}
var (
@@ -60,7 +61,6 @@ func init() {
command.Entrypoint: parseMaybeJSON,
command.Expose: parseStringsWhitespaceDelimited,
command.Volume: parseMaybeJSONToList,
command.Insert: parseIgnore,
}
}
@@ -75,7 +75,7 @@ func parseLine(line string) (string, *Node, error) {
return line, nil, nil
}
cmd, args, err := splitCommand(line)
cmd, flags, args, err := splitCommand(line)
if err != nil {
return "", nil, err
}
@@ -91,6 +91,7 @@ func parseLine(line string) (string, *Node, error) {
node.Next = sexp
node.Attributes = attrs
node.Original = line
node.Flags = flags
return "", node, nil
}

View File

@@ -0,0 +1,10 @@
FROM scratch
COPY foo /tmp/
COPY --user=me foo /tmp/
COPY --doit=true foo /tmp/
COPY --user=me --doit=true foo /tmp/
COPY --doit=true -- foo /tmp/
COPY -- foo /tmp/
CMD --doit [ "a", "b" ]
CMD --doit=true -- [ "a", "b" ]
CMD --doit -- [ ]

View File

@@ -0,0 +1,10 @@
(from "scratch")
(copy "foo" "/tmp/")
(copy ["--user=me"] "foo" "/tmp/")
(copy ["--doit=true"] "foo" "/tmp/")
(copy ["--user=me" "--doit=true"] "foo" "/tmp/")
(copy ["--doit=true"] "foo" "/tmp/")
(copy "foo" "/tmp/")
(cmd ["--doit"] "a" "b")
(cmd ["--doit=true"] "a" "b")
(cmd ["--doit"])

View File

@@ -1,8 +1,10 @@
package parser
import (
"fmt"
"strconv"
"strings"
"unicode"
)
// dumps the AST defined by `node` as a list of sexps. Returns a string
@@ -11,6 +13,10 @@ func (node *Node) Dump() string {
str := ""
str += node.Value
if len(node.Flags) > 0 {
str += fmt.Sprintf(" %q", node.Flags)
}
for _, n := range node.Children {
str += "(" + n.Dump() + ")\n"
}
@@ -48,20 +54,23 @@ func fullDispatch(cmd, args string) (*Node, map[string]bool, error) {
// splitCommand takes a single line of text and parses out the cmd and args,
// which are used for dispatching to more exact parsing functions.
func splitCommand(line string) (string, string, error) {
func splitCommand(line string) (string, []string, string, error) {
var args string
var flags []string
// Make sure we get the same results irrespective of leading/trailing spaces
cmdline := TOKEN_WHITESPACE.Split(strings.TrimSpace(line), 2)
cmd := strings.ToLower(cmdline[0])
if len(cmdline) == 2 {
args = strings.TrimSpace(cmdline[1])
var err error
args, flags, err = extractBuilderFlags(cmdline[1])
if err != nil {
return "", nil, "", err
}
}
// the cmd should never have whitespace, but it's possible for the args to
// have trailing whitespace.
return cmd, args, nil
return cmd, flags, strings.TrimSpace(args), nil
}
// covers comments and empty lines. Lines should be trimmed before passing to
@@ -74,3 +83,94 @@ func stripComments(line string) string {
return line
}
func extractBuilderFlags(line string) (string, []string, error) {
// Parses the BuilderFlags and returns the remaining part of the line
const (
inSpaces = iota // looking for start of a word
inWord
inQuote
)
words := []string{}
phase := inSpaces
word := ""
quote := '\000'
blankOK := false
var ch rune
for pos := 0; pos <= len(line); pos++ {
if pos != len(line) {
ch = rune(line[pos])
}
if phase == inSpaces { // Looking for start of word
if pos == len(line) { // end of input
break
}
if unicode.IsSpace(ch) { // skip spaces
continue
}
// Only keep going if the next word starts with --
if ch != '-' || pos+1 == len(line) || rune(line[pos+1]) != '-' {
return line[pos:], words, nil
}
phase = inWord // found someting with "--", fall thru
}
if (phase == inWord || phase == inQuote) && (pos == len(line)) {
if word != "--" && (blankOK || len(word) > 0) {
words = append(words, word)
}
break
}
if phase == inWord {
if unicode.IsSpace(ch) {
phase = inSpaces
if word == "--" {
return line[pos:], words, nil
}
if blankOK || len(word) > 0 {
words = append(words, word)
}
word = ""
blankOK = false
continue
}
if ch == '\'' || ch == '"' {
quote = ch
blankOK = true
phase = inQuote
continue
}
if ch == '\\' {
if pos+1 == len(line) {
continue // just skip \ at end
}
pos++
ch = rune(line[pos])
}
word += string(ch)
continue
}
if phase == inQuote {
if ch == quote {
phase = inWord
continue
}
if ch == '\\' {
if pos+1 == len(line) {
phase = inWord
continue // just skip \ at end
}
pos++
ch = rune(line[pos])
}
word += string(ch)
}
}
return "", words, nil
}

View File

@@ -157,15 +157,47 @@ func (sw *shellWord) processDollar() (string, error) {
sw.next()
return sw.getEnv(name), nil
}
return "", fmt.Errorf("Unsupported ${} substitution: %s", sw.word)
} else {
// $xxx case
name := sw.processName()
if name == "" {
return "$", nil
if ch == ':' {
// Special ${xx:...} format processing
// Yes it allows for recursive $'s in the ... spot
sw.next() // skip over :
modifier := sw.next()
word, err := sw.processStopOn('}')
if err != nil {
return "", err
}
// Grab the current value of the variable in question so we
// can use to to determine what to do based on the modifier
newValue := sw.getEnv(name)
switch modifier {
case '+':
if newValue != "" {
newValue = word
}
return newValue, nil
case '-':
if newValue == "" {
newValue = word
}
return newValue, nil
default:
return "", fmt.Errorf("Unsupported modifier (%c) in substitution: %s", modifier, sw.word)
}
}
return sw.getEnv(name), nil
return "", fmt.Errorf("Missing ':' in substitution: %s", sw.word)
}
// $xxx case
name := sw.processName()
if name == "" {
return "$", nil
}
return sw.getEnv(name), nil
}
func (sw *shellWord) processName() string {

View File

@@ -15,7 +15,7 @@ hello\\ | hello\
'hello\' | hello\
"''" | ''
$. | $.
$1 |
$1 |
he$1x | hex
he$.x | he$.x
he$pwd. | he.
@@ -30,6 +30,17 @@ he${hi} | he
he${hi}xx | hexx
he${PWD} | he/home
he${.} | error
he${XXX:-000}xx | he000xx
he${PWD:-000}xx | he/homexx
he${XXX:-$PWD}xx | he/homexx
he${XXX:-${PWD:-yyy}}xx | he/homexx
he${XXX:-${YYY:-yyy}}xx | heyyyxx
he${XXX:YYY} | error
he${XXX:+${PWD}}xx | hexx
he${PWD:+${XXX}}xx | hexx
he${PWD:+${SHELL}}xx | hebashxx
he${XXX:+000}xx | hexx
he${PWD:+000}xx | he000xx
'he${XX}' | he${XX}
"he${PWD}" | he/home
"he'$PWD'" | he'/home'
@@ -41,3 +52,7 @@ he\$PWD | he$PWD
"he\$PWD" | he$PWD
'he\$PWD' | he\$PWD
he${PWD | error
he${PWD:=000}xx | error
he${PWD:+${PWD}:}xx | he/home:xx
he${XXX:-\$PWD:}xx | he$PWD:xx
he${XXX:-\${PWD}z}xx | he${PWDz}xx

View File

@@ -1,75 +0,0 @@
package builtins
import (
"runtime"
"github.com/docker/docker/api"
apiserver "github.com/docker/docker/api/server"
"github.com/docker/docker/autogen/dockerversion"
"github.com/docker/docker/daemon/networkdriver/bridge"
"github.com/docker/docker/engine"
"github.com/docker/docker/events"
"github.com/docker/docker/pkg/parsers/kernel"
)
func Register(eng *engine.Engine) error {
if err := daemon(eng); err != nil {
return err
}
if err := remote(eng); err != nil {
return err
}
if err := events.New().Install(eng); err != nil {
return err
}
if err := eng.Register("version", dockerVersion); err != nil {
return err
}
return nil
}
// remote: a RESTful api for cross-docker communication
func remote(eng *engine.Engine) error {
if err := eng.Register("serveapi", apiserver.ServeApi); err != nil {
return err
}
return eng.Register("acceptconnections", apiserver.AcceptConnections)
}
// daemon: a default execution and storage backend for Docker on Linux,
// with the following underlying components:
//
// * Pluggable storage drivers including aufs, vfs, lvm and btrfs.
// * Pluggable execution drivers including lxc and chroot.
//
// In practice `daemon` still includes most core Docker components, including:
//
// * The reference registry client implementation
// * Image management
// * The build facility
// * Logging
//
// These components should be broken off into plugins of their own.
//
func daemon(eng *engine.Engine) error {
return eng.Register("init_networkdriver", bridge.InitDriver)
}
// builtins jobs independent of any subsystem
func dockerVersion(job *engine.Job) engine.Status {
v := &engine.Env{}
v.SetJson("Version", dockerversion.VERSION)
v.SetJson("ApiVersion", api.APIVERSION)
v.SetJson("GitCommit", dockerversion.GITCOMMIT)
v.Set("GoVersion", runtime.Version())
v.Set("Os", runtime.GOOS)
v.Set("Arch", runtime.GOARCH)
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
v.Set("KernelVersion", kernelVersion.String())
}
if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
return engine.StatusOK
}

207
cliconfig/config.go Normal file
View File

@@ -0,0 +1,207 @@
package cliconfig
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/homedir"
)
const (
// Where we store the config file
CONFIGFILE = "config.json"
OLD_CONFIGFILE = ".dockercfg"
// This constant is only used for really old config files when the
// URL wasn't saved as part of the config file and it was just
// assumed to be this value.
DEFAULT_INDEXSERVER = "https://index.docker.io/v1/"
)
var (
ErrConfigFileMissing = errors.New("The Auth config file is missing")
)
// Registry Auth Info
type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Auth string `json:"auth"`
Email string `json:"email"`
ServerAddress string `json:"serveraddress,omitempty"`
}
// ~/.docker/config.json file info
type ConfigFile struct {
AuthConfigs map[string]AuthConfig `json:"auths"`
HttpHeaders map[string]string `json:"HttpHeaders,omitempty"`
filename string // Note: not serialized - for internal use only
}
func NewConfigFile(fn string) *ConfigFile {
return &ConfigFile{
AuthConfigs: make(map[string]AuthConfig),
HttpHeaders: make(map[string]string),
filename: fn,
}
}
// load up the auth config information and return values
// FIXME: use the internal golang config parser
func Load(configDir string) (*ConfigFile, error) {
if configDir == "" {
configDir = filepath.Join(homedir.Get(), ".docker")
}
configFile := ConfigFile{
AuthConfigs: make(map[string]AuthConfig),
filename: filepath.Join(configDir, CONFIGFILE),
}
// Try happy path first - latest config file
if _, err := os.Stat(configFile.filename); err == nil {
file, err := os.Open(configFile.filename)
if err != nil {
return &configFile, err
}
defer file.Close()
if err := json.NewDecoder(file).Decode(&configFile); err != nil {
return &configFile, err
}
for addr, ac := range configFile.AuthConfigs {
ac.Username, ac.Password, err = DecodeAuth(ac.Auth)
if err != nil {
return &configFile, err
}
ac.Auth = ""
ac.ServerAddress = addr
configFile.AuthConfigs[addr] = ac
}
return &configFile, nil
} else if !os.IsNotExist(err) {
// if file is there but we can't stat it for any reason other
// than it doesn't exist then stop
return &configFile, err
}
// Can't find latest config file so check for the old one
confFile := filepath.Join(homedir.Get(), OLD_CONFIGFILE)
if _, err := os.Stat(confFile); err != nil {
return &configFile, nil //missing file is not an error
}
b, err := ioutil.ReadFile(confFile)
if err != nil {
return &configFile, err
}
if err := json.Unmarshal(b, &configFile.AuthConfigs); err != nil {
arr := strings.Split(string(b), "\n")
if len(arr) < 2 {
return &configFile, fmt.Errorf("The Auth config file is empty")
}
authConfig := AuthConfig{}
origAuth := strings.Split(arr[0], " = ")
if len(origAuth) != 2 {
return &configFile, fmt.Errorf("Invalid Auth config file")
}
authConfig.Username, authConfig.Password, err = DecodeAuth(origAuth[1])
if err != nil {
return &configFile, err
}
origEmail := strings.Split(arr[1], " = ")
if len(origEmail) != 2 {
return &configFile, fmt.Errorf("Invalid Auth config file")
}
authConfig.Email = origEmail[1]
authConfig.ServerAddress = DEFAULT_INDEXSERVER
configFile.AuthConfigs[DEFAULT_INDEXSERVER] = authConfig
} else {
for k, authConfig := range configFile.AuthConfigs {
authConfig.Username, authConfig.Password, err = DecodeAuth(authConfig.Auth)
if err != nil {
return &configFile, err
}
authConfig.Auth = ""
authConfig.ServerAddress = k
configFile.AuthConfigs[k] = authConfig
}
}
return &configFile, nil
}
func (configFile *ConfigFile) Save() error {
// Encode sensitive data into a new/temp struct
tmpAuthConfigs := make(map[string]AuthConfig, len(configFile.AuthConfigs))
for k, authConfig := range configFile.AuthConfigs {
authCopy := authConfig
authCopy.Auth = EncodeAuth(&authCopy)
authCopy.Username = ""
authCopy.Password = ""
authCopy.ServerAddress = ""
tmpAuthConfigs[k] = authCopy
}
saveAuthConfigs := configFile.AuthConfigs
configFile.AuthConfigs = tmpAuthConfigs
defer func() { configFile.AuthConfigs = saveAuthConfigs }()
data, err := json.MarshalIndent(configFile, "", "\t")
if err != nil {
return err
}
if err := os.MkdirAll(filepath.Dir(configFile.filename), 0700); err != nil {
return err
}
if err := ioutil.WriteFile(configFile.filename, data, 0600); err != nil {
return err
}
return nil
}
func (config *ConfigFile) Filename() string {
return config.filename
}
// create a base64 encoded auth string to store in config
func EncodeAuth(authConfig *AuthConfig) string {
authStr := authConfig.Username + ":" + authConfig.Password
msg := []byte(authStr)
encoded := make([]byte, base64.StdEncoding.EncodedLen(len(msg)))
base64.StdEncoding.Encode(encoded, msg)
return string(encoded)
}
// decode the auth string
func DecodeAuth(authStr string) (string, string, error) {
decLen := base64.StdEncoding.DecodedLen(len(authStr))
decoded := make([]byte, decLen)
authByte := []byte(authStr)
n, err := base64.StdEncoding.Decode(decoded, authByte)
if err != nil {
return "", "", err
}
if n > decLen {
return "", "", fmt.Errorf("Something went wrong decoding auth config")
}
arr := strings.SplitN(string(decoded), ":", 2)
if len(arr) != 2 {
return "", "", fmt.Errorf("Invalid auth configuration file")
}
password := strings.Trim(arr[1], "\x00")
return arr[0], password, nil
}

View File

@@ -0,0 +1,157 @@
package cliconfig
import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/docker/docker/pkg/homedir"
)
func TestMissingFile(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on missing file: %q", err)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}
func TestSaveFileToDirs(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
tmpHome += "/.docker"
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on missing file: %q", err)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}
func TestEmptyFile(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
ioutil.WriteFile(fn, []byte(""), 0600)
_, err := Load(tmpHome)
if err == nil {
t.Fatalf("Was supposed to fail")
}
}
func TestEmptyJson(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
ioutil.WriteFile(fn, []byte("{}"), 0600)
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on empty json file: %q", err)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
if !strings.Contains(string(buf), `"auths":`) {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}
func TestOldJson(t *testing.T) {
if runtime.GOOS == "windows" {
return
}
tmpHome, _ := ioutil.TempDir("", "config-test")
defer os.RemoveAll(tmpHome)
homeKey := homedir.Key()
homeVal := homedir.Get()
defer func() { os.Setenv(homeKey, homeVal) }()
os.Setenv(homeKey, tmpHome)
fn := filepath.Join(tmpHome, OLD_CONFIGFILE)
js := `{"https://index.docker.io/v1/":{"auth":"am9lam9lOmhlbGxv","email":"user@example.com"}}`
ioutil.WriteFile(fn, []byte(js), 0600)
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on empty json file: %q", err)
}
ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Email != "user@example.com" || ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
if !strings.Contains(string(buf), `"auths":`) ||
!strings.Contains(string(buf), "user@example.com") {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}
func TestNewJson(t *testing.T) {
tmpHome, _ := ioutil.TempDir("", "config-test")
fn := filepath.Join(tmpHome, CONFIGFILE)
js := ` { "auths": { "https://index.docker.io/v1/": { "auth": "am9lam9lOmhlbGxv", "email": "user@example.com" } } }`
ioutil.WriteFile(fn, []byte(js), 0600)
config, err := Load(tmpHome)
if err != nil {
t.Fatalf("Failed loading on empty json file: %q", err)
}
ac := config.AuthConfigs["https://index.docker.io/v1/"]
if ac.Email != "user@example.com" || ac.Username != "joejoe" || ac.Password != "hello" {
t.Fatalf("Missing data from parsing:\n%q", config)
}
// Now save it and make sure it shows up in new form
err = config.Save()
if err != nil {
t.Fatalf("Failed to save: %q", err)
}
buf, err := ioutil.ReadFile(filepath.Join(tmpHome, CONFIGFILE))
if !strings.Contains(string(buf), `"auths":`) ||
!strings.Contains(string(buf), "user@example.com") {
t.Fatalf("Should have save in new form: %s", string(buf))
}
}

View File

@@ -0,0 +1,5 @@
# `dockercore/builder-deb`
This image's tags contain the dependencies for building Docker `.deb`s for each of the Debian-based platforms Docker targets.
To add new tags, see [`contrib/builder/deb` in https://github.com/docker/docker](https://github.com/docker/docker/tree/master/contrib/builder/deb), specifically the `generate.sh` script, whose usage is described in a comment at the top of the file.

10
contrib/builder/deb/build.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
set -x
./generate.sh
for d in */; do
docker build -t "dockercore/builder-deb:$(basename "$d")" "$d"
done

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM debian:jessie
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM debian:stretch
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM debian:wheezy
RUN echo deb http://http.debian.net/debian wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

69
contrib/builder/deb/generate.sh Executable file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
set -e
# usage: ./generate.sh [versions]
# ie: ./generate.sh
# to update all Dockerfiles in this directory
# or: ./generate.sh debian-jessie
# to only update debian-jessie/Dockerfile
# or: ./generate.sh debian-newversion
# to create a new folder and a Dockerfile within it
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
distro="${version%-*}"
suite="${version##*-}"
from="${distro}:${suite}"
mkdir -p "$version"
echo "$version -> FROM $from"
cat > "$version/Dockerfile" <<-EOF
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM $from
EOF
case "$from" in
debian:wheezy)
# add -backports, like our users have to
echo "RUN echo deb http://http.debian.net/debian $suite-backports main > /etc/apt/sources.list.d/$suite-backports.list" >> "$version/Dockerfile"
;;
esac
echo >> "$version/Dockerfile"
# this list is sorted alphabetically; please keep it that way
packages=(
bash-completion # for bash-completion debhelper integration
btrfs-tools # for "btrfs/ioctl.h" (and "version.h" if possible)
build-essential # "essential for building Debian packages"
curl ca-certificates # for downloading Go
debhelper # for easy ".deb" building
dh-systemd # for systemd debhelper integration
git # for "git commit" info in "docker -v"
libapparmor-dev # for "sys/apparmor.h"
libdevmapper-dev # for "libdevmapper.h"
libsqlite3-dev # for "sqlite3.h"
)
echo "RUN apt-get update && apt-get install -y ${packages[*]} --no-install-recommends && rm -rf /var/lib/apt/lists/*" >> "$version/Dockerfile"
echo >> "$version/Dockerfile"
awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
echo 'RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile"
echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
echo >> "$version/Dockerfile"
echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile"
awk '$1 == "ENV" && $2 == "DOCKER_BUILDTAGS" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
done

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:trusty
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:utopic
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

View File

@@ -0,0 +1,14 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/deb/generate.sh"!
#
FROM ubuntu-debootstrap:vivid
RUN apt-get update && apt-get install -y bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-systemd git libapparmor-dev libdevmapper-dev libsqlite3-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS apparmor selinux

View File

@@ -0,0 +1,5 @@
# `dockercore/builder-rpm`
This image's tags contain the dependencies for building Docker `.rpm`s for each of the RPM-based platforms Docker targets.
To add new tags, see [`contrib/builder/rpm` in https://github.com/docker/docker](https://github.com/docker/docker/tree/master/contrib/builder/rpm), specifically the `generate.sh` script, whose usage is described in a comment at the top of the file.

10
contrib/builder/rpm/build.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
set -x
./generate.sh
for d in */; do
docker build -t "dockercore/builder-rpm:$(basename "$d")" "$d"
done

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM centos:6
RUN yum groupinstall -y "Development Tools"
RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS selinux exclude_graphdriver_btrfs

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM centos:7
RUN yum groupinstall -y "Development Tools"
RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS selinux

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM fedora:20
RUN yum install -y @development-tools fedora-packager
RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS selinux

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM fedora:21
RUN yum install -y @development-tools fedora-packager
RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS selinux

View File

@@ -0,0 +1,15 @@
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM fedora:22
RUN yum install -y @development-tools fedora-packager
RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libselinux-devel sqlite-devel tar
ENV GO_VERSION 1.4.2
RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
ENV PATH $PATH:/usr/local/go/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS selinux

73
contrib/builder/rpm/generate.sh Executable file
View File

@@ -0,0 +1,73 @@
#!/bin/bash
set -e
# usage: ./generate.sh [versions]
# ie: ./generate.sh
# to update all Dockerfiles in this directory
# or: ./generate.sh
# to only update fedora-20/Dockerfile
# or: ./generate.sh fedora-newversion
# to create a new folder and a Dockerfile within it
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
distro="${version%-*}"
suite="${version##*-}"
from="${distro}:${suite}"
mkdir -p "$version"
echo "$version -> FROM $from"
cat > "$version/Dockerfile" <<-EOF
#
# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
#
FROM $from
EOF
echo >> "$version/Dockerfile"
case "$from" in
centos:*)
# get "Development Tools" packages dependencies
echo 'RUN yum groupinstall -y "Development Tools"' >> "$version/Dockerfile"
;;
*)
echo 'RUN yum install -y @development-tools fedora-packager' >> "$version/Dockerfile"
;;
esac
# this list is sorted alphabetically; please keep it that way
packages=(
btrfs-progs-devel # for "btrfs/ioctl.h" (and "version.h" if possible)
device-mapper-devel # for "libdevmapper.h"
glibc-static
libselinux-devel # for "libselinux.so"
sqlite-devel # for "sqlite3.h"
tar # older versions of dev-tools don't have tar
)
echo "RUN yum install -y ${packages[*]}" >> "$version/Dockerfile"
echo >> "$version/Dockerfile"
awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
echo 'RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile"
echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
echo >> "$version/Dockerfile"
echo 'ENV AUTO_GOPATH 1' >> "$version/Dockerfile"
if [ "$from" == "centos:6" ]; then
echo 'ENV DOCKER_BUILDTAGS selinux exclude_graphdriver_btrfs' >> "$version/Dockerfile"
else
echo 'ENV DOCKER_BUILDTAGS selinux' >> "$version/Dockerfile"
fi
done

Some files were not shown because too many files have changed in this diff Show More