Commit Graph

79 Commits

Author SHA1 Message Date
8c7a6654fa Move security opts to HostConfig
These settings need to be in the HostConfig so that they are not
committed to an image and cannot introduce a security issue.

We can safely move this field from the Config to the HostConfig
without any regressions because these settings are consumed at container
created and used to populate fields on the Container struct.  Because of
this, existing settings will be honored for containers already created
on a daemon with custom security settings and prevent values being
consumed via an Image.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	daemon/create.go
		changing config to hostConfig was required to fix the
		 build
Upstream-commit: 294843ef23fcff3c080d9fbd12df17ae7006a9f8
Component: engine
2014-11-25 01:02:30 +02:00
deefafa9d6 Remove unused sysinfo parameter to runconfig.Parse
Removing dead code.

Signed-off-by: John Gossman <johngos@microsoft.com>
Upstream-commit: e45b0f92711ff190cff4b61b2ea80cdd53203a16
Component: engine
2014-11-14 18:20:54 -08:00
09b8238fe6 Allow IPC namespace to be shared between containers or with the host
Some workloads rely on IPC for communications with other processes.  We
would like to split workloads between two container but still allow them
to communicate though shared IPC.

This patch mimics the --net code to allow --ipc=host to not split off
the IPC Namespace.  ipc=container:CONTAINERID to share ipc between containers

If you share IPC between containers, then you need to make sure SELinux labels
match.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 497fc8876ede9924f61c0eee4dfadd71e5d9f537
Component: engine
2014-11-12 11:29:58 -05:00
590a54ca61 enhancing set-macaddress docu
Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: 971fc2253af77ae4a22a3741fff51d84cd9bc697
Component: engine
2014-11-03 11:43:27 +01:00
c0897a4514 Adding docker-cli run param to set MAC address
Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: f2df38050e019c0db265e7c3e38ee0de8948ca77
Component: engine
2014-11-01 15:35:09 +01:00
b972337ce2 adding support for port ranges on --expose
Closes #1834

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: fd774a818c7d8942922b4f74eabd2a4e14094e1a
Component: engine
2014-10-31 23:06:30 +00:00
c33ebe12c4 Mapping change in code
Signed-off-by: Huayi Zhang <irachex@gmail.com>
Upstream-commit: eaa050fdb8fed612b3cd5d204fddaedf27a20370
Component: engine
2014-10-31 09:57:54 +08:00
a91e1dbdcd Add info on --device flag permissions ':rwm'
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: 2709c4677c252a07d49a24f7583adcc17b38fa14
Component: engine
2014-10-13 17:41:12 +10:00
fe37a1db8f Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 87e732a0f3503517d7a66804bb9a7f74977347e5
Component: engine
2014-09-30 00:06:22 +00:00
18373aa635 Removed runconfig.ParseSubcommand
Removed runconfig.ParseSubcommand, changed it to runconfig.Parse and editted related tests and modules

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
Upstream-commit: 9aa71549d61875fcf0713a9da11b034e70e1c3b0
Component: engine
2014-09-17 14:38:22 -07:00
118f175983 Merge pull request #8019 from thockin/add-host
Allow extra lines in /etc/hosts
Upstream-commit: f98a1f1f7d9b3ef10c13fc3b6438c978b4d6aa78
Component: engine
2014-09-16 17:19:16 -07:00
604739ede9 Allow extra lines in /etc/hosts
This adds a --add-host host:ip flag which appends lines to /etc/hosts.  This is needed in places where you want the container to get a different name resolution than it would through DNS.  This was submitted before as #5525, closed, and now I am re-opening.  It has come up 2 or 3 times in the last couple days.

Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 68e48b65a64df10fc797cbaa89d6caa2188eadc9
Component: engine
2014-09-16 23:38:23 +00:00
58d6278266 Resolve conflicts with restart policies
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: e49c70109228d657790190007c8f9d7c55a25be2
Component: engine
2014-09-16 18:40:25 -04:00
764b128304 Add "docker create" support
This exposes the already existing "create container" operation.  It is
very similar to "docker run -d" except it doesn't actually start the
container, but just prepares it. It can then be manually started using
"docker start" at any point.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Conflicts:
	api/client/commands.go
	runconfig/parse.go
	server/container.go

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: 3a90004f3c2d86ec849f4674c8046693ea061ed1
Component: engine
2014-09-16 18:40:24 -04:00
4a859299e0 deny net host + dns and links with container net
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 3256050ed44b13694d81e78d24e2c7f6006c4bbd
Component: engine
2014-08-28 16:58:54 +03:00
676eea0fcd Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d81802e3c988cc0e67e488b24968dd748a.

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 2e489073d94a7e2a5df115704a484c34f0b59f29
Component: engine
2014-08-27 18:59:13 +00:00
91ac365d86 Merge pull request #6052 from rhatdan/help
--help option and help command should print to stdout not stderr
Upstream-commit: 76fd51a4789c1af15d6682a01add3ff86df2f5cf
Component: engine
2014-08-27 11:17:16 -07:00
f13f1856df --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 61b129d81802e3c988cc0e67e488b24968dd748a
Component: engine
2014-08-21 15:35:20 -04:00
99933d1110 Update flag usages and docs for max restart count
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 5ad4879d2a5ee5af95c8b8ab701a621c8b49609a
Component: engine
2014-08-13 18:24:33 -07:00
ed9f19284d Add documentation and update restart rules.
Implement time backed backoff for restarting and fix failure count when
the maximum is 0

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 860c13b788944410a98a6ad5b5cfb74de0a8405b
Component: engine
2014-08-13 15:57:37 -07:00
a9837fc603 Add typed RestartPolicy
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: d9753ba20d5e602b0980687353d76c874b563042
Component: engine
2014-08-13 15:56:34 -07:00
49eb58207e Restart containers based on restart policy
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: bd8c9dc2395032a893e959e48f9a8536858d67e0
Component: engine
2014-08-13 15:56:34 -07:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
8bd8c43b79 Helpers to parse lists, IPs, hosts, dns searches from the command line
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 6200002669874f3314856527fecd0c004060913c
Component: engine
2014-08-13 19:25:47 +00:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
638498458f Update docs on --sig-proxy to indicate that SIGKILL and SIGSTOP cannot be proxied
Docker-DCO-1.1-Signed-off-by: Matt Heon <mheon@redhat.com> (github: mheon)
Upstream-commit: 31351d08a35b2c903a2b6407bea09ccf1449e79c
Component: engine
2014-07-18 12:32:04 -04:00
697ca2953b don't allow links to be used with --net=host
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: be8cea98560f4e63ff367a632539bf9f6bf929a4
Component: engine
2014-07-17 00:32:24 +03:00
c802db49a3 add doc
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: e7d9854414ed77765db49af136533871ba443f3c
Component: engine
2014-07-11 23:43:21 +00:00
ca489c2f49 Basic --cap-add and --cap-drop support for native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 94e6dc978134b61a2b30aa9118f98f6fadd10535
Component: engine
2014-07-11 23:43:21 +00:00
c15db86f61 Add --device flag to allow additional host devices in container
We add a --device flag which can be used like:

 docker run --device /dev/sda:/dev/xvda:rwm ubuntu /bin/bash

To allow the container to have read write permissions to access the host's /dev/sda via a node named /dev/xvda in the container.

Note: Much of this code was written by Dinesh Subhraveti dineshs@altiscale.com (github: dineshs-altiscale) and so he deserves a ton of credit.

Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: timthelion)
Upstream-commit: e855c4b92170534864b920ec1e267b3a815764f9
Component: engine
2014-07-10 10:35:53 -07:00
f67899e5d8 update for consistency
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b68111713ddab28485122f149055c865ac4dadaa
Component: engine
2014-07-09 21:48:02 +00:00
6401809a76 add check on docker run
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 0abdea90947de867719c622a51f0382bcdf592ee
Component: engine
2014-07-09 21:48:02 +00:00
bbc512f23b Fixed some more styling issues with command line flags
Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)
Upstream-commit: 2112c5e948d1ef3d3efb34875a97f01fde809143
Component: engine
2014-07-08 20:23:12 -04:00
525592aa62 Relax dns search to accept empty domain
In that case /etc/resolv.conf will be generated with no search
option. Usage: --dns-search=.

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
Upstream-commit: 804b00cd7d1f084a872211e5043d255c454c8e51
Component: engine
2014-07-04 09:33:53 +01:00
bedc0093af Update cli.md and man pages to match current cli
Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: b07f193822d00e40580cd11320ed7e01b629f9d7
Component: engine
2014-07-03 10:22:20 +10:00
866640533b Merge pull request #6544 from mheon/sigproxy_docs
Update --sig-proxy documentation
Upstream-commit: b4df555d27603621eacbcabb19d1db52bc370c86
Component: engine
2014-06-30 13:16:38 +10:00
e523e1e304 correct typo - desination -> destination
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: a1b6f350e806c43225b724530e563d6ff66e6b8a
Component: engine
2014-06-27 19:49:40 +03:00
cb56a2df49 Allow / as source of -v
We discussed this at the docker plumbers meetup and for tools and
working on the system for things like boot2docker and coreos this is
needed.  You can already bypass this check so we felt it is ok to start
allowing this feature.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: e39b8eade1f42503b6b7217e72eff4c8fdc13cb6
Component: engine
2014-06-26 10:50:18 -07:00
a8f5e76a89 Update documentation noting that SIGCHLD is not proxied.
Docker's --sig-proxy option sends all signals but one to a container. The
exception s SIGCHLD, which is deliberately ignored as it doesn't make sense to
send such a signal to a process in a container. Documentation updates will make
this less confusing if anyone does attempt to do this.

Docker-DCO-1.1-Signed-off-by: Matt Heon <mheon@redhat.com> (github: mheon)
Upstream-commit: be4f4599a6d2a517e615dc1f64527a3f2ad2f683
Component: engine
2014-06-25 09:08:02 -04:00
f3557341d8 Fix minor typo
Docker-DCO-1.1-Signed-off-by: Kevin Houdebert kevin.houdebert@gmail.com (github: qwazerty)
Upstream-commit: d7e5fdfb58d5829344486b7a6171f7e866f0378b
Component: engine
2014-06-19 14:49:52 +02:00
4c39400bd1 Document the potential insecurity of --net host
Docker-DCO-1.1-Signed-off-by: Timothy <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
Upstream-commit: ed5054389aa7cd0456bfdf1d940d3cdad0313f8f
Component: engine
2014-06-16 20:40:07 +00:00
62d142653c Allow --net=none & -h
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f411f8bfc5d04aed6499dfc90e357c58713bc84d
Component: engine
2014-06-11 21:07:50 +00:00
2c620b9486 Don't save bind mounts in image
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d535d9810012b18ca83f86aa416ff4a08bb49804
Component: engine
2014-05-19 22:18:37 +00:00
94d0641f06 Merge pull request #5756 from crosbymichael/move-units-to-pkg
Move duration and size to units pkg
Upstream-commit: bc22c9948c5380715338aef63fcc6cccd1a16bd7
Component: engine
2014-05-14 11:36:14 -07:00
4926e35bb1 Add cpuset cpus support for docker
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: adbe3096e8c8572925dbae5f19ac2ce2dc84fb1c
Component: engine
2014-05-13 18:17:12 -07:00
d39f282a2b Move duration and size to units pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d33b4655c4339dcbbf9f78948598e216ac3c06b4
Component: engine
2014-05-12 17:05:07 -07:00
fb89461e49 returns an error when using -h and --net
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 2899195540857f2ad7c50ea509847c3a598c5e81
Component: engine
2014-05-09 21:42:22 +00:00
35bec1ebab Fix error name typo (ErrInvalidWorikingDirectory)
Docker-DCO-1.1-Signed-off-by: Lars R. Damerow <lars@grandstreet.us> (github: bitness)
Upstream-commit: d3150e0927043976b0b88bd61e50dc1e456fa77b
Component: engine
2014-05-07 16:28:51 -07:00
fdccd2aaa1 improve some usages
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b622da3cfe211d31df69e72a93ed4fae872aca65
Component: engine
2014-05-06 21:32:12 +00:00