Commit Graph

306 Commits

Author SHA1 Message Date
Josh Poimboeuf fc2f5758cf fix container restart race condition
Finish container cleanup before setting the state to stopped.
Otherwise, for an application that exits quickly, a call to Restart
can allow Start to be called again before cleanup is done, resulting in
overritten data in the Container struct.
2013-11-18 11:42:30 -06:00
Michael Crosby 629c6e3649 Merge pull request #2445 from alexlarsson/fix-shared-root-from-dm
Fix lxc start for shared root filesystems
2013-11-14 11:20:53 -08:00
Victor Vieux bc6d872841 on docker start, do not cleanup if already running 2013-11-11 18:15:38 -08:00
Victor Vieux 4c7d24bc8b Merge branch 'master' of https://github.com/zilin/docker into zilin-master
Conflicts:
	container.go
2013-11-11 12:59:18 -08:00
Victor Vieux 87c8437a90 Merge pull request #2140 from SvenDowideit/2098-run-cidfile-should-return-longid
Server: always return long id's
2013-11-11 13:06:19 -08:00
Victor Vieux da24945070 Merge branch 'master' of https://github.com/aanand/docker into aanand-master 2013-11-11 12:34:16 -08:00
Sven Dowideit b3974abe4f make all image ID and container ID API responses use the Long ID (Closes #2098) 2013-11-09 12:16:49 +10:00
Michael Stapelberg e7fdcc15c5 Return “err” instead of “nil” when MkdirAll() fails when binding a volume 2013-11-08 22:52:10 +01:00
Victor Vieux 49d7b87cfc prevent panic if you use API in a wrong way 2013-11-07 18:54:00 -08:00
Victor Vieux f417c4b099 Merge branch '1887-allow_ro_volumes-from' of https://github.com/daniel-garcia/docker into daniel-garcia-1887-allow_ro_volumes-from 2013-11-07 17:59:55 -08:00
Guillaume J. Charmes 6998c3c387
go fmt 2013-11-07 12:27:33 -08:00
Alexander Larsson 157d99a727 lxc: Work around lxc-start need for private mounts
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.

We work around this by starting up lxc-start in its own namespace where
we set / to rshared.

Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
2013-11-06 20:43:06 +01:00
Mark Allen 74f853a2ae See if a path exists before injecting Reader there
Closes #1965
2013-11-05 23:44:52 -06:00
unclejack 4b8c41c4a2 disallow / as source for bind mount in the cli
This makes the docker cli reject docker run commands which include bind
mounts like "/:/some/path/in/the/container".
Bind mounting the root directory is a bad idea and the cli should throw
an error right away.

The same check will also be made by the remote API via another commit.
2013-11-05 22:52:54 +02:00
Daniel Garcia f9cb6ae46a Add ability to mount volumes in readonly mode using -volumes-from 2013-11-05 11:58:51 -06:00
Guillaume J. Charmes 342bd43b76 Merge pull request #2525 from dotcloud/fix_hostnames
Fix regression in /etc/hosts
2013-11-04 11:26:27 -08:00
Paul Nasrat 95708dd35c Create new network on dead ghosts on restart.
Fixes #2089
2013-11-03 14:13:18 -05:00
Victor Vieux f3685333c0 fix regression in /etc/hosts 2013-11-01 15:46:26 -07:00
Victor Vieux 7ddd4fe66a rebase 2013-11-01 14:01:32 -07:00
Jérôme Petazzoni 31638ab2ad Refactor HostConfig and escape apparmor confinement 2013-11-01 13:55:19 -07:00
Michael Crosby 65ba2868d7 Merge pull request #2492 from dotcloud/publish-all-flag
Add -P flag to publish all exposed ports
2013-11-01 10:21:02 -07:00
Aanand Prasad 9ee9d2f995 Container memory limit can be specified in kilobytes, megabytes or gigabytes
-m 10  # 10 bytes
    -m 10b # 10 bytes
    -m 10k # 10240 bytes (10 * 1024)
    -m 10m # 10485760 bytes (10 * 1024 * 1024)
    -m 10g # 10737418240 bytes (10 * 1024 * 1024 * 1024)

Units are case-insensitive, and 'kb', 'mb' and 'gb' are equivalent to 'k', 'm' and 'g'.
2013-11-01 12:00:17 +00:00
Michael Crosby 96d1e9bb5a Move archive.go to sub package 2013-10-31 16:57:45 -07:00
Michael Crosby 652f07bb59 Add -P flag to publish all exposed ports 2013-10-31 11:28:30 -07:00
Zilin Du b543516556 Merge remote-tracking branch 'upstream/master'
Conflicts:
	container.go
2013-10-31 10:53:40 -07:00
Brian Olsen 1c3a674444 Fixed problem with variables containing \n.
The /.dockerenv file is now a marshalled json array so that environment
variables with \n and other weird values are supported.
2013-10-31 01:19:32 +01:00
Brian Olsen 25c4c87c86 Support copying value from env with -e option. 2013-10-31 01:19:09 +01:00
Brian Olsen be7eb4bfcb Set environment variables using a file. 2013-10-31 00:48:12 +01:00
Michael Crosby 746ba127bf Hotfix: Migrate public mappings after upgrade 2013-10-30 08:15:12 -07:00
Victor Vieux e0b59ab52b Enable sig-proxy by default in run and attach 2013-10-29 11:18:34 -07:00
Michael Crosby 0d2924408b Add -name for docker run
Remove docker link
Do not add container id as default name
Create an auto generated container name if not
specified at runtime.
2013-10-28 18:09:08 -07:00
Tianon Gravi cf86e2bb22 Rename all cases of "docker-init" to "dockerinit" for consistency 2013-10-25 15:13:25 -07:00
Alexander Larsson d063c8d941 Move ListOps to utils submodule
This will be needed for later use in docker-init without a docker
dependency
2013-10-25 15:13:24 -07:00
Michael Crosby 1cbdaebaa1 Add links for container relationships and introspection 2013-10-25 15:13:24 -07:00
Michael Crosby ff567f8729 Merge pull request #2385 from dotcloud/suppress_even_more_warnings_test
Improve tests again, remove warnings and prevent some mount issues
2013-10-25 15:04:56 -07:00
Victor Vieux a675e249b1 fix workdir, hostname tests and a bunch on mount issue 2013-10-24 16:57:35 -07:00
Jérôme Petazzoni b9eb5e04ae Ignore ErrClosedPipe for stdin in Container.Attach.
But pass `err` in the error channel anyway; don't ignore it anymore.
2013-10-24 15:04:58 -07:00
Victor Vieux 10e10c9573 fix race condition in docker build with verbose + cleanup hostIntegration debug 2013-10-22 15:01:06 -07:00
Guillaume J. Charmes 3e014aa662 Fix attach race condition, improve unit tests, make sure the container is started before unblocking Start 2013-10-18 16:26:16 -07:00
Guillaume J. Charmes 333bc23f21 Fix issue killing container while sending signal
Fix rebase issue
Update docs
2013-10-18 16:19:27 -07:00
Guillaume J. Charmes 4918769b1a Add -nostdin and -proxy to docker attach, allow arbirary signal to be sent via docker kill api endpoint
Allow attach from `docker start`
Add host integration script generation
Update doc with host integration
2013-10-18 16:16:29 -07:00
Michael Crosby 3ba9893786 Merge pull request #2242 from jpetazzo/remove-spurious-errors-and-errclosedpipe
Fix error/debug messages in Container.Attach and recover from ErrClosedPipe
2013-10-16 17:27:23 -07:00
Victor Vieux e40fd1e3e1 fix panic 2013-10-16 21:39:03 +00:00
Guillaume J. Charmes ed6ca109bf
Refactor container.Start() 2013-10-16 13:12:56 -07:00
Victor Vieux 664acd2971 Add clean if start fail 2013-10-16 19:48:24 +00:00
Jérôme Petazzoni fc659b68e4 Fix error/debug messages in Container.Attach and recover from ErrClosedPipe conditions. 2013-10-16 11:35:45 -07:00
Karl Grzeszczak ad723bbfe7 Initial steps to fix Issue #936
Use utils.Errorf instead of utils.Debugf
2013-10-11 08:04:40 -05:00
Zilin Du c2912c82aa change 127.0.0.1 -> 127.0.1.1 & remove ::1 -> hostname mapping 2013-10-10 09:44:48 -07:00
Zilin Du 7d95d300ab replace 127.0.0.1 by the assigned IP address in the container's /etc/hosts file. 2013-10-08 14:29:22 -07:00
Victor Vieux bcce3cbdd1 Merge pull request #1995 from dotcloud/fix_attach_2
Fix the attach behavior with -i
2013-09-30 03:29:19 -07:00