Commit graph

231 commits

Author SHA1 Message Date
Victor Vieux
eee6d3dae9 add TEST env var during tests and silenced parserun during tests 2013-08-29 22:55:29 +00:00
Michael Crosby
c2b273df5d Merge pull request #1611 from pysqz/master
Make sure 'Ghost' container is available with allocated IP
2013-08-27 11:30:00 -07:00
pysqz
cc18a9c650 Also reuse forwarding ports 2013-08-28 03:14:21 +08:00
Michael Crosby
551092f9c0 Add lxc-conf flag to allow custom lxc options 2013-08-22 16:05:21 +00:00
pysqz
2f6ce27fde Make sure 'Ghost' container is available with allocated IP 2013-08-21 22:37:58 +08:00
Victor Vieux
b21f898620 assume ip_forwarding = 1 by default 2013-08-19 12:34:30 +00:00
Marco Hennings
687d27ab57 Add an option to set the working directory.
This makes it possible to simply wrap a command inside a container. This makes
it easier to use a container as an unified build environment.

Examples:

~/workspace/docker
$ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu ls
AUTHORS		 Makefile	archive.go	   changes.go	      docker
[...]


docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd
/home/marco/workspace/docker
2013-08-18 19:34:01 +02:00
Michael Crosby
15bc2240ac Merge pull request #1505 from dotcloud/improve_events
Add image name in /events
2013-08-14 15:40:36 -07:00
Guillaume J. Charmes
631c449183 Merge pull request #1496 from xdissent/1351-volumes-from-before-volumes
* Runtime: Apply volumes-from before creating volumes
2013-08-14 15:10:41 -07:00
Jérôme Petazzoni
280901e5fb add -insecure flag and relevant tests 2013-08-13 16:20:22 -07:00
Victor Vieux
703905d7ec ensure the use oh IDs and add image's name in /events 2013-08-12 11:50:03 +00:00
Greg Thornton
57b49efc98 Skip existing volumes in volumes-from
Removes the error when a container already has a volume that would otherwise
be created by `Config.VolumesFrom`. Allows restarting containers with a
`Config.VolumesFrom` set.
2013-08-10 06:37:57 +00:00
Greg Thornton
3bd73a9633 Apply volumes-from before creating volumes
Copies the volumes from the container specified in `Config.VolumesFrom` before
creating volumes from `Config.Volumes`. Skips any preexisting volumes when
processing `Config.Volumes`. Fixes #1351
2013-08-10 04:55:23 +00:00
Colin Rice
10190be5d7 Add warning when net.ipv4.ip_forwarding = 0
Added warnings to api.go, container.go, commands.go, and runtime.go
Also updated APIInfo to return whether IPv4Forwarding is enabled
2013-08-07 18:28:39 -04:00
Michael Crosby
d94b186080 Strip leading forward slash from resource 2013-08-06 16:09:54 +00:00
Michael Crosby
5b8cfbe15c Add cp command and copy api endpoint
The cp command and copy api endpoint allows users
to copy files and or folders from a containers filesystem.

Closes #382
2013-08-06 16:09:54 +00:00
Guillaume J. Charmes
f6fa353dd8 Merge pull request #1267 from sridatta/new-clean-init
* Runtime: Fix to "Inject dockerinit at /.dockerinit"
2013-08-05 13:23:22 -07:00
Guillaume J. Charmes
29de2432ea Merge pull request #1350 from ndarilek/1348-add-hostname-to-environment
Runtime: add hostname to environment
2013-08-02 13:58:43 -07:00
Nolan
9a604acc23 Add hostname to the container environment. 2013-07-31 09:50:53 -05:00
Victor Vieux
cd9f7f29d1 Merge pull request #1334 from dotcloud/1314-compat_broke-fix
Discard error when loading old container format
2013-07-31 01:08:08 -07:00
Thatcher Peskens
5dc86d7bca Updated the description of run -d
The goal is to make it more clear this will give you the container id after run completes.

Since stdout is now standard on run, "docker run -d" is the best (or only) way to get the container ID returned from docker after a plain run, but the description (help) does not hint any such thing.
2013-07-29 14:17:15 -07:00
Victor Vieux
b2aa877bf0 fix #1314 discard error when loading old container format 2013-07-29 16:40:35 +00:00
Mike Gaffney
4ebe2cf348 Change reserve-compatibility to reverse-compatibility 2013-07-26 01:10:42 -07:00
Guillaume J. Charmes
fd9ad1a194
Fixes #505 - Make sure all output is send on the network before closing 2013-07-24 15:48:51 -07:00
Victor Vieux
ee05f97c9a Merge branch 'master' into 1167_events_endpoint-feature 2013-07-24 11:49:04 +00:00
Victor Vieux
a41384ad73 add die event 2013-07-23 15:42:34 +00:00
Victor Vieux
8165e51ecc Merge branch '858-disable-network-configuration' of https://github.com/stfp/docker into stfp-858-disable-network-configuration 2013-07-23 08:44:12 +00:00
Stefan Praszalowicz
bc172e5e5f Invert network disable flag and logic (unbreaks TestAllocate*PortLocalhost) 2013-07-22 19:00:35 -07:00
Victor Vieux
8ea9ccf3a7 Merge pull request #1244 from dotcloud/1020_add_variable
*Runtime: Add container=lxc in default env
2013-07-22 09:17:30 -07:00
Stefan Praszalowicz
49673fc45c Support completely disabling network configuration with docker -d -b none 2013-07-21 17:49:09 -07:00
Stefan Praszalowicz
3342bdb331 Support networkless containers with new docker run option '-n' 2013-07-21 17:11:47 -07:00
Victor Vieux
67f1e3f5ed add container=lxc in default env 2013-07-19 17:22:16 +00:00
Victor Vieux
ea12588524 remove usage from tests 2013-07-19 15:56:00 +00:00
Victor Vieux
0bd534adcf Merge pull request #1211 from dotcloud/new_logs
*Runtime: Logs are now synchronised
2013-07-19 06:43:29 -07:00
unclejack
64e74cefb7 add support for container ID files (a la pidfile) 2013-07-19 16:03:45 +03:00
Guillaume J. Charmes
d6fb313220 Merge pull request #1207 from crosbymichael/819-use-persistent-volume
* Runtime: Do not overwrite container volumes from config
2013-07-18 18:51:00 -07:00
Solomon Hykes
5d8efc107d + Runtime: inject dockerinit at /.dockerinit instead of overwriting /sbin/init. This makes it possible to run /sbin/init inside a container. 2013-07-17 17:13:34 -07:00
Guillaume J. Charmes
eefbadd230
Merge -b and -v options 2013-07-15 17:51:32 -07:00
Michael Crosby
92cbb7cc80 Do not overwrite container volumes from config
Fixes #819 Use same persistent volume when a container is restarted
2013-07-15 11:59:11 -09:00
Victor Vieux
599f85d4e4 store both logs in a same file, as JSON 2013-07-15 16:17:58 +00:00
Victor Vieux
5756ba9bc4 Merge branch 'master' into new_logs 2013-07-15 13:57:54 +00:00
Michael Crosby
5ae8c7a985 Copy VolumesRW values when using --volumes-from
Fixes #1201
2013-07-14 18:23:20 -09:00
Victor Vieux
a909223ee2 Merge pull request #1102 from dotcloud/1098-store_hostconfig_tmp
* Runtime: bind mounts are now preserved upon container restart
2013-07-12 05:04:10 -07:00
Victor Vieux
941e3e2ef0 wip 2013-07-11 17:18:28 +00:00
Victor Vieux
d918c7d9de export portmapping in network.go 2013-07-10 14:09:35 +00:00
Louis Opter
fac0d87d00 Add support for UDP (closes #33)
API Changes
-----------

The port notation is extended to support "/udp" or "/tcp" at the *end*
of the specifier string (and defaults to tcp if "/tcp" or "/udp" are
missing)

`docker ps` now shows UDP ports as "frontend->backend/udp". Nothing
changes for TCP ports.

`docker inspect` now displays two sub-dictionaries: "Tcp" and "Udp",
under "PortMapping" in "NetworkSettings".

Theses changes stand true for the values returned by the HTTP API too.

This changeset will definitely break tools built upon the API (or upon
`docker inspect`). A less intrusive way to add UDP ports in `docker
inspect` would be to simply add "/udp" for UDP ports but it will still
break existing applications which tries to convert the whole field to an
integer. I believe that having two TCP/UDP sub-dictionaries is better
because it makes the whole thing more clear and more easy to parse right
away (i.e: you don't have to check the format of the string, split it
and convert the right part to an integer)

Code Changes
------------

Significant changes in network.go:

- A second PortAllocator is instantiated for the UDP range;
- PortMapper maintains separate mapping for TCP and UDP;
- The extPorts array in NetworkInterface is now an array of Nat objects
  (so we can know on which protocol a given port was mapped when
  NetworkInterface.Release() is called);
- TCP proxying on localhost has been moved away in network_proxy.go.

localhost proxy code rewrite in network_proxy.go:

We have to proxy the traffic between localhost:frontend-port and
container:backend-port because Netfilter doesn't work properly on the
loopback interface and DNAT iptable rules aren't applied there.

- Goroutines in the TCP proxying code are now explicitly stopped when
  the proxy is stopped;
- UDP connection tracking using a map (more infos in [1]);
- Support for IPv6 (to be more accurate, the code is transparent to the
  Go net package, so you can use, tcp/tcp4/tcp6/udp/udp4/udp6);
- Single Proxy interface for both UDP and TCP proxying;
- Full test suite.

[1] https://github.com/dotcloud/docker/issues/33#issuecomment-20010400
2013-07-09 17:42:35 -07:00
Victor Vieux
bf7d6cbb4a rebase master 2013-07-08 13:26:29 +00:00
Caleb Spare
19121c16d9 Implement several golint suggestions, including:
* Removing type declarations where they're inferred
* Changing Url -> URL, Id -> ID in names
* Fixing snake-case names
2013-07-03 14:36:04 -07:00
Caleb Spare
1cf9c80e97 Mutex style change.
For structs protected by a single mutex, embed the mutex for more
concise usage.

Also use a sync.Mutex directly, rather than a pointer, to avoid the
need for initialization (because a Mutex's zero-value is valid and
ready to be used).
2013-07-02 15:53:08 -07:00
Victor Vieux
3042f11666 never remove the file and try to load it in start 2013-07-02 18:02:16 +00:00