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

577 Коммитов

Автор SHA1 Сообщение Дата
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