Commit Graph

62858 Commits

Author SHA1 Message Date
Guillaume J. Charmes 1eaaa6b744 Flush stdout on import to avoid deadklock when waiting for stdin (import -). Fixed #365 2013-04-09 10:02:57 -07:00
Guillaume J. Charmes cb54e9c659 Flush whether or not there we set the rawmode to avoid the client to lock 2013-04-09 09:59:30 -07:00
Guillaume J. Charmes 7c2b085d1a Add inconditionnal lock in Start/Stop/Kill to avoid races 2013-04-09 09:09:54 -07:00
Guillaume J. Charmes d063d52cce Update the unit test to reflect the new CmdRun behaviour in tty mode 2013-04-09 08:18:36 -07:00
Guillaume J. Charmes 64c1b6d9cd Change the behaviour of CmdRun in tty mode: dont kill the process uppon detach 2013-04-09 08:18:16 -07:00
John Costa 8f15c423e6 add documentation for running a redis process with docker 2013-04-09 11:04:14 -04:00
Guillaume J. Charmes 329f4449dc Remove the mutexes and use chan instead in order to handle the wait lock 2013-04-09 07:57:59 -07:00
Solomon Hykes 0767916ade Merge pull request #346 from srid/patch-2
make the service example work
2013-04-08 22:12:34 -07:00
Solomon Hykes 10923c7890 Merge remote-tracking branch 'origin/pty_fix-1' 2013-04-08 21:12:22 -07:00
Thatcher Peskens 2832ea0cfe Added code and color for 'note' and updated the hello world note. 2013-04-08 20:10:47 -07:00
Solomon Hykes a7299a3f26 Merge remote-tracking branch 'origin/unit_test_improvment-2' 2013-04-08 18:29:12 -07:00
Solomon Hykes 1601366cb6 Make it more clear when Docker fails to allocate a free IP range for its bridge 2013-04-08 18:16:58 -07:00
Louis Opter e9a68801ba Update the tests according to the "optional raw mode" changes 2013-04-08 16:07:12 -07:00
Guillaume J. Charmes f73401fb9a Add missing file 2013-04-08 16:07:12 -07:00
Guillaume J. Charmes dcf4572a69 Set the raw mode only for tty enabled containers 2013-04-08 16:07:12 -07:00
Guillaume J. Charmes d530d581f7 Make commands.go more idiomatic. Use DockerConn only when needed, keep io.Writer when not 2013-04-08 15:58:09 -07:00
Guillaume J. Charmes bdf05d8368 Reenable CmdRunAttachStdin and CmdRunHostname now using the DockConn interface 2013-04-08 15:58:09 -07:00
Guillaume J. Charmes b71b226cc1 Improve error management (avoid unwanted output in tests) 2013-04-08 15:58:09 -07:00
Guillaume J. Charmes 80f6b4587b Edit the tests for them to use the new command API. Disable TestRunHostname and TestAttachStdin. 2013-04-08 15:58:09 -07:00
Guillaume J. Charmes e6e9c1cd62 Use io.WriteCloser instead of *os.File in DockerLocalConn so we can use it with standard writers and pipes 2013-04-08 15:58:09 -07:00
Guillaume J. Charmes 246eed52de Move DockerLocalConn and terminal functions form package "main" to "rcli" in order to be able to use DockerLocalConn in commands_test.go 2013-04-08 15:58:09 -07:00
Louis Opter b306a60738 Simplification in the goroutine that restore the terminal state on SIGINT 2013-04-08 15:58:09 -07:00
Louis Opter 7d0ab3858e Only set the terminal in raw mode for commands which need it
The raw mode is actually only needed when you attach to a container.
Having it enabled all the time can be a pain, e.g: if docker crashes
your terminal will end up in a broken state.

Since we are currently missing a real API for the docker daemon to
negotiate this kind of options, this changeset actually enable the raw
mode on the login (because it outputs a password), run and attach
commands.

This "optional raw mode" is implemented by passing a more complicated
interface than io.Writer as the stdout argument of each command. This
interface (DockerConn) exposes a method which allows the command to set
the terminal in raw mode or not.

Finally, the code added by this changeset will be deprecated by a real
API for the docker daemon.
2013-04-08 15:58:09 -07:00
Louis Opter 4e5001b46a Remove the unused http transport from rcli 2013-04-08 15:58:09 -07:00
Solomon Hykes b8f9803459 Merge pull request #347 from kencochrane/303_docs_fix
improved the example docs to help #303
2013-04-08 11:50:07 -07:00
Solomon Hykes 0c018d3697 Merge pull request #356 from flavio/improve_python_web_app_example
Extend the documentation covering the web app example
2013-04-08 11:49:17 -07:00
Flavio Castelli 72fdb41069 Extend the documentation covering the web app example
Make it clear how to access the web app running inside of the container
from the host.
2013-04-08 17:39:30 +02:00
Ken Cochrane 6eb8a74ff9 added headers to examples linking back to running the examples page 2013-04-07 10:23:00 -04:00
Ken Cochrane 81ebf4fcf6 made a new running the examples page, and added a link to the top of each example to the page to show people how to run them. 2013-04-07 10:21:08 -04:00
Sridhar Ratnakumar 9875a9b1f1 sync with README 2013-04-07 00:43:57 -07:00
Sridhar Ratnakumar 27feba4594 make the service example work
issue #98 requires connecting to localhost (which `hostname` may resolve to) will not work.
2013-04-07 00:41:24 -07:00
Guillaume J. Charmes c83393a541 Move the DockerConn flush to its own function 2013-04-05 20:08:31 -07:00
Guillaume J. Charmes 7e1e7d14fa Make sure to flush buffer when setting raw mode 2013-04-05 19:48:49 -07:00
Guillaume J. Charmes 99b5bec069 Fix run disconnect behavious in tty mode + add unit test to enforce it 2013-04-05 19:02:35 -07:00
Guillaume J. Charmes 7d8895545e Cleanup pty variable names 2013-04-05 17:40:55 -07:00
Guillaume J. Charmes 33a5fe3bd4 Make sure the process start in his own session and grabs the terminal 2013-04-05 17:40:55 -07:00
Guillaume J. Charmes 847a8f45a4 Merge the 3 ptys in 1 2013-04-05 17:40:55 -07:00
Solomon Hykes 8cf30395a1 Changed default bridge interface do 'docker0' 2013-04-05 14:16:19 -07:00
Solomon Hykes 22adb52c0a The flag to use a pre-existing bridge interface is '-b'. Added explanation 2013-04-05 14:16:04 -07:00
Solomon Hykes 793c1ad990 Merge remote-tracking branch 'origin/219-default-bridge-2' 2013-04-05 14:02:16 -07:00
Solomon Hykes febaeebfb8 Add tests of tcp port allocator 2013-04-05 13:03:24 -07:00
Solomon Hykes d32f184696 Fix a race condition when running the port allocator 2013-04-05 13:03:04 -07:00
Guillaume J. Charmes 20085794f0 Increase the timeout in TestStart() to make sure the container has the time to die within the function 2013-04-05 02:01:38 -07:00
Solomon Hykes a4fc52305a Bumping version to 0.1.3 2013-04-04 23:05:03 -07:00
Solomon Hykes 2aad4a3478 Choose which TCP frontend port to allocate with '-p :PORT' 2013-04-04 22:58:01 -07:00
Solomon Hykes a5fb1d6c01 Refactored PortAllocator to allow for same-frontend constraint 2013-04-04 22:56:12 -07:00
Guillaume J. Charmes b76b329ef0 Prevent destroy() to stop twice container in TestRestore() 2013-04-04 20:40:42 -07:00
Guillaume J. Charmes bae6f95830 Increase the timeout of TestRestore() to avoid unwanted timeout error 2013-04-04 20:32:44 -07:00
Guillaume J. Charmes cda9cf1539 Avoid unwanted warnings from destroy() in TestStart() 2013-04-04 20:30:24 -07:00
Solomon Hykes f344212b93 Renamed PortAllocator.populate() to run() 2013-04-04 19:49:32 -07:00