Commit graph

477 commits

Author SHA1 Message Date
David Calavera
dd32445ecc Merge pull request #18697 from jfrazelle/pids-cgroup
Add PIDs cgroup support to Docker
2016-03-08 14:03:36 -08:00
Jessica Frazelle
69cf03700f
pids limit support
update bash commpletion for pids limit

update check config for kernel

add docs for pids limit

add pids stats

add stats to docker client

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-03-08 07:55:01 -08:00
Mrunal Patel
74bb1ce9e9 Add support for NoNewPrivileges in docker
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Add tests for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Update documentation for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-03-07 09:47:02 -08:00
Qiang Huang
53b0d62683 Vendor engine-api to 70d266e96080e3c3d63c55a4d8659e00ac1f7e6c
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-02-29 19:28:37 +08:00
Antonio Murdaca
d266142230 runconfig: opts: parse: lowercase errors
also fix wrong function comment

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-18 11:21:44 +01:00
David Calavera
a252516ec1 Inherit StopSignal from Dockerfile.
Make sure the image configuration is not overriden by the default
value in the `create` flag.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-12 17:56:40 -05:00
John Howard
d4b0732499 Windows: Fix 'isolation'
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-10 13:19:19 -08:00
Antonio Murdaca
a7d1aeceec postImagesCreate: move auth config decode when it's needed
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-29 14:07:54 +01:00
Bryan Boreham
7126ecd0ad Stop referring to requested IP address as "preferred",
since it is an error if that address is unavailable.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2016-01-26 15:13:26 +00:00
Alessandro Boch
3b0d36dbc1 Move ErrUnsupportedNetwork* checks to updateNetworkConfig() func
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-21 10:56:01 -08:00
Zhang Wei
31dae442c8 bugfix: prevent creating network 'default'
Default is predefined network and is reserved, so we should stop user
from creating network with name `default`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-19 11:06:36 +08:00
Madhu Venugopal
dda513ef65 Network scoped alias support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-14 08:44:41 -08:00
Sebastiaan van Stijn
47d87d3b92 Merge pull request #19229 from mavenugo/udlinks
Local alias support
2016-01-12 16:47:32 -08:00
Madhu Venugopal
e221b8a3d6 Support --link for user-defined networks
This brings in the container-local alias functionality for containers
connected to u ser-defined networks.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-01-12 13:38:48 -08:00
Jessica Frazelle
062d0b3921
read seccomp profile locally then pass to daemon
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-01-12 13:12:29 -08:00
Qiang Huang
f4a687334b Change OomKillDisable to be pointer
It's like `MemorySwappiness`, the default value has specific
meaning (default false means enable oom kill).

We need to change it to pointer so we can update it after
container is created.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit 9c2ea42329)

Conflicts:
	vendor/src/github.com/docker/engine-api/types/container/host_config.go
2016-01-12 13:19:17 -05:00
Alessandro Boch
2bb3fc1bc5 Allow user to choose the IP address for the container
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-08 10:09:16 -08:00
Antonio Murdaca
018081d5a9 Merge pull request #19058 from dnephin/move_opts_to_runconfig_opts
Move some opts validators to runconfig/opts where they are used
2016-01-08 12:34:49 +01:00
David Calavera
907407d0b2 Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-06 19:48:59 -05:00
Tibor Vass
df9a3d1005 Merge pull request #19092 from anusha-ragunathan/builder-rm-merge
Remove runconfig.Merge
2016-01-05 15:21:24 -05:00
Anusha Ragunathan
eb4ae8e28a Remove runconfig.Merge
Merge was used by builder and daemon. With this commit, the builder
call has been inlined and the function moved to the daemon package,
which is the only other caller.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-01-05 11:28:55 -08:00
Anusha Ragunathan
5190794f1d Use ImageBuildOptions in builder.
dockerfile.Config is almost redundant with ImageBuildOptions.
Unify the two so that the latter can be removed. This also
helps build's API endpoint code to be less dependent on package
dockerfile.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-01-05 10:09:34 -08:00
Daniel Nephin
0007f5a859 Move some validators from opts to runconfig/opts.
These validators are only used by runconfig.Parse() or some other part of the
client, so move them into the client-side package.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-04 14:35:36 -05:00
Daniel Nephin
c5a2fdb697 Move volume.SplitN() to the one place it is used in runconfig.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-04 12:06:30 -05:00
Daniel Nephin
2b7ad47bd2 Move the runconfig.Parse() function into the runconfig/opts package.
The parse.go file is used almost exclusively in the client. The few small
functions that are used outside of the client could easily be copied out
when the client is extracted, allowing this runconfig/opts package to
move to the client.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-04 12:06:29 -05:00
Daniel Nephin
4c0d586bd3 Move ParseExec to the client where it is used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-04 12:06:29 -05:00
Wen Cheng Ma
d7dc439623 Improvement for docker subcommand's help messages
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2016-01-01 12:27:28 +08:00
Qiang Huang
c68a483e44 Fix docs for memory-swap
Fixes: #18894

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-30 09:23:35 +08:00
David Calavera
3499e3a230 Merge pull request #18862 from dnephin/move_ulimit_opts_to_runconfig
Move ulimit opts to runconfig
2015-12-23 12:26:54 -08:00
Vincent Demeester
9ae6d7d551 Merge pull request #18861 from dnephin/move_blkiodev_to_runconfig
Move runconfig blkiodev options and parsing into runconfig/opts package
2015-12-23 21:19:44 +01:00
Daniel Nephin
5adbea7075 Move ulimit options to runconfig opts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-12-23 13:27:58 -05:00
Daniel Nephin
b8659da214 Remove unused parser functions that were replaced by go-connections/nat.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-12-22 19:06:49 -05:00
Daniel Nephin
f015c29193 Move runconfig blkiodev options and parsing into runconfig/opts package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-12-22 18:20:21 -05:00
David Calavera
7ac4232e70 Move Config and HostConfig from runconfig to types/container.
- Make the API client library completely standalone.
- Move windows partition isolation detection to the client, so the
  driver doesn't use external types.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:34:30 -05:00
David Calavera
839f73c302 Move ExecConfig to types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:31:46 -05:00
David Calavera
056e744903 Replace usage of pkg/nat with go-connections/nat.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:31:46 -05:00
David Calavera
0aab83d996 Move blkiodev package to types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:31:46 -05:00
David Calavera
f9b857a200 Move StrSlice to types.
This is a very docker concept that nobody elses need.
We only maintain it to keep the API backwards compatible.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:31:43 -05:00
Qiang Huang
8498ed73f7 Move OomKillDisable to resource
1. It's a cgroup api, fit the general defination that we take
cgroup options as kind of resource options.
2. It's common usage and very helpful as explained here:
https://github.com/docker/docker/pull/18270#issuecomment-160561316
3. It's already in `Resource` struct in
daemon/execdriver/driver_unix.go

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-22 16:08:04 +08:00
Ma Shimiao
843084b08b Add support for blkio read/write iops device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-21 09:14:49 +08:00
Daniel Nephin
233a4fc33c Move ParseLink and validators into runconfig.parse where they are used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-12-16 14:22:54 -05:00
David Calavera
4fef42ba20 Replace pkg/units with docker/go-units.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-16 12:26:49 -05:00
Justas Brazauskas
927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
Vincent Demeester
32f08e06e6 Merge pull request #18349 from mrfuxi/cli-specific-errors-in-api
Remove CLI specific information for API error messages. Issue #17147
2015-12-06 16:02:40 +01:00
Ma Shimiao
3f15a055e5 Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-04 09:26:03 +08:00
Karol Duleba
74900edbf8 Remove CLI specific information for API error messages. Issue #17147
Signed-off-by: Karol Duleba <mr.fuxi@gmail.com>
2015-12-03 15:23:07 +00:00
Arnaud Porterie
8f1f53f735 Merge pull request #16277 from runcom/add-oom-score-adj
Add OomScoreAdj
2015-12-02 11:49:51 -08:00
Dan Walsh
b3e527dfd2 This patch adds --tmpfs as a option for mounting tmpfs on directories
It will Tar up contents of child directory onto tmpfs if mounted over

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-12-02 10:06:59 -05:00
Antonio Murdaca
2969abc6c5 Move defaultSHMSize in daemon pkg
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-02 10:28:10 +01:00
Antonio Murdaca
ef1d410b02 fix shm size handling
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-01 16:29:40 +01:00
Antonio Murdaca
d3af7f283d Add OomScoreAdj to configure container oom killer preferences
libcontainer v0.0.4 introduces setting `/proc/self/oom_score_adj` to
better tune oom killing preferences for container process. This patch
simply integrates OomScoreAdj libcontainer's config option and adjust
the cli with this new option.

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-30 11:19:04 +01:00
Michael Crosby
b5c507750f Merge pull request #18051 from calavera/extract_streams
Extract StreamConfig struct out of the daemon package.
2015-11-20 13:45:13 -08:00
David Calavera
3f5b8f712d Extract StreamConfig struct out of the daemon package.
This is a small configuration struct used in two scenarios:

1. To attach I/O pipes to a running containers.
2. To attach to execution processes inside running containers.

Although they are similar, keeping the struct in the same package
than exec and container can generate cycled dependencies if we
move any of them outside the daemon, like we want to do
with the container.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-20 15:04:27 -05:00
Antonio Murdaca
1a0b483e02 runconfig: split resources into a struct
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-20 19:40:01 +01:00
NIWA Hideyuki
5aeaf2a0c4 Addition of "--shm-size" to which size of /dev/shm is changed.
- Optional "--shm-size=" was added to the sub-command(run, create,and build).
- The size of /dev/shm in the container can be changed
  when container is made.
- Being able to specify is a numerical value that applies number,
  b, k, m, and g.
- The default value is 64MB, when this option is not set.
- It deals with both native and lxc drivers.

Signed-off-by: NIWA Hideyuki <niwa.hiedyuki@jp.fujitsu.com>
2015-11-20 09:24:18 +09:00
Michael Crosby
19debeb255 Merge pull request #18027 from tpounds/fix-err-message-typo
Fix error typo when --expose and --net are specified
2015-11-17 11:34:40 -08:00
Trevor Pounds
a25988cf76 Fix typo when --expose and --net are specified.
Signed-off-by: Trevor Pounds <trevor.pounds@gmail.com>
2015-11-16 22:01:20 -08:00
Antonio Murdaca
7929888214 Remove deprecated cli flags
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-15 10:40:01 +01:00
Antonio Murdaca
ad8a66573c Merge pull request #17851 from Microsoft/10662-ArgumentEscaping
Prevent double escaping of Dockerfile commands on Windows
2015-11-14 17:25:53 +01:00
Darren Stahl
9db5db1b94 This fixes the case where arguments are escaped twice from Dockerfiles on
Windows

Signed-off-by: Darren Stahl <darst@microsoft.com>
2015-11-13 10:43:06 -08:00
Ma Shimiao
0fbfa1449d Add support for blkio.weight_device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-11-11 23:06:36 +08:00
Sebastiaan van Stijn
d4c4557b1a Merge pull request #17613 from Microsoft/10662-isolationexecopt
Windows: Add default isolation exec driver option
2015-11-10 19:55:46 +00:00
John Howard
a429ad1e35 Windows: Add default isolation exec driver option
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-10 11:39:05 -08:00
David Calavera
470fc94f38 Merge pull request #17476 from coolljt0725/prevent_connect_to_host
Fix connect to host and prevent disconnect from host for host network
2015-11-10 09:48:33 -08:00
John Howard
51cf074e77 Tidy hostconfig struct
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-09 15:24:23 -08:00
David Calavera
fa210a01be Merge pull request #17838 from calavera/revert_17579
Revert "Tidy config/hostconfig structures"
2015-11-09 15:21:26 -08:00
Tibor Vass
62b484411e Merge pull request #17779 from calavera/fix_dns_regression
Use an empty slice as default value for DNS, DNSSearch and DNSOptions.
2015-11-09 18:07:07 -05:00
David Calavera
3a1200f9f1 Revert "Tidy config/hostconfig structures"
This reverts commit ad5052df23.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-09 15:46:45 -05:00
David Calavera
427dcb7f82 Merge pull request #17579 from Microsoft/jjh/tidyconfigstructs
Tidy config/hostconfig structures
2015-11-09 10:14:58 -08:00
David Calavera
f1a74a89f8 Use an empty slice as default value for DNS, DNSSearch and DNSOptions
So we don't print those <no value> in the client and we don't fail
executing inspect templates with API field names.

Make sure those fields are initialized as empty slices when
a container is loaded from disk and their values are nil.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-09 12:46:48 -05:00
Lei Jitang
a2d8c93fc6 Prevent connecting to host and prevent disconnecting from host
Container has private network namespace can not to connect to host
and container with host network can not be disconnected from host.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-11-09 10:19:53 +08:00
John Howard
ad5052df23 Tidy config/hostconfig structures
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-06 17:53:46 -08:00
John Howard
ee6c3580c9 Move validation functions
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-06 15:28:50 -08:00
David Calavera
3b5fac462d Remove LXC support.
The LXC driver was deprecated in Docker 1.8.
Following the deprecation rules, we can remove a deprecated feature
after two major releases. LXC won't be supported anymore starting on Docker 1.10.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-05 17:09:57 -05:00
David Calavera
669949d6b4 Decouple daemon and container to manage networks.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-04 12:27:48 -05:00
David Calavera
09cb1f1121 Merge pull request #17529 from Microsoft/10662-builderisolation
Windows: [TP4] Allows --isolation on docker build
2015-10-30 17:10:04 -07:00
John Howard
9d14866d71 Windows: Refactor execdriver.Command
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-30 13:53:00 -07:00
John Howard
d5c85897f4 Windows: Allows --isolation on docker build
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-30 11:14:38 -07:00
John Howard
15e35c4470 Windows: Adds support for Hyper-V Containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-29 16:18:52 -07:00
Madhu Venugopal
ead62b5952 Prevent user from deleting pre-defined networks
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-25 17:17:29 -07:00
John Howard
a7e686a779 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-22 10:42:53 -07:00
Tonis Tiigi
504e67b867 Calculate hash based image IDs on pull
Generate a hash chain involving the image configuration, layer digests,
and parent image hashes. Use the digests to compute IDs for each image
in a manifest, instead of using the remotely specified IDs.

To avoid breaking users' caches, check for images already in the graph
under old IDs, and avoid repulling an image if the version on disk under
the legacy ID ends up with the same digest that was computed from the
manifest for that image.

When a calculated ID already exists in the graph but can't be verified,
continue trying SHA256(digest) until a suitable ID is found.

"save" and "load" are not changed to use a similar scheme. "load" will
preserve the IDs present in the tar file.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-10-12 10:51:28 -07:00
Arnaud Porterie
b0cbc02283 Merge pull request #15503 from ibuildthecloud/revert-label
Revert "Container don't inherit from image labels"
2015-10-12 10:03:18 -07:00
xlgao-zju
8363f2f171 fix the error msg of func TestParseRunVolumes
Signed-off-by: xlgao-zju <xlgao@zju.edu.cn>
2015-10-10 14:56:50 +08:00
Arnaud Porterie
8e31036816 Merge pull request #16645 from mavenugo/ux
Docker Network UX & remote API changes
2015-10-07 10:44:58 -07:00
Madhu Venugopal
2ab94e11a2 Network remote APIs using new router, --net=<user-defined-network> changes
* Moving Network Remote APIs out of experimental
* --net can now accept user created networks using network drivers/plugins
* Removed the experimental services concept and --default-network option
* Neccessary backend changes to accomodate multiple networks per container
* Integration Tests

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-07 03:54:19 -07:00
Antonio Murdaca
7539013436 bump libcontainer to 902c012e85cdae6bb68d8c7a0df69a42f818ce96
Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
2015-10-06 17:55:09 +02:00
qhuang
aa1780997f Add support for memory reservation
Signed-off-by: qhuang <qhuang@10.0.2.15>
2015-09-23 14:02:45 +08:00
Antonio Murdaca
e5a26ec081 Deprecate -c cli short variant flag in docker run
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-17 15:48:48 +02:00
Madhav Puri
54240f8da9 Support for passing build-time variables in build context
- The build-time variables are passed as environment-context for command(s)
run as part of the RUN primitve. These variables are not persisted in environment of
intermediate and final images when passed as context for RUN. The build environment
is prepended to the intermediate continer's command string for aiding cache lookups.
It also helps with build traceability. But this also makes the feature less secure from
point of view of passing build time secrets.

- The build-time variables also get used to expand the symbols used in certain
Dockerfile primitves like ADD, COPY, USER etc, without an explicit prior definiton using a
ENV primitive. These variables get persisted in the intermediate and final images
whenever they are expanded.

- The build-time variables are only expanded or passed to the RUN primtive if they
are defined in Dockerfile using the ARG primitive or belong to list of built-in variables.
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, FTP_PROXY and NO_PROXY are built-in
variables that needn't be explicitly defined in Dockerfile to use this feature.

Signed-off-by: Madhav Puri <madhav.puri@gmail.com>
2015-09-16 03:31:15 -07:00
Tim Hockin
3d4685e258 Add support for DNS options
Signed-off-by: Tim Hockin <thockin@google.com>
2015-09-16 14:06:45 -07:00
Lei Jitang
5575b93678 Clean up: remove redundant value assign in runconfig/parse.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-09-14 08:30:11 -04:00
David Calavera
0e50d946a2 Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 19:56:05 -04:00
David Calavera
6549d6517b Move VolumeDriver to HostConfig to make containers portable.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-04 12:42:44 -04:00
Antonio Murdaca
17999c70c3 Use StrSlice from pkg/stringutils
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-01 21:23:46 +02:00
Shijiang Wei
ea4a06740b abstract the string slice struct to stringutils package
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-29 01:08:40 +08:00
Alexander Morozov
6b21e98432 Merge pull request #15766 from hqhq/hq_fix_device
Add mode check for device
2015-08-24 10:58:49 -07:00
Brian Goff
fd8b25c802 Merge pull request #15348 from tonistiigi/11008-always-unless-stopped-restart-policy
Add always-unless-stopped restart policy
2015-08-24 13:48:56 -04:00
Qiang Huang
429423624c Add mode check for device
This fixes two problems:
1. docker run --device /dev/sda:rw ubuntu bash doesn't work
2. --device /dev/zero:/dev/noro:ro doesn't show clear error message,
but fail when writing to cgroup file.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-24 17:57:12 +08:00
Qiang Huang
b6f1b4ad35 Add support for kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-19 23:56:55 +08:00
Tonis Tiigi
10305dc5e8 Add unless-stopped restart policy
Fixes #11008

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-18 11:39:06 -07:00
Sebastiaan van Stijn
e1f3a5ad0a Merge pull request #14113 from dit4c/10348-exec-privileged
Remerge of `docker exec --privileged` with better tests
2015-08-16 00:20:41 +02:00
John Howard
f6ed590596 Move netmode validation to server
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-14 12:17:41 -07:00
Tim Dettrick
03f65b3d0d Revert "Revert "Add docker exec run a command in privileged mode""
This reverts commit 40b71adee3.

Original commit (for which this is effectively a rebased version) is
72a500e9e5 and was provided by Lei Jitang
<leijitang@huawei.com>.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
2015-08-13 16:36:44 +10:00
Darren Shepherd
8b91b3cf77 Revert "Container don't inherit from image labels"
This reverts commit 79621c7728.

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-08-11 17:01:57 -07:00
Antonio Murdaca
4177b0bae0 Add hostConfig check before starting a container
It may happen that host system settings are changed while the daemon is running.
This will cause errors at libcontainer level when starting a container with a
particular hostConfig (e.g. hostConfig with memory swappiness but the memory
cgroup was umounted).
This patch adds an hostConfig check on container start to prevent the daemon
from even calling libcontainer with the wrong configuration as we're already
doing on container's creation).

Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 0d2628cdf1)
2015-08-06 15:46:10 -07:00
David Calavera
f41f62b6cc Add MemorySwappiness comment back.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-29 16:41:46 -07:00
David Calavera
4e25d2982b Use *int64 for MemorySwappiness.
So we marshal/unmarshal its value properly when it's empty.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-29 14:14:04 -07:00
Darren Shepherd
421786e925 Make ParseDevice public
This reverts the change in 5170a2c096 that made ParseDevice private

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-07-29 02:12:35 -07:00
Vincent Demeester
5170a2c096 Lint fixes on runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-27 21:23:15 +02:00
Tibor Vass
96ce3a194a cli: new daemon command and new cli package
This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The `-d` and `--daemon` top-level flags are deprecated and a special
message is added to prompt the user to use `docker daemon`.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use `docker daemon`.

This patch does not break any old but correct usages.

This also makes `-d` and `--daemon` flags, as well as the `daemon`
command illegal in client-only binaries.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-23 19:44:46 -04:00
David Calavera
36106a20ca Merge pull request #14682 from duglin/Issue14621
Remove panic in nat package on invalid hostport
2015-07-21 15:48:51 -07:00
David Calavera
c4d45b6a29 Promote volume drivers from experimental to master.
Remove volume stubs and use the experimental path as the only path.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-21 09:32:44 -07:00
Qiang Huang
6f8ddec1d0 Simplify swappiness check
As suggested in https://github.com/docker/docker/pull/14004/files#r34022527

The concern there is we can't differentiate whether user explicitly
asked for an invalid value of -1 or he did not specify anything.

I don't think this would be a problem, because:
 - like all other default values like zero, we can't differentiate
   user specify it or not, most of which, zeros are also invalid, so
   default is default, we show these default values in help info,
   so users would know if they set value as default, it'll be like
   they set nothing.
 - we can't do this kind of string check in REST api request, so
   it'll make the behave different from docker command and RESTapi.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 16:10:10 +08:00
Sebastiaan van Stijn
415f744d0c Merge pull request #11485 from wlan0/rollover_log
Add rollover log driver, and --log-driver-opts flag
2015-07-17 22:41:26 +02:00
Doug Davis
12b6083c8f Remove panic in nat package on invalid hostport
Closes #14621

This one grew to be much more than I expected so here's the story... :-)
- when a bad port string (e.g. xxx80) is passed into container.create()
  via the API it wasn't being checked until we tried to start the container.
- While starting the container we trid to parse 'xxx80' in nat.Int()
  and would panic on the strconv.ParseUint().  We should (almost) never panic.
- In trying to remove the panic I decided to make it so that we, instead,
  checked the string during the NewPort() constructor.  This means that
  I had to change all casts from 'string' to 'Port' to use NewPort() instead.
  Which is a good thing anyway, people shouldn't assume they know the
  internal format of types like that, in general.
- This meant I had to go and add error checks on all calls to NewPort().
  To avoid changing the testcases too much I create newPortNoError() **JUST**
  for the testcase uses where we know the port string is ok.
- After all of that I then went back and added a check during container.create()
  to check the port string so we'll report the error as soon as we get the
  data.
- If, somehow, the bad string does get into the metadata we will generate
  an error during container.start() but I can't test for that because
  the container.create() catches it now.  But I did add a testcase for that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 13:02:54 -07:00
David Calavera
ecdbf86884 Merge pull request #13694 from vdemeester/opts-test-coverage
Tests, refactor and coverage on package opts
2015-07-14 15:09:48 -07:00
Qiang Huang
c3b77bbe8b Docs: fix commandline doc create.md and run.md
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-14 09:26:59 +08:00
Mrunal Patel
e0d96fb3ef Adds support for specifying additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-07-13 14:47:28 -04:00
Phil Estes
441ae6c943 Merge pull request #14004 from ktraghavendra/13938_container_swappiness
Add the memory swappiness tuning option to docker.
2015-07-13 09:22:08 -04:00
Antonio Murdaca
26ce3f4c90 Add minor vet fixes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-12 19:16:38 +02:00
Vincent Demeester
dfc6c04fa3 Add test coverage to opts and refactor
- Refactor opts.ValidatePath and add an opts.ValidateDevice
  ValidePath will now accept : containerPath:mode, hostPath:containerPath:mode
  and hostPath:containerPath.
  ValidateDevice will have the same behavior as current.

- Refactor opts.ValidateEnv, opts.ParseEnvFile
  Environment variables will now be validated with the following
  definition :
  > Environment variables set by the user must have a name consisting
  > solely of alphabetics, numerics, and underscores - the first of
  > which must not be numeric.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-12 10:33:30 +02:00
Raghavendra K T
921da495d2 Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness
behavior per container.
For example, When a lower value of swappiness is chosen
the container will see minimum major faults. When no value is
specified for memory-swappiness in docker UI, it is inherited from
parent cgroup. (generally 60 unless it is changed).

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
2015-07-12 13:16:33 +05:30
John Howard
9ae9d4c87a Windows: Exec driver
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-10 13:36:56 -07:00
John Howard
c1b524486c Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 10:09:45 -07:00
Brian Goff
42eb82ae92 Merge pull request #14477 from Microsoft/10662-runconfig-oopsie
Windows: Wrong build tag in runconfig
2015-07-08 15:34:05 -04:00
John Howard
4cd9301692 Windows: Wrong build tag in runconfig
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-08 11:38:28 -07:00
Michael Crosby
691b2851f7 Always attach STDIN if -i,--interactive is specified
There is no reason to error out or not do what the user expects when -i
is specified on the cli.  We should always attach to the stdin of the
container in this situation.

Closes #14390

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-06 15:24:23 -07:00
Antonio Murdaca
a5be803458 Add break after key is found in for loop
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-03 20:37:34 +02:00
Lei Jitang
f3faf59925 Validate restart policy. Fixes #14351
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-03 17:33:33 +08:00
wlan0
9b782d3af3 add support for maximum log size, and max number of log files
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-07-02 06:26:06 -07:00
Antonio Murdaca
10a3061c5f Fix regression in parsing capabilities list when a single string is given
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-01 21:28:02 +02:00
Vincent Demeester
d4aec5f0a6 Refactor test and add coverage to runconfig
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-01 10:16:36 +02:00
Peter Waller
9c2374d196 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
2015-06-30 17:43:17 +01:00
David Calavera
18d5d3ba03 Merge pull request #14133 from Microsoft/10662-netmode
Windows: Refactor network modes
2015-06-29 15:02:42 -07:00
John Howard
c5e6a4b307 Windows: Refactor network modes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-29 13:13:55 -07:00
Brian Goff
17d6f00ec2 Fix unmarshalling of Command and Entrypoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-26 09:00:57 -07:00
Alexander Morozov
c782be0e2a Merge pull request #14062 from runcom/cleanup-dead-code
Remove dead code
2015-06-21 16:01:19 -07:00
Madhu Venugopal
1ac350a0ec Support for --publish-service flag in docker run
This commit makes use of the CNM model supported by LibNetwork and
provides an ability to let a container to publish a specified service.
Behind the scenes, if a service with the given name doesnt exist, it is
automatically created on appropriate network and attach the container.

Signed-off-by: Alessandro Boch <aboch@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-20 11:03:38 -07:00
Antonio Murdaca
927d13bc3c Remove dead code
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-20 19:14:15 +02:00
David Calavera
df73d5e0cd Merge pull request #14023 from mavenugo/net_ui
experimental network ui
2015-06-19 09:26:05 -07:00
David Calavera
b1143f4cb0 Merge pull request #13218 from brahmaroutu/decoder_issue_gccgo
Decoder does not work properly with nested pointers using gcc
2015-06-18 13:22:28 -07:00
Madhu Venugopal
da5a3e6dee register libnetwork API and UI with docker parent chain
This commit also brings in the ability to specify a default network and its
corresponding driver as daemon flags. This helps in existing clients to
make use of newer networking features provided by libnetwork.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 12:07:58 -07:00
Sebastiaan van Stijn
637023a5f8 Merge pull request #13502 from coolljt0725/conflict_port_and_netmode
Add --net=container with --publish --expose --publish-all error out
2015-06-15 16:25:59 +02:00
Srini Brahmaroutu
eb97de7dee Decoder does not work properly with nested pointers using gcc
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-06-11 16:45:54 +00:00
Antonio Murdaca
4ce817796e Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-06 20:07:32 +02:00
Arnaud Porterie
79621c7728 Container don't inherit from image labels
Labels are metadata that apply to a particular resource: image,
container, maybe volumes and networks in the future. We shouldn't have
containers inherit from its image labels: they are not the same obejcts,
and labels cannot be interpreted in the way.

It remains possible to apply metadata to an image using the LABEL
Dockerfile instruction, to query them using `docker inspect <img>`, or
to filter images on them using `docker images --filter <key>=<value>`.

Fixes #13770.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-05 11:11:22 -07:00
Antonio Murdaca
15134a3320 Remove PortSpecs from Config
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-29 22:38:09 +02:00
Dan Walsh
160dc79db0 Modify volume mounts SELinux labels on the fly based on :Z or :z
This patch is extending the qualifiers on the -v command to allow
an admin to tell the system to relabel, content. There might be a
need for something similar for changing the DAC Permissions.

Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-27 12:50:16 -07:00
Lei Jitang
13f2aa7068 Add --net=container with --publish --publish-all --expose error out
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-27 15:31:06 +08:00
Jessica Frazelle
40b71adee3 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5.

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

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
2015-05-26 14:12:16 -07:00
Arnaud Porterie
4fc37a1ede Mark --volume-driver as experimental
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-05-21 20:34:17 -07:00
David Calavera
81fa9feb0c Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-21 20:34:17 -07:00
Jana Radhakrishnan
d18919e304 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:40:19 +00:00
Antonio Murdaca
624bf81fdb Add RestartPolicy methods instead of using strings checking
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-16 14:15:28 +02:00
Sebastiaan van Stijn
ed25742002 Merge pull request #12667 from ibuildthecloud/host-uts
Add --uts=host to allow sharing the UTS namespace
2015-05-13 18:30:32 -07:00
Darren Shepherd
f2e5207fc9 Add --uts=host to allow sharing the UTS namespace
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-05-13 17:56:32 -07:00
Lei Jitang
c6dad07b1b Minor typo: remove redundant dot in error message in runconfig/parse.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-13 11:04:07 +08:00
Jessie Frazelle
8cc93856e3 Merge pull request #13074 from runcom/11824-short-link-if-equals-alias
Allow links to be specified with only the name if it matches the alias
2015-05-11 13:18:29 -07:00
Antonio Murdaca
c6e6223ed7 Allow links to be specified with only the name if this matches the alias
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-11 21:50:47 +02:00
Ma Shimiao
dccb8b5c33 add cpu.cfs_period_us support
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-05-09 10:02:46 +08:00
wlan0
dca9e02b15 Add log opts flag to pass in logging options
Signed-off-by: wlan0 <sidharthamn@gmail.com>
2015-05-04 14:39:48 -07:00
Jessie Frazelle
6b6a26c769 Merge pull request #11516 from coolljt0725/add_show_error_set_some_flag_in_container_netmode
add support --net=container with --mac-address, --add-host error out
2015-05-07 17:13:32 -07:00
Qiang Huang
f133f11a7d add blkio.weight support
We can use this to control block IO weight of a container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-07 11:55:58 +08:00
Doug Davis
54662eae10 Fix RUN's error msg when it fails
When RUN returns with a non-zero return code it prints the command
that was executed as a Go []string:
```
INFO[0000] The command &{[/bin/sh -c noop a1 a2]} returned a non-zero code: 127
```

instead it should look like this:
```
INFO[0000] The command "/bin/sh -c noop a1 a2" returned a non-zero code: 127
```

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-05 16:08:41 -07:00
Lei Jitang
0e08e9aca1 Add support --net=container with --mac-address,--add-host error out
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-05 19:28:40 +08:00
Lei Jitang
101f982059 Refactor the code of checking conflict option with netmode.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-05-05 19:23:18 +08:00
HuKeping
a4a924e1b6 Feature: option for disable OOM killer
Add cgroup support for disable OOM killer.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-04 21:11:29 +08:00
John Howard
03eb0d065d Windows: Move workdir check daemon-side
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-04-30 14:16:45 -07:00
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07:00
Darren Shepherd
366ee6bdfa Expose ParseRestartPolicy
ParseRestartPolicy is useful function for third party go programs to use
so that they can parse the restart policy in the same way that Docker
does

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-04-24 12:23:54 -07:00
jianbosun
24425021d2 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>
2015-04-22 13:51:57 -07:00
Lei Jitang
dcc50e1d59 Add support cpu cfs quota
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-20 08:16:47 -07:00
Brian Goff
de923f59b3 Merge pull request #12253 from calavera/remove_job_from_start_and_create
Remove engine.Job from Start and Create
2015-04-15 21:49:25 -04:00
David Calavera
767df67e31 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-15 10:22:07 -07:00
Qiang Huang
8077b2fb80 add support for cpuset.mems
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-04-15 09:33:46 +08:00
David Calavera
98996a432e Remove engine.Job from Create action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
David Calavera
610c436e07 Remove engine.Job from Start action.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-14 15:33:12 -07:00
Antonio Murdaca
c30a55f14d Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-14 01:37:36 +02:00
Lei Jitang
72a500e9e5 Add docker exec run a command in privileged mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:26:37 +08:00
Lei Jitang
2cce4791b0 Add -u|--user flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:04:24 +08:00
Arnaud Porterie
8a50746b5d Merge pull request #11686 from willhf/9340_test
Add test for net=container and links
2015-04-06 13:21:01 -07:00
willhf
bc0cdc0a4c Fix incompatible flags conditional
Signed-off-by: willhf <willhf@gmail.com>
2015-04-05 19:38:31 -07:00
Antonio Murdaca
5670c6c695 Refactor utils/flags.go, fixes #11892
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-29 03:22:46 +02:00
Antonio Murdaca
6f4d847046 Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-26 23:22:04 +01:00
Arnaud Porterie
e39646d2e1 Remove unused runconfig.Config.SecurityOpt field
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-25 15:46:42 -07:00
willhf
6dba2d01b5 Add test for net=container and links
Signed-off-by: willhf <willhf@gmail.com>
2015-03-23 19:50:33 -07:00
Doug Davis
b4beb0637a Add LABEL config check to runconfig compare
Without this we won't do a proper cacche check because we skip the
labels part of the config.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-20 05:55:48 -07:00
Vishnu Kannan
0b1e2b5a55 Adding '--cgroup-parent' flag to docker run. This feature helps users implement more complex
resource isolation policies on top of what native docker provides.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-19 02:34:15 +00:00
Arnaud Porterie
1ff5a91007 Merge pull request #10568 from LK4D4/logging_drivers
Logging drivers
2015-03-17 09:45:58 -07:00
Arnaud Porterie
b6ac111abf Merge pull request #9882 from ibuildthecloud/labels
Proposal: One Meta Data to Rule Them All => Labels
2015-03-16 20:20:05 -07:00
Alexander Morozov
47a6afb93f Default 'json-file' logging driver and none logging driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-13 12:13:21 -07:00
Sebastiaan van Stijn
7d89e66dac Add labels documentation
Adds more documentation for labels and adds the label instruction to the
man-pages.

Also included is a document called "Labels - custom meta-data in Docker"
in the user-guide, this is still a work-in-progress I started to describe
the "namespaces" conventions, an example on storing structured data.

I ran a bit "out of steam" (writers block?) on that document, but kept
it in (for now), in case it still ends up useful.

The Remote API documentation changes will need to be moved to the
docker_remote_api_v1.18.md document when rebasing the whole PR.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-03-13 10:02:04 -07:00
Darren Shepherd
abb5e9a077 Set labels on container create
Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-03-13 10:02:04 -07:00
Dan Walsh
cdfdfbfb62 Allow specification of Label Name/Value pairs in image json content
Save "LABEL" field in Dockerfile into image content.

This will allow a user to save user data into an image, which
can later be retrieved using:

docker inspect IMAGEID

I have copied this from the "Comment" handling in docker images.

We want to be able to add Name/Value data to an image to describe the image,
and then be able to use other tools to look at this data, to be able to do
security checks based on this data.

We are thinking about adding version names,
Perhaps listing the content of the dockerfile.
Descriptions of where the code came from etc.

This LABEL field should also be allowed to be specified in the
docker import --change LABEL:Name=Value
docker commit --change LABEL:Name=Value

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-13 09:47:09 -07:00
Qiang Huang
837eec064d move resources from Config to HostConfig
Cgroup resources are host dependent, they should be in hostConfig.

For backward compatibility, we just copy it to hostConfig, and leave it in
Config for now, so there is no regressions, but the right way to use this
throught json is to put it in HostConfig, like:
  {
      "Hostname": "",
      ...
      "HostConfig": {
	  "CpuShares": 512,
          "Memory": 314572800,
          ...
      }
  }

As we will add CpusetMems, CpusetCpus is definitely a better name, but some
users are already using Cpuset in their http APIs, we also make it compatible.

The main idea is keep using Cpuset in Config Struct, and make it has the same
value as CpusetCpus, but not always, some scenarios:
 - Users use --cpuset in docker command, it can setup cpuset.cpus and can
   get Cpuset field from docker inspect or other http API which will get
   config info.
 - Users use --cpuset-cpus in docker command, ditto.
 - Users use Cpuset field in their http APIs, ditto.
 - Users use CpusetCpus field in their http APIs, they won't get Cpuset field
   in Config info, because by then, they should already know what happens
   to Cpuset.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 09:31:18 +08:00
Lei Jitang
311a600f19 Set default restart policy name to 'no' Closes #10874
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-10 10:09:12 +08:00
Jessie Frazelle
ffc755ac14 Merge pull request #11134 from duglin/CheckMultiLineHelp
Fix 'docker ps --help' so the options don't span more than one line
2015-03-04 05:53:47 -08:00
Jessie Frazelle
df7ba57f5f Merge pull request #9437 from cpuguy83/set_rlimits_in_container
Allow setting ulimits for containers
2015-03-04 04:00:17 -08:00
Doug Davis
5595da2bde Fix 'docker ps --help' so the options don't span more than one line
and add a testcase to catch this in the future.

While in there I also:
- removed extra periods from the few options that had them (new test)
- made the --filter option consistent across all command

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-03 10:02:23 -08:00