Commit Graph

60 Commits

Author SHA1 Message Date
67bf5ba305 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6bca8ec3c9ccc169c53b3d7060fe5c8ba8670aac
Component: engine
2015-07-28 22:31:01 -07:00
1b5a1d2d53 Merge pull request #14547 from duglin/ErrDeadExec
Return 404 on exec-inspect when container is dead but exec is still around
Upstream-commit: 4dbdd98b4142dbda1c6028c17a9a0d6dd8cdce04
Component: engine
2015-07-27 10:46:32 -07:00
a1d7796250 fix the panic caused by resizing a starting exec
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: ba5e0980527d3477cb85925e07eecb28dfe50e08
Component: engine
2015-07-24 20:43:07 +08:00
0a8f0f82e0 Quieter debug logging for clean exec commands
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b271593c34a67f4040405c952fdb402bf5dcd151
Component: engine
2015-07-13 10:36:36 -07:00
1e1ad91010 Return 404 on exec-inspect when container is dead but exec is still around
When a container is removed but it had an exec, that still hasn't been
GC'd per PR #14476, and someone tries to inspect the exec we should
return a 404, not a 500+container not running.  Returning "..not running" is
not only misleading because it could lead people to think the container is
actually still around, but after 5 minutes the error will change to a 404
after the GC. This means that we're externalizing our internall soft-deletion/GC
logic which shouldn't be any of the end user's concern. They should get the
same results immediate or after 5 minutes.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: d841b779fda882c3fd505f626c01cc9d60768aa6
Component: engine
2015-07-10 20:19:42 -07:00
e0ffc7b501 Use mark and sweep for exec command removal
This takes the final removal for exec commands in two steps.  The first
GC tick will mark the exec commands for removal and then the second tick
will remove the config from the daemon.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 34ab8c432691934745d66ee94ff4aec1120518e0
Component: engine
2015-07-09 14:51:10 -07:00
6d71e61742 Add GC loop to clean exec command refs on daemon
This adds an event loop for running a GC cleanup for exec command
references that are on the daemon.  These cannot be cleaned up
immediately because processes may need to get the exit status of the
exec command but it should not grow out of bounds.  The loop is set to a
default 5 minute interval to perform cleanup.

It should be safe to perform this cleanup because unless the clients are
remembering the exec id of the process they launched they can query for
the status and see that it has exited.  If they don't save the exec id
they will have to do an inspect on the container for all exec instances
and anything that is not live inside that container will not be returned
in the container inspect.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 5f017bba48e5c763157e1b35a5edea64cc41fc6a
Component: engine
2015-07-08 13:47:59 -07:00
51dfe1d73a Remove exec config from container after exit
This removes the exec config from the container after the command exits
so that dead exec commands are not displayed in the container inspect.
The commands are still kept on the daemon so that when you inspect the
exec command, not the container, you are still able to get it's exit
status.

This also changes the ProcessConfig to a pointer.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 04c9f86bdcf9f42deb09df76922a8c61205721a2
Component: engine
2015-07-08 10:55:42 -07:00
d99f89f02c Merge pull request #14268 from unclejack/lower_allocations_execdriver
daemon: lower allocations
Upstream-commit: bb364ff459e8ebcc601a13057a1477336646474b
Component: engine
2015-06-30 12:12:06 -07:00
b565b94e85 daemon: lower allocations
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: c1477db04fc32621652cf6a8fd2976b6bbf2066e
Component: engine
2015-06-30 01:45:31 +03:00
73973301dc Default process user to container config user.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 0faa4518ed2dad592bb238838b4df2b34d2171c3
Component: engine
2015-06-29 12:52:05 -07:00
4f79291859 Cleanup container LogEvent calls
Move some calls to container.LogEvent down lower so that there's
less of a chance of them being missed. Also add a few more events
that appear to have been missed.

Added testcases for new events: commit, copy, resize, attach, rename, top

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8232312c1e705753d3db82dca3d9bb23e59c3b52
Component: engine
2015-06-01 12:39:28 -07:00
d89704cf56 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5929b038816d8bd18d462a19e571c99.

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

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
Upstream-commit: 40b71adee390e9c06471b89ed845132b4ec80177
Component: engine
2015-05-26 14:12:16 -07:00
8b7803021e Windows: Split ContainerExecCreate
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e35b025aa61e7d8db04a9973967b7109f742593a
Component: engine
2015-05-06 16:19:27 -07:00
5306450032 cleanup: move container's functions to its file
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 1be7a10b89506afdcb80f109f323b6e47d2e466c
Component: engine
2015-05-04 21:37:44 +08:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
f089bf1e0a 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>
Upstream-commit: 24425021d26f29a475702064181e6c99fb6bd1c5
Component: engine
2015-04-22 13:51:57 -07:00
234898b4e7 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 767df67e3149b83255db0809f6543b449a4f652e
Component: engine
2015-04-15 10:22:07 -07:00
aaaa676179 Add docker exec run a command in privileged mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 72a500e9e5929b038816d8bd18d462a19e571c99
Component: engine
2015-04-11 11:26:37 +08:00
d1f2626097 Add -u|--user flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 2cce4791b0e75201cb65daad07d4203d1c4c2996
Component: engine
2015-04-11 11:04:24 +08:00
49e191d0e4 Remove engine usage from attach
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c44f513248a8b40b1b2221726c7441881383e919
Component: engine
2015-04-07 14:23:09 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
a16f3d6cb4 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c79b9bab541673af121d829ebc3b29ff1b01efa2
Component: engine
2015-03-25 22:32:08 +01:00
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
394722ec93 fix a minor typo in daemon/exec.go
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 5b794c413a147dbc06f76caa6f2c32d1f4b1f2ce
Component: engine
2015-02-26 19:11:27 +08:00
bdb65abebf Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7a9c944b827dc0cd416d701fe6460264f05166bb
Component: engine
2015-02-23 18:43:10 +00:00
079f594f83 Merge pull request #10573 from LK4D4/return_attach_to_builder
Change verbose builder out back to attach
Upstream-commit: e345fe53ba1e8f84cef2396e332860a87fcd65da
Component: engine
2015-02-06 14:37:09 -08:00
5d5fbc1d01 Change verbose builder out back to attach
This is sort of "revert" of #8415. There is some problems with using
logs:
* Non-live progressbars
* Races when you can try to get logs before it was written(there was
  occasional errors in tests)

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 1095d5e5e43654aa27952f131b71c55f18fedc4b
Component: engine
2015-02-04 15:37:14 -08:00
685b876322 Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069
Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>
Upstream-commit: d25a65375c880017ac0c516389b0b7afde810517
Component: engine
2015-01-21 17:11:31 -08:00
8e21317253 Merge pull request #9858 from jfrazelle/exec-buildtag
The comment for build in exec had a typo
Upstream-commit: a33f7a07d1ea21d2a6912d84877eb7fc9e1c2303
Component: engine
2015-01-06 10:26:21 -08:00
bb5364c7fd Add plus to build
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: f339d3bceb4634bba1bc27e455d0fd8505df17bf
Component: engine
2015-01-06 10:07:13 -08:00
4309ebf3d1 Add exec event create/start log
added exec event log follwing issue #8662 proposal.
logging events for exec create and start API

Signed-off-by: daehyeok mun <daehyeok@daehyeokui-MacBook-Air.local>
Upstream-commit: e3d813f37f48ed52330e3dc26aa363e58401fbf5
Component: engine
2015-01-03 20:38:25 +09:00
055349b7c9 add docs
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: bbb92e1436b5a288d07ef8ea0fad80f2c4715faa
Component: engine
2014-12-24 00:12:35 +00:00
2a769cedb6 add ExecIDs in inspect
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 4b43a6df7acd98228b8b287eedf38ba87dc8a388
Component: engine
2014-12-23 22:03:20 +00:00
2b487e0de2 Fix the issue when docker exec a paused container, it will always hang.
Add the test case of this issue.

Docker-DCO-1.1-Signed-off-by: Chen Chao <cc272309126@gmail.com> (github: cc272309126)
Upstream-commit: 1bb02117db80e75f406f6c63d8d50680c1569019
Component: engine
2014-12-05 03:10:44 +08:00
67d69faf00 Check for no Cmd on exec create endpoint
Fixes #9414

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c8a3d31332074ddc226086ff1f0c042b6e120232
Component: engine
2014-12-01 17:54:15 -05:00
3253386751 Merge pull request #9208 from duglin/Issue8703
Add support for docker exec to return cmd exitStatus
Upstream-commit: 00c2a8f323548b7d0aa54cfd10a594dd93ddbed0
Component: engine
2014-11-25 18:03:51 -08:00
c28ef478d3 Add support for docker exec to return cmd exitStatus
Note - only support the non-detached mode of exec right now.
Another PR will add -d support.

Closes #8703

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 90928eb1140fc0394e2a79d5e9a91dbc0f02484c
Component: engine
2014-11-25 17:49:25 -08:00
1f85619ac6 Cleanup exec API docs and available params
Adds pertitent information about what is expected in the json payload
and comments out unsupported (exec) features in runConfig.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d4ba00bd4237ebf6e8016a350d95cc060e5e8a05
Component: engine
2014-11-21 21:11:07 -05:00
12147a008d Close stdin after execution with docker exec -i
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 165624062e1ac105b6e45beba51cec6439918f11
Component: engine
2014-11-05 15:12:24 -08:00
08749b6912 Merge pull request #8571 from ncdc/3631-stdout-premature-eof
Fix stdout premature EOF
Upstream-commit: f936a10d8048f471d115978472006e1b58a7c67d
Component: engine
2014-10-29 11:36:32 -07:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
7e904deb7c Fix stdout premature EOF
Never close attached stream before both stdout and stderr have written
all their buffered contents. Remove stdinCloser because it is not needed
any more as the stream is closed anyway after attach has finished.

Fixes #3631

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Upstream-commit: 5572dbb7504c951f4ddd2710a4037844a95caa6a
Component: engine
2014-10-22 16:34:42 -04:00
9bac41ed10 Make daemon.Attach private
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 2db1caee4f23e81107b2647c06b4c677f6ecd7a1
Component: engine
2014-10-17 13:20:02 -07:00
20022966a7 Merge pull request #8302 from rafecolton/move_archive_package_to_pkg
Move archive package to pkg
Upstream-commit: 4424d15f9936a6cf663d06284c932f91306d9353
Component: engine
2014-10-01 18:03:34 +03:00
1dd6380138 Adding exec remote API documentation along with minor code cleanup.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 021ecb1d1355e8291a5a872c761a1e367072e308
Component: engine
2014-09-30 18:26:58 +00:00
cc7745c80d Fix typo:betweem->between and PtySlace->PtySlave
Signed-off-by: Arika Chen <eaglesora@gmail.com>
Upstream-commit: bfc9d8bbea2f41247fa543034bbbf64704ae3aae
Component: engine
2014-09-30 07:22:09 -04:00
3ffb3fc6cc 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>
Upstream-commit: b845a62149d5f4990462ac6c9167c5cfaa0e66cb
Component: engine
2014-09-29 23:16:27 -07:00
5a623782b5 Merge pull request #8191 from vieux/improve_error_exec_lxc
Improve error for docker exec & LXC
Upstream-commit: 0913009ebee670d5eb0f585cd8dffcb59f873bce
Component: engine
2014-09-25 15:58:21 -07:00