Граф коммитов

761 Коммитов

Автор SHA1 Сообщение Дата
Andrea Luzzardi f1087c5fcf Daemon: Restore network settings at startup.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Andrea Luzzardi a487593729 Stable Networking: Keep the same network settings across container restarts.
This change will allocate network settings (IP and public ports) at
container creation rather than start and keep them throughout the
lifetime of the container (i.e. until it gets destroyed) instead of
discarding them when the container is stopped.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Andrea Luzzardi deffc572ce Container: Add restore network functionality.
RestoreNetwork() allows the container to restore its NetworkSettings (IP
and public ports).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Andrea Luzzardi ab4188c08d Container: Make allocateNetwork and releaseNetwork public.
Since we are moving network allocation outside of container scope (it
will be managed by create/destroy), those functions need to be
accessible from the outside.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Andrea Luzzardi 103a4e0676 Network Allocation: Proper rollback in case of failure allocation.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07:00
Alexandr Morozov beff5067c8 Merge pull request #8371 from aluzzardi/f-consistent-mac
Support for consistent MAC address.
2014-10-03 13:28:03 -07:00
Andrea Luzzardi 88e21c6a75 Support for consistent MAC address.
Right now, MAC addresses are randomly generated by the kernel when
creating the veth interfaces.

This causes different issues related to ARP, such as #4581, #5737 and #8269.

This change adds support for consistent MAC addresses, guaranteeing that
an IP address will always end up with the same MAC address, no matter
what.

Since IP addresses are already guaranteed to be unique by the
IPAllocator, MAC addresses will inherit this property as well for free.

Consistent mac addresses is also a requirement for stable networking (#8297)
since re-using the same IP address on a different MAC address triggers the ARP
issue.

Finally, this change makes the MAC address accessible through docker
inspect, which fixes #4033.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:22:38 -07:00
Michael Crosby eaaf9e3125 Merge pull request #8320 from dmcgowan/provenance_pull
Official image provenance pull flow
2014-10-03 10:56:54 -07:00
Victor Vieux 3eaa1c99c1 docker rm <unknown>
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-10-02 22:52:37 +00:00
Derek McGowan 7c88e8f13d Add provenance pull flow for official images
Add support for pulling signed images from a version 2 registry.
Only official images within the library namespace will be pull from the
new registry and check the build signature.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-01 18:26:06 -07:00
Malte Janduda f5f4d2d9cb Implementing IPv6 functionality for ipallocator
Closes #6975

Signed-off-by: Malte Janduda <mail@janduda.net>
2014-10-02 00:25:02 +02:00
unclejack 4424d15f99 Merge pull request #8302 from rafecolton/move_archive_package_to_pkg
Move archive package to pkg
2014-10-01 18:03:34 +03:00
Andrea Luzzardi 3f2e4e94d7 Merge pull request #8266 from cpuguy83/fix_race_in_createing_volumes
Fix potential race in volume creation
2014-09-30 18:03:00 -07:00
Andrea Luzzardi d40ab6f123 Merge pull request #8299 from vieux/pr_7425
Add --security-opts options to allow user to customize container labels and apparmor profile
2014-09-30 17:53:11 -07:00
Victor Vieux 08547dff29 update tests
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-30 19:10:03 +00:00
Vishnu Kannan 021ecb1d13 Adding exec remote API documentation along with minor code cleanup.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-30 18:26:58 +00:00
Alexandr Morozov e32b54fe35 Merge pull request #8263 from jfrazelle/filter-status-name
Filter containers by status.
2014-09-30 10:40:02 -07:00
ArikaChen bfc9d8bbea Fix typo:betweem->between and PtySlace->PtySlave
Signed-off-by: Arika Chen <eaglesora@gmail.com>
2014-09-30 07:22:09 -04:00
Rafe Colton 30d5a42c1f Move archive package into pkg/archive
Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

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

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
2014-09-29 23:16:27 -07:00
Jessica Frazelle ea09f03682 Filter containers by status.
A continuation of #7616.
Adds `docker ps --filter=status=(restarting|running|paused|stopped)` option.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-29 20:11:19 -07:00
Victor Vieux c2c5e57a8e add apparmor:
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-30 00:43:47 +00:00
Tianon Gravi 07179a7eb1 Merge pull request #8293 from crosbymichael/update-libcontainer-sep8
Update libcontainer to c744f6470e37be5ce1f1ae09b842c15c1bee120d
2014-09-29 18:09:25 -06:00
Dan Walsh 87e732a0f3 Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-30 00:06:22 +00:00
Michael Crosby 32dca1a7b0 Strongly type exec driver context
This also removes dead code in the native driver for a past feature that
was never fully implemented.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-29 22:40:26 +00:00
Michael Crosby 532c29ef7d Update native driver to set RootFs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-29 21:35:25 +00:00
Brian Goff 8d7c7bd2e3 Fix potential race in volume creation
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-09-29 14:56:04 -04:00
Dan Walsh a297d6ab8c Replace utils.CheckLocalDns with bytes.Contains line
Since RemoveLocalDns patch will  remove all localhost entries
from resolv.conf we no longer need anything more then
!bytes.Contains(resolvConf, []byte("nameserver")

To check for no nameserver entry in dns config.

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

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

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-29 06:37:31 -04:00
Jessie Frazelle 0dfee56ca4 Merge pull request #8247 from aluzzardi/f-run-hostconfig
API: Provide the HostConfig during "run".
2014-09-25 16:09:55 -07:00
Victor Vieux 0913009ebe Merge pull request #8191 from vieux/improve_error_exec_lxc
Improve error for docker exec & LXC
2014-09-25 15:58:21 -07:00
Andrea Luzzardi 1df87b9506 API: Provide the HostConfig during "run".
Currently, the HostConfig is only passed from the CLI to Docker only
when issuing a docker create, but not when doing a docker run.

In the near future, in order to allocate ports at creation time rather
than start time, we will need to have the HostConfig readily available
at container creation.

This PR makes the client always pass the HostConfig when creating a
container (regardless of whether it's for a run or create).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-09-25 15:24:38 -07:00
Jessie Frazelle 1d8c66347e Merge pull request #8241 from vbatts/vbatts-devmapper_version
devmapper: include the version in `info`
2014-09-25 14:53:43 -07:00
Victor Vieux d19d800898 not not -> not
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-25 21:23:27 +00:00
Vincent Batts 5630d466b2 devmapper: include the version in `info`
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-25 15:51:02 -04:00
Victor Vieux 857b739e29 Merge pull request #8208 from estesp/7851-fix-hostname-fqdn
Provide full hostname with domainname to underlying container layer
2014-09-25 11:33:50 -07:00
Vincent Batts 8e7aa44f0e devmapper: include dm_deps information in debug
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-25 10:59:23 -04:00
Phil Estes 5239ba3d06 Provide full hostname with domainname to underlying container layer
Addresses #7851

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2014-09-25 09:23:39 -04:00
Andrea Luzzardi 4479d69d56 Merge pull request #8200 from aluzzardi/f-ipallocator-check-range
IPAllocator: Ensure the allocated IPs are within network range.
2014-09-24 14:29:39 -07:00
Andrea Luzzardi a471eb4d93 IPAllocator: Ensure the allocated IPs are within network range.
Since it is possible to request a specific IP, IPAllocator has to verify
that the request is within boundaries.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-09-24 11:04:28 -07:00
unclejack f2fad5c290 Merge pull request #8173 from crosbymichael/update-mem-limit
Update memory limit for container
2014-09-24 20:55:25 +03:00
Victor Vieux 827634d355 Merge pull request #7973 from LK4D4/persist_execdriver_dir
Persist execdriver dir
2014-09-23 16:01:03 -07:00
Victor Vieux ab30e19b96 Improve error for docker exec & LXC
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-23 21:47:33 +00:00
Victor Vieux f2bc723bc6 Merge pull request #8181 from rhatdan/selinux_btrfs
--selinux-enabled flag should be ignored on Disabled SELinux systems
2014-09-23 10:31:19 -07:00
Dan Walsh 9e2eb0f1cc --selinux-enabled flag should be ignored on Disabled SELinux systems
On Fedora and RHEL we ship selinux-enabled flag in the docker.service config,
but if people setup the /var/lib/docker as btrfs and disable SELinux,
we should not block the daemon from running.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-23 13:21:25 -04:00
Tibor Vass 5c110b63dd Merge pull request #8127 from estesp/8107-fix-wait-error-return
Fix container wait error message to match server template for returning ...
2014-09-23 12:03:39 -04:00
Tibor Vass 9941b03af1 Merge pull request #8172 from vbatts/vbatts-devmapper_fix_devicset_status_devices
devmapper: `docker info` devices hard coded
2014-09-23 10:28:31 -04:00
Michael Crosby 9b755412ab Update memory limit for container
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-22 21:41:14 +00:00
Vincent Batts 636e8561a8 devmapper: resizepool hardcodes files as well
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-22 17:03:31 -04:00
Vincent Batts 7e9ba22dc3 devmapper: `docker info` devices hard coded
If `--storage-opt dm.datadev=/dev/loop0 --storage-opt
dm.metadatadev=/dev/loop1 ` were provided, the information was not
reflected in the information output.

Closes: #7137

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-09-22 16:40:20 -04:00
Alexandr Morozov 4778d7d52d Merge pull request #8125 from somaopensource/8102-fix
Check whether net.ParseIP returned nil or not
2014-09-22 23:00:25 +04:00
Alexandr Morozov 623ebf203b Persistent directory for container in execdriver
This is needed for persistent namespaces

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-22 22:48:26 +04:00
unclejack 950bfe4193 daemon/attach: avoid mem alloc for interface
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-22 21:17:50 +03:00
unclejack d2c104c3a0 daemon/logs: lower allocations in loop
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-22 18:57:28 +03:00
Tibor Vass 9c7d975614 Merge pull request #8159 from LK4D4/fix_goroutine_leak_in_logs
Fix goroutine leak in logs following
2014-09-22 11:16:48 -04:00
unclejack 9fb34ae571 Merge pull request #6101 from LK4D4/ip_range_#4986
Implement allocating IPs from CIDR within bridge network
2014-09-22 17:09:16 +03:00
Alexandr Morozov 5ad82d3ea6 Merge pull request #8137 from jfrazelle/8135-event-log-die-start-fail
After container fails to start, log the event die.
2014-09-22 12:47:04 +04:00
Oh Jinkyun c2dc4245f1 Check whether net.ParseIP returned nil or not
This is fix of #8102

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
2014-09-22 16:52:23 +09:00
Alexandr Morozov a7ee201ee8 Close logs pipes and catch write errors
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-09-22 10:55:46 +04:00
Alexandr Morozov e7a9662974 Merge pull request #7972 from cpuguy83/split_volumes_from_daemon
Split volumes out from daemon
2014-09-20 16:23:20 +04:00
Michael Crosby 8a9e827216 This reduces the amount of logging in the integration tests
There were a new areas in the brige driver that did not need to have log
output.  Those were removed.  Also set the engine's logging to false
when running the integration tests.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-19 17:30:37 -07:00
Jessica Frazelle d64d55eca8 After container fails to start, log the event die.
Fixes #8135.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-19 16:06:49 -07:00
Brian Goff 45407cf00a Split volumes out from daemon
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-09-19 17:47:47 -05:00
Phil Estes be6bce6ab8 Fix container wait error message to match server template for returning 404
Addresses #8107

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2014-09-19 13:33:00 -04:00
Michael Crosby 72e9015591 Merge pull request #7694 from eyakubovich/master
Add an option to disable IP masquerading
2014-09-18 18:33:45 -07:00
Vishnu Kannan 003afaf1ce Initialize execStore while restoring a container from checkpoint.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-18 21:40:53 +00:00
Frederick F. Kautz IV 3bb12d390a Adding additional documentation for fixed-cidr networking
Docker-DCO-1.1-Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu> (github: fkautz)

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-09-18 08:48:24 +04:00
unclejack 9ae3134dc9 add the timeutils package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-17 14:30:08 +03:00
Eugene Yakubovich 4dc4d56db9 Add an option to disable IP masquerading
For the cases where --bip option is used it is sometimes best to disable
IP masquerading as the provided bridge IP range may be routable.

Signed-off-by: Eugene Yakubovich <eugene.yakubovich@coreos.com>
2014-09-16 20:00:15 -07:00
Jessie Frazelle f98a1f1f7d Merge pull request #8019 from thockin/add-host
Allow extra lines in /etc/hosts
2014-09-16 17:19:16 -07:00
Tim Hockin 68e48b65a6 Allow extra lines in /etc/hosts
This adds a --add-host host:ip flag which appends lines to /etc/hosts.  This is needed in places where you want the container to get a different name resolution than it would through DNS.  This was submitted before as #5525, closed, and now I am re-opening.  It has come up 2 or 3 times in the last couple days.

Signed-off-by: Tim Hockin <thockin@google.com>
2014-09-16 23:38:23 +00:00
Alexandr Morozov ca39a3e36b Merge pull request #7110 from tiborvass/merge-6907
Docker create (rebase of 6907)
2014-09-17 03:23:50 +04:00
Tibor Vass 37b3b34afa Merge pull request #7989 from jlhawn/graphdriver_differ_refactor
Refactor use of graphdriver.Differ
2014-09-16 18:58:38 -04:00
Alexandr Morozov ffbd8fe5b9 Merge pull request #8068 from jfrazelle/cleanup-various-fix-me-refs
Cleanup various fix me refs
2014-09-17 02:54:54 +04:00
Alexander Larsson 3a90004f3c Add "docker create" support
This exposes the already existing "create container" operation.  It is
very similar to "docker run -d" except it doesn't actually start the
container, but just prepares it. It can then be manually started using
"docker start" at any point.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Conflicts:
	api/client/commands.go
	runconfig/parse.go
	server/container.go

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-09-16 18:40:24 -04:00
Josh Hawn 09ad65ebd5 graphdriver interface name change, typo fix
Signed-off-by: Josh Hawn <josh.hawn@docker.com>
2014-09-16 15:10:32 -07:00
Josh Hawn dee6b481fe Refactor use of graphdriver.Differ
Some graphdrivers are Differs and type assertions are made
in various places throughout the project. Differ offers some
convenience in generating/applying diffs of filesystem layers
but for most graphdrivers another code path is taken.

This patch brings all of the logic related to filesystem
diffs in one place, and simplifies the implementation of some
common types like Image, Daemon, and Container.

Signed-off-by: Josh Hawn <josh.hawn@docker.com>
2014-09-16 15:10:32 -07:00
Brian Goff 0a3211f131 Fix #7792 - Order mounts
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-09-16 14:51:06 -07:00
Jessie Frazelle 51b26853ef Merge pull request #7976 from duglin/Issue7902
Fix for issue 7902 - add trailing zeros to timestamps so logs align
2014-09-16 13:55:03 -07:00
Alexandr Morozov 00fd008170 Merge pull request #8062 from vishh/run_in_phase2
Add support for 'docker exec' - phase 2
2014-09-16 23:56:12 +04:00
Vishnu Kannan c786a8ee5e Adding docker exec support in CLI.
Fixed a bug in daemon that resulted in accessing of a closed pipe.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-16 19:24:25 +00:00
Phil Estes 1b0b1ec657 Proper JSON handling of strings that could be represented as other types
Addresses #6830

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2014-09-16 13:51:02 -04:00
Jessica Frazelle 23b2c39a40 Return errors in NewDaemonFromDirectory instead of calling Fatal
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-16 10:42:59 -07:00
Jessica Frazelle 67c254a60a DisableNetworkBidge doesn't need to be public anymore
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-16 10:37:50 -07:00
Doug Davis cd7a5f5c09 Fix for issue 7902.
Use utils.RFC3339NanoFixed ("2006-01-02T15:04:05.000000000Z07:00")
instead of time.RFC3339Nano to format our log timestamps - this way
things are aligned, in particular the nano seconds are padded with zeros

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-09-16 10:28:37 -07:00
Vishnu Kannan 39030382c4 Adding state to exec commands to prevent multiple starts of a single exec command.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 23:14:04 +00:00
Vishnu Kannan bfebdfde78 Splitting the exec remote API into two separate APIs inorder to support resizing of tty sessions.
1. /container/<name>/exec - Creates a new exec command instance in the daemon and container '<name>'. Returns an unique ID for each exec command.
2. /exec/<name>/start - Starts an existing exec command instance. Removes the exec command from the daemon once it completes.

Adding /exec/<name>/resize to resize tty session of an exec command.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 22:56:47 +00:00
Alexandr Morozov fbae71326c Merge pull request #8020 from erikh/rewrite_hosts_files
Links v2: Mutable network files
2014-09-15 23:03:30 +04:00
Vishnu Kannan 669561c2aa Address review comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 17:00:00 +00:00
Vishnu Kannan d130c10ab7 Fix bug in attach handling for docker exec. Add docs for 'docker exec' feature.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:59:05 +00:00
Vishnu Kannan e1cf95b593 Import nsenter in docker.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:59:05 +00:00
Vishnu Kannan 985d579586 Adding 'exec' command to remote API and CLI.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:59:03 +00:00
Vishnu Kannan 5130fe5d38 Adding support for docker exec in daemon.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:57:52 +00:00
Vishnu Kannan f3c767d798 Adding Exec method to native execdriver.
Modified Attach() method to support docker exec.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-15 16:57:52 +00:00
unclejack a10a86d437 Merge pull request #7698 from tamsky/tune2fs_base_filesystem
use tune2fs to disable ext4 mount counts and mount intervals
2014-09-15 15:42:52 +03:00
unclejack c751e1739d Merge pull request #8010 from LK4D4/fix_ps_s_hang_#7999
Fix ps -s hang
2014-09-15 13:54:29 +03:00
Erik Hollensbe 09b700288e Allow /etc/hosts and /etc/resolv.conf to be updated both outside and
inside the container.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-13 11:27:34 -07:00
unclejack da4dba2e8c Merge pull request #8014 from jfrazelle/8012-prevent-container-names-starting-dash
Ensure container names start with a-zA-Z0-9
2014-09-12 23:15:16 +03:00
Jessica Frazelle aa2af817be Ensure container names start with a-zA-Z0-9
Closes #8012.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-12 10:45:07 -07:00
Alexandr Morozov 82bdd88e9c Use unlocked version of changes for GetImage
Fixes #7999

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-12 11:44:51 +04:00
Alexandr Morozov 555ce0cb54 Use defined variable
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-12 11:42:12 +04:00
Alexandr Morozov 41e9e93e27 Fix my own comments from #7927
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-12 10:05:07 +04:00
Erik Hollensbe 3b6a29b81a Fix an issue where already allocated ports would not trigger an error.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-09-12 09:51:14 +04:00
Michael Crosby 32b5d145fa Merge pull request #7963 from jfrazelle/7845-remove-image-fail-dont-untag
Failing to remove an image, will not remove the image name/tag.
2014-09-11 18:06:18 -07:00
Jessica Frazelle b2efdc538d Removing an image that fails, also removes the image name/tag.
Fixes #7845 and #7801, and a real pain point I had :)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-11 11:29:25 -07:00
Michael Crosby ed7fb3bbda Merge pull request #7202 from timbot/add-registry-mirror-flag
Add daemon flag to specify public registry mirrors
2014-09-11 11:11:01 -07:00
Michael Crosby 25f7840993 Merge pull request #7955 from LK4D4/ignore_delete_err_on_unmap_#7954
Deallocate port before trying to delete iptables chain
2014-09-09 17:41:26 -07:00
Michael Crosby f9c345ddfa Merge pull request #7897 from LK4D4/refactoring_net_mode
Add IsPrivate method for NetworkMode
2014-09-09 14:20:59 -07:00
Alexandr Morozov 080ca86191 Add IsPrivate method for NetworkMode
This method indicates that container using private network stack

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-10 00:46:43 +04:00
Alexandr Morozov 2e7cf6b0ce Deallocate port before trying to delete iptables chain
Fixes #7954
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-10 00:40:46 +04:00
Tim Smith 69a75c673c Add daemon flag to specify public registry mirrors
Adds support for a --registry-mirror=scheme://<host>[:port]
daemon flag. The flag may be present multiple times. If
provided, mirrors are prepended to the list of endpoints used
for image pull. Note that only mirrors of the public
index.docker.io registry are supported, and image/tag resolution
is still performed via the official index.

Docker-DCO-1.1-Signed-off-by: Tim Smith <timbot@google.com> (github: timbot)
2014-09-09 19:03:38 +00:00
Jessie Frazelle 971240696f Merge pull request #7660 from rhatdan/selinux-volumes
Change default label of container volumes to shared SELinux Label
2014-09-09 11:16:19 -07:00
Daniel, Dao Quang Minh 4b3b54ca38 fix console attribute in lxc template
commit 4aa5da278f moves `Console` from Command to
ProcessConfig, but missed the change in lxc_template. Therefore creating a
container with tty using lxc driver with fail with error

template: lxc:60:20: executing "lxc" at <.Console>: Console is not a field of
struct type struct { *execdriver.Command; AppArmor bool; ProcessLabel string; MountLabel string }

This changes lxc_console template to refers to `.ProcessConfig.Console`

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-09-09 13:51:13 -04:00
Dan Walsh 73617e5e18 Change default label of container volumes to shared SELinux Label
Since these will be shared between containers we want to label
them as svirt_sandbox_file_t:s0.  That will allow multiple containers
to write to them.

Currently we are allowing container domains to read/write all content in
/var/lib/docker because of container volumes.  This is a big security hole
in our SELinux story.

This patch will allow us to tighten up the security of docker containers.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-09 08:18:20 -04:00
Hu Tao fcc7ec8073 typo fix: immediatly -> immediately
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
2014-09-09 01:16:19 -04:00
Jessica Frazelle f49c3f287b fixes #7802, when api version 1.11 is `json.Marshal`ing the container struct
Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com> (github: )
2014-09-08 09:30:33 -07:00
Marc Tamsky d229821501 use tune2fs to disable ext4 mount counts and mount intervals
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
2014-09-05 19:32:39 -07:00
Tibor Vass 1a2a4f61ab Merge pull request #7878 from LK4D4/fix_net_for_none
Don't initialize network for 'none' mode
2014-09-04 15:30:03 -07:00
Alexandr Morozov ba24820284 Don't initialize network for 'none' mode
Fixes #7837

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-04 09:50:58 +04:00
Ward Vandewege a447894946 fix typos in error messages
Signed-off-by: Ward Vandewege <ward@jhvc.com> (github: cure)
2014-09-03 13:12:10 -04:00
unclejack 76212635b5 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-03 11:36:21 +03:00
Alexandr Morozov e0339d4b88
Use State as embedded to Container
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-03 00:01:11 +04:00
Michael Crosby 688741df31 Update mount struct with reference
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-09-01 15:18:30 -07:00
Vishnu Kannan 3a7e07355a Rename 'StdConfig' to 'StreamConfig'.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-01 14:31:01 -07:00
Vishnu Kannan 4aa5da278f Refactoring execdriver.Command and Container structs to support 'docker exec' and other
similar features in the future.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-01 14:30:16 -07:00
Michael Crosby 388ed88042 Merge pull request #7812 from erikh/fix_top
docker top: fix command when multiple arguments are supplied
2014-09-01 11:31:38 -07:00
Erik Hollensbe 394a6d3154 docker top: fix command when multiple arguments are supplied
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-31 01:18:15 -07:00
Alexandr Morozov 16e850fe3e
Use increment operator
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-30 21:43:48 +04:00
Alexandr Morozov b101022dbe
Implement allocating IPs from CIDR within bridge network
Fixes #4986

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 16:21:07 +04:00
Alexandr Morozov 42dd48315f
More ipallocator refactoring
Now x1.5 faster

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 16:20:49 +04:00
Alexandr Morozov 517ba44e37
Merge Container and State mutexes
Resolved all deadlocks and fixed race between kill and
monitor.resetContainer
Fixes #7600

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 12:56:04 +04:00
Erik Hollensbe 1ae4c00a19 builder: fix references to jobs in daemon, make builder a first class
package referring to evaluator

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-27 18:52:30 -07:00
Michael Crosby 2a5e29adc6 Merge pull request #7677 from erikh/update_hosts_linked_containers
Update /etc/hosts when linked container is restarted
2014-08-27 19:54:09 -07:00
Michael Crosby 77eefbc688 Merge pull request #7672 from cpuguy83/cleanup_volumes_from
Cleanup: applyVolumesFrom
2014-08-27 19:43:16 -07:00
Victor Vieux 450740c891 Update /etc/hosts when linked container is restarted
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-08-27 18:23:41 -07:00
Alexandr Morozov bd049b3800
Skip "no chain" error on deleting chain in Unmap
Fixes #6904
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-27 20:24:27 +04:00
Brian Goff 7495fbc0e3 Cleanup: applyVolumesFrom
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-08-26 20:52:58 -04:00
Tibor Vass c4a190db0c Merge pull request #7744 from LK4D4/fix_race_cleanup_start_#6904
Fix race condition between cleanup and Start
2014-08-26 14:17:11 -04:00
Michael Crosby 55f7dd8198 Merge pull request #7642 from LK4D4/style_fixes
Style fixes for daemon package
2014-08-26 10:59:05 -07:00
Michael Crosby 89f64712fa Merge pull request #7702 from LK4D4/fix_panic_on_bad_device_#7701
Handle error from GetDevice early
2014-08-26 10:53:40 -07:00
Alexandr Morozov 12ff89a390
Fix race condition between cleanup and Start
There was problem when Start might be before cleanup

Fixes #6904

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-26 20:57:12 +04:00
Alexandr Morozov 698392cb51 Remove redundant elses
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-26 09:28:54 +04:00
Alexandr Morozov 1ba15b8aca Use ++ instead of += 1
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-26 09:27:07 +04:00
Michael Crosby 228eda4fd5 Merge pull request #7629 from LK4D4/fix_follow_hang_on_stop
Fix logs -f hanging on stopped containers
2014-08-25 15:24:20 -07:00
Tibor Vass 34438efffe Merge pull request #7659 from somaopensource/soma
daemon: rename from "delete" job to "rm"
2014-08-25 15:54:14 -04:00
Alexandr Morozov 17b95ecb08
Handle error from GetDevice early
Also more verbose error.

Fixes panic from #7701

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-24 14:09:30 +04:00
Chris Armstrong ef9a5926e9 Fix typo for --restart deprecation
Signed-off-by: Chris Armstrong <chris@opdemand.com>
2014-08-22 12:56:43 -07:00
Victor Vieux 094cd7040b Merge pull request #7638 from vivekdasgupta/minor-fixes
Fix data space reporting from Kb/Mb to KB/MB
2014-08-22 11:40:49 -05:00
Vivek Dasgupta a327d9b91e Fix data space reporting from Kb/Mb to KB/MB
Docker-DCO-1.1-Signed-off-by: Vivek Dasgupta <vdasgupt@redhat.com> (github: vivekdasgupta)
2014-08-21 21:03:44 +05:30
limsy 239e932485 daemon: rename from "delete" job to "rm"
This commit fixes following FIXMEs:

// FIXME: rename "delete" to "rm" for consistency with the CLI command
// FIXME: rename ContainerDestroy to ContainerRm for consistency with the CLI command

Signed-off-by: lim seong yeol <seongyeol37@gmail.com>
2014-08-21 19:58:26 +09:00
Alexandr Morozov badf8247af
Fix logs -f hanging on stopped containers
Fixes #7020

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-19 22:23:02 +04:00
Victor Vieux f3b2c93b9f allow /etc/hosts /etc/resolv.conf and /etc/hostname to be changed
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-08-19 17:06:17 +00:00
Solomon Hykes 2a39635d30 Cleanup: move image depth checks in image/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-15 00:43:12 +00:00
Alexandr Morozov 0d4d7e4a28
Cleanup: Make channels unbuffered
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-14 21:51:25 +04:00
Alexandr Morozov f1975cbc7c
Fix race on state serialization
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-14 21:51:15 +04:00
Alexandr Morozov 93d6adf8a1
Fix race between container cleanup and inspect/ps
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-14 21:51:06 +04:00
Alexandr Morozov 1480168e9f
Fix race condition in sending started signal from monitor
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-14 21:50:56 +04:00
Victor Vieux a0392324f1 another commit to do like @crosbymichael
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-14 01:36:26 +00:00
Victor Vieux fcf37be2b1 remove double newline
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-14 01:08:27 +00:00
Michael Crosby 25c519e829 Deprecate --restart on the daemon
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 16:08:50 -07:00
Michael Crosby 73ced63680 Update based on comments from the code review
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:55 -07:00
Michael Crosby 2ec1b697c1 Rebased changes to return on first start's error
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:55 -07:00
Michael Crosby ebf5d4657d Reguardless of success reset time increment
Reset the time increment if the container's execution time is greater
than 10s or else as a container runs and is restarted the time will grow
overtime.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby 972c894931 Improve wait during restart
We need to do this so that when a user asks docker to stop the container
and it is currently in the restart loop we don't want to have to wait
for the duration of the restart time increment before ack. the stop.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby c4a00d549d Honor the restarting state in Stop
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby a2afb2b1e3 Add Restarting state when docker is handling the restart of containers
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby be22d7ac2d Add additional comments for vague lines
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby 6ae05936e1 Move container start event into monitor
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby b7550cd456 Fix rebase around log event
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby feda8fbb21 Restart conatiner with on-failure policy if exit code != 0
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby 41870a42be Only restart containers on daemon load with policy of always
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:58:54 -07:00
Michael Crosby 860c13b788 Add documentation and update restart rules.
Implement time backed backoff for restarting and fix failure count when
the maximum is 0

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:57:37 -07:00
Michael Crosby 2b0776c883 Refactor container monitor into type
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:56:53 -07:00
Michael Crosby d9753ba20d Add typed RestartPolicy
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:56:34 -07:00
Michael Crosby e0a076d486 Cleanup restart logic in monitor
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:56:34 -07:00
Michael Crosby bd8c9dc239 Restart containers based on restart policy
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 15:56:34 -07:00
Josiah Kiehl a02f67be5b Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
2014-08-13 15:18:15 -07:00
Victor Vieux 13eb477b62 Merge pull request #7506 from shykes/cleanup-daemonconfig
Cleanup: refactor parsing and handling of Daemon config
2014-08-13 15:07:13 -07:00
Michael Crosby fd1b563b4f Merge pull request #7548 from crosbymichael/proxy-exec
Move userland proxies out of daemon process
2014-08-13 14:03:40 -07:00
Tibor Vass 0c6b137f06 Merge pull request #7484 from cpuguy83/cleanup_volume_init
Cleanup: initializeVolume
2014-08-13 16:18:02 -04:00
Brian Goff e350df5b2c Cleanup: initializeVolume
- Use a common struct for Volumes
- Split out some functionality in intializeVolume into separate functions
- Removes some duplicate code
- In general much easier to grok the code now

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-08-13 15:55:59 -04:00
Solomon Hykes 1d10c55aec Move remote API config out of daemon/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes 1eba59eb24 Check for conflicting daemon config options in NewDaemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes 353b7c8ec7 Parse daemon configuration in daemon.Config.InstallFlags instead of main
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:25:51 +00:00
Solomon Hykes a4befff533 Move daemonconfig into daemon
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 19:09:51 +00:00
Michael Crosby b4e2f5ed96 Move userland proxies out of daemon's process
This PR moves the userland proxies for TCP and UDP traffic out of the
main docker daemon's process ( from goroutines per proxy ) to be a
separate reexec of the docker binary.  This reduces the cpu and memory
needed by the daemon and if the proxy processes crash for some reason
the daemon is unaffected.  This also displays in the standard process
tree so that a user can clearly see if there is a userland proxy that is
bound to a certain ip and port.

```bash
CONTAINER ID        IMAGE                       COMMAND             CREATED             STATUS              PORTS                                          NAMES
5d349506feb6        busybox:buildroot-2014.02   "sh"                13 minutes ago      Up 1 seconds        0.0.0.0:49153->81/tcp, 0.0.0.0:49154->90/tcp   hungry_pike
root@1cbfdcedc5a7:/go/src/github.com/docker/docker# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  18168  3100 ?        Ss   21:09   0:00 bash
root      8328  0.7  0.6 329072 13420 ?        Sl   22:03   0:00 docker -d -s vfs
root      8373  1.0  0.5 196500 10548 ?        Sl   22:03   0:00 userland-proxy -proto tcp -host-ip 0.0.0.0 -host-port 49153 -container-ip 10.0.0.2 -container-port 81
root      8382  1.0  0.5 270232 10576 ?        Sl   22:03   0:00 userland-proxy -proto tcp -host-ip 0.0.0.0 -host-port 49154 -container-ip 10.0.0.2 -container-port 90
root      8385  1.2  0.0   3168   184 pts/0    Ss+  22:03   0:00 sh
root      8408  0.0  0.1  15568  2112 ?        R+   22:03   0:00 ps aux
```

This also helps us to cleanly cleanup the proxy processes by stopping
these commands instead of trying to terminate a goroutine.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 11:54:47 -07:00
Victor Vieux c9c271858a Merge pull request #6162 from vbatts/vbatts-ps_filter
docker ps: introducing filters
2014-08-13 11:44:48 -07:00
Michael Crosby ad7279e480 Merge pull request #7555 from LK4D4/fix_vet_warnings
Fix go vet warnings
2014-08-13 10:40:38 -07:00
Vincent Batts 84146719d8 docker ps: introducing filters
* starting with filtering for exit codes. `docker ps -a --filter 'exited=1'`
* API doc for filter parameter
* formatting filters for help usage
* tweaks for review

This requires https://github.com/dotcloud/docker/pull/4430

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-08-13 09:12:33 -04:00
Alexandr Morozov 391c35c822
Fix go vet warnings
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-13 11:37:30 +04:00
Solomon Hykes 63503cafe4 Remove deprecated server/ package
Victory!

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 06:56:45 +00:00
Solomon Hykes 491deae9b8 Move "build" to daemon/build.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-13 03:12:33 +00:00
Victor Vieux b06311a72e fix goroutines leak and exit code
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)

Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-13 00:03:56 +00:00
Victor Vieux bcfd6a653b fix #7374 leftover
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-12 23:37:33 +00:00
Michael Crosby 7321067176 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-11 11:47:21 -07:00
Tibor Vass e033425f0b Merge pull request #7502 from LK4D4/catch_error_console
Catch error on console creation
2014-08-11 12:13:53 -04:00
Alexandr Morozov 93f6cf0351 Catch error on console creation
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-09 22:10:44 +04:00
LK4D4 7afc49b40b Fix error message on logging events
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-09 18:45:38 +04:00
Solomon Hykes 94715e8e64 Move "info" to daemon/info.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-08 03:01:55 +00:00
Michael Crosby 414ccee23a Merge pull request #7374 from cpuguy83/revert_rm_f_deprecation
Revert --stop/--kill and use SIGKILL instead
2014-08-07 16:47:25 -07:00
Michael Crosby 5d9cfde0df Merge pull request #7453 from shykes/new-subsystem-maintainers
Add maintainers to daemon/ and graph/
2014-08-07 16:43:41 -07:00
Brian Goff 95f86da641 Revert `rm -f` deprecation use SIGKILL instead
`rm -f` was originally deprecated in favor of `rm --stop/--kill` since `rm
-f` was sending SIGTERM and potentially very slow.
Instead this will bring back `rm -f` but use SIGKILL isntead

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-08-07 18:20:43 -04:00
Michael Crosby bc9f5cdeb5 Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
2014-08-07 14:51:42 -07:00
Tibor Vass ab3e34e187 Merge pull request #7389 from tianon/replace-amd64-build-tags-with-cgo-as-appropriate
Replace amd64 build tags with cgo as appropriate
2014-08-07 16:24:19 -04:00
Michael Crosby 140e6abb17 Merge pull request #7443 from ewindisch/name-id-lookup-reversal
Container name lookups to prefer IDs over names
2014-08-07 11:14:47 -07:00
Brian Goff dc296903f0 Merge pull request #7446 from cpuguy83/cleanup_extract_bindmount_spec_parsing
Cleanup: extract bindmount spec parsing
2014-08-07 11:48:07 -04:00
Solomon Hykes 7e12911f62 Merge pull request #7452 from shykes/7370-on-7427
Cleanup: move image management and logging out of deprecated Server
2014-08-06 18:47:45 -07:00
Erik Hollensbe bd373712d0 port usage of jsonlog to the new daemon files which were refactored
recently.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:45:04 -07:00
Erik Hollensbe 5ab09f2f71 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:37:01 -07:00
Tianon Gravi 89ec17d113 Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-08-06 17:20:21 -06:00
Michael Crosby bc684fae64 Merge pull request #7430 from tamsky/docfixes
style, grammar, spelling fixes.
2014-08-06 16:11:52 -07:00
Michael Crosby e86d87e1ce Merge pull request #7431 from tamsky/fixes-7105
add warning re: changing value of `dm.basesize`.
2014-08-06 15:22:42 -07:00
Brian Goff f34679d0a9 Cleanup: extract bindmount spec parsing
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
2014-08-06 17:22:40 -04:00
Solomon Hykes 20b0841c1b Remove last trace of Daemon->Server dependency
This removes a shim `daemon.Server` interface which was used to start
separating Daemon from Server *gradually*, without getting cyclic
dependency errors.

Now that the last Daemon->Server dependency has been removed, we can
finally remove the shim. Yay!

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:12 +00:00
Solomon Hykes 78f0a914ee Replace Server.IsRunning with Engine.IsShutdown
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Solomon Hykes c9f3fd3fc7 Cleanup: refactor shutdown and signal handling facility
This disentangles the following functions, which were previously all mixed together:

* 1) Waiting for jobs to terminate when shutting down
* 2) Handling signals in the Docker daemon
* 3) Per-subsystem cleanup handlers
* 4) pidfile management

Responsibilities are dispatched as follows:

* Signal traps are set in `main`, and trigger `engine.Shutdown`
* `engine.Shutdown` coordinates cleanup by waiting for jobs to complete, and calling shutdown handlers
* To perform cleanup at shutdown, each subsystem registers handlers with `engine.OnShutdown`
* `daemon` is one subsystem, so it registers cleanup via `engine.OnShutdown`.
* `daemon` owns the pidfile, which is used to lock access to `/var/lib/docker`. Part of its cleanup is to remove the pidfile.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Eric Windisch 231e07ded4 Container name lookups to prefer IDs over names
Lookups of container names should prefer the ID over
names assigned to containers by users.

Signed-off-by: Eric Windisch <eric@windisch.us>
2014-08-06 13:09:11 -04:00
Solomon Hykes 5240e5f713 Add maintainers to daemon/ and graph/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:29:15 +00:00
Solomon Hykes 1c11d7f93e Rename "log_event" to "log"
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:23 +00:00
Alexandr Morozov 8d056423f8 Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:19 +00:00
Solomon Hykes 7a5e3df162 Move "image_delete" to daemon/image_delete.go
Note: this cannot yet be moved to graph/ because of a lingering
dependency on daemon. This has been noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Marc Tamsky bd30746e07 add warning re: changing value of `dm.basesize`.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
2014-08-05 19:28:07 -07:00
Marc Tamsky 07099b6256 style, grammar, spelling fixes.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
2014-08-05 18:11:32 -07:00
Dan Walsh b4813f2841 Docker should use /var/lib/container/tmp for large temporary files.
/tmp is often a tmpfs file system and large temporary files could cause
docker commands to fail.  Also using /tmp potentially allows users on the
system to get access to content, or even attack the content.  Moving the tmpdir to
/var/lib/container/tmp will protect the data.

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

Conflicts:
	docker/docker.go
2014-08-05 16:43:42 -04:00
Tianon Gravi 60341f80d7 Purge the bits of pkg/system that moved to libcontainer/system
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-08-02 01:35:04 -06:00
Michael Crosby 69aa07af1e Merge pull request #7378 from rajdeepd/master
Added test cases for no port, -ve port passed to nat.ParsePortSpecs
2014-08-01 13:45:17 -07:00
Solomon Hykes f46de04af6 Cleanup daemon/Daemon.Install for readability
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:25:02 -04:00
Solomon Hykes d037007658 Move "containers" to daemon/list.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:24:58 -04:00
Solomon Hykes aa49632fef Move "top" to daemon/top.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:24:52 -04:00
Solomon Hykes 49e61f62ce Move "changes" to daemon/changes.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

Fix issues with renaming changes to container_changes
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-08-01 14:24:46 -04:00
Solomon Hykes 06229a4b76 Move "copy" to daemon/copy.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:24:41 -04:00
Solomon Hykes cc39d579f5 Move "delete" to daemon/delete.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

Fix issues with renaming container_delete to delete
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-08-01 14:24:28 -04:00
Solomon Hykes 066330fc96 Move "logs" to daemon/logs.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:29 -04:00
Solomon Hykes fdad41f5b9 Move "commit" to daemon/commit.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:24 -04:00
Solomon Hykes e0fd96f850 Move "resize" to daemon/resize.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:20 -04:00
Solomon Hykes c4ce396f46 Move "wait" to daemon/wait.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:16 -04:00
Solomon Hykes bd54a73c42 Move "restart" to daemon/restart.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:11 -04:00
Solomon Hykes 4180b87514 Move "start" to daemon/start.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:17:04 -04:00
Solomon Hykes 03c07617cc Move "stop" to daemon/stop.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:16:59 -04:00
Solomon Hykes 80f3272ee9 Move "create" to daemon/create.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:16:50 -04:00
Solomon Hykes 8031c23b0f Move "export" to daemon/export.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:16:41 -04:00
Solomon Hykes 8652830661 Move "kill" to daemon/kill.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-08-01 14:16:05 -04:00
Rajdeep Dua 4cb2cfed9f Added test cases for no port passed to nat.ParsePortSpecs and negative port number passed
Docker-DCO-1.1-Signed-off-by: Rajdeep due <dua_rajdeep@yahoo.com> (github: rajdeepd)
2014-08-01 23:41:34 +05:30
Michael Crosby 5d2a62d8de Merge pull request #7295 from vishh/rbind
Make lxc driver rbind all user specified mounts.
2014-08-01 10:25:45 -07:00
Victor Vieux 90dadea84d Merge pull request #7344 from shykes/cleanup-server-attach
Move container-related jobs out of deprecated server/ package
2014-07-31 15:56:48 -07:00
Michael Crosby b1496effe3 Merge pull request #7312 from tianon/update-libcontainer
Bump libcontainer dep
2014-07-31 15:20:07 -07:00
Tianon Gravi 57b9467f45 Add support for autodetected HOME from USER (if HOME is unset)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-07-31 12:46:36 -06:00
unclejack 19c8e74fd3 Merge pull request #7100 from discordianfish/fix-port-allocation
Fix masked err in portmapper
2014-07-30 23:51:21 +03:00
Solomon Hykes 63bd4ad9d6 Move "unpause" to daemon/pause.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 14:01:43 +00:00
Solomon Hykes 42a77de3d3 Move "pause" to daemon/pause.go
This is part of an effort to break apart the deprecated server/ package

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-07-30 14:01:40 +00:00