summaryrefslogtreecommitdiff
path: root/runconfig/opts
Commit message (Collapse)AuthorAgeFilesLines
* runconfig/opts: use strings.Cut()Sebastiaan van Stijn2022-12-211-6/+2
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Add canonical import commentDaniel Nephin2018-02-051-1/+1
| | | | Signed-off-by: Daniel Nephin <dnephin@docker.com>
* Remove some more `opts` from runconfig (not used anymore)Vincent Demeester2017-06-033-289/+0
| | | | Signed-off-by: Vincent Demeester <vincent@sbr.pm>
* fix some typos in runconfig\opts\envfile_test.golixiaobing100512672017-01-091-3/+2
| | | | Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
* Clean some stuff from runconfig that are cli only…Vincent Demeester2016-12-2414-2379/+0
| | | | | | | | … or could be in `opts` package. Having `runconfig/opts` and `opts` doesn't really make sense and make it difficult to know where to put some code. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
* return directly without ifs in remaining packagesunclejack2016-12-141-4/+2
| | | | Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
* Fix a bit typosyuexiao-wang2016-12-091-1/+1
| | | | Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
* Fix processing of unset build-args during buildDoug Davis2016-12-073-51/+19
| | | | | | | | | | | | | | | | | | | This reverts 26103. 26103 was trying to make it so that if someone did: docker build --build-arg FOO . and FOO wasn't set as an env var then it would pick-up FOO from the Dockerfile's ARG cmd. However, it went too far and removed the ability to specify a build arg w/o any value. Meaning it required the --build-arg param to always be in the form "name=value", and not just "name". This PR does the right fix - it allows just "name" and it'll grab the value from the env vars if set. If "name" isn't set in the env then it still needs to send "name" to the server so that a warning can be printed about an unused --build-arg. And this is why buildArgs in the options is now a *string instead of just a string - 'nil' == mentioned but no value. Closes #29084 Signed-off-by: Doug Davis <dug@us.ibm.com>
* cli: remove `--mount` from `docker run`Akihiro Suda2016-11-261-5/+0
| | | | | | | This commit reverts 273eeb813c1db0f42c2ad5e053972eeb00907568 (#26825). For the discussion so far, please refer to #28527. Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
* Merge pull request #28667 from Microsoft/jjh/env-case-sensitiveJohn Howard2016-11-232-0/+12
|\ | | | | Windows: Case insensitive env vars
| * Windows: Case insensitive env varsJohn Howard2016-11-232-0/+12
| | | | | | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* | error strings should not be capitalized or end with punctuationyupeng2016-11-221-1/+1
|/ | | | Signed-off-by: yupeng <yu.peng36@zte.com.cn>
* Don't validate platform-dep tmpfs opts on clientBrian Goff2016-11-151-4/+0
| | | | | | | | | Daemon still does validation and errors out on incorrect options. Fixes an issue where non-Linux clients attempting to pass tmpfs options on `docker run` to a Linux daemon will incorrectly error out. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Add `--dns-option` to `docker run` and hide `--dns-opt`Yong Tang2016-11-091-0/+4
| | | | | | | | | | | | | | | | | | | | This fix is a follow up to #27567 based on: https://github.com/docker/docker/pull/27567#issuecomment-259295055 In #27567, `--dns-options` has been added to `service create/update`, together with `--dns` and `--dns-search`. The `--dns-opt` was used in `docker run`. This fix add `--dns-option` (not `--dns-options`) to `docker run/create`, and hide `--dns-opt`. It is still possible to use `--dns-opt` with `docker run/create`, though it will not show up in help output. This fix change `--dns-options`to --dns-option` for `docker service create` and `docker service update`. This fix also updates the docs and bash/zsh completion scripts. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Merge pull request #27947 from milindchawre/fix_27798Vincent Demeester2016-11-091-1/+1
|\ | | | | Fixes #27798 : Update help for --blkio-weight parameter
| * Fixes #27798 : Update help for --blkio-weight parametermilindchawre2016-11-031-1/+1
| | | | | | | | Signed-off-by: milindchawre <milindchawre@gmail.com>
* | Fixes #24083 : Improving cli help for flags with duration optionmilindchawre2016-11-091-2/+2
| | | | | | | | Signed-off-by: milindchawre <milindchawre@gmail.com>
* | Merge pull request #28098 from yongtang/25099-oom_score_adj-empty-envVincent Demeester2016-11-091-0/+5
|\ \ | | | | | | Fix `/proc/<pid>/oom_score_adj: invalid argument` error caused by empty env name
| * | Fix `/proc/<pid>/oom_score_adj: invalid argument` error caused by empty env nameYong Tang2016-11-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix is part of the fix for issue 25099. In 25099, if an env has a empty name, then `docker run` will throw out an error: ``` ubuntu@ubuntu:~/docker$ docker run -e =A busybox true docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:295: setting oom score for ready process caused \\\"write /proc/83582/oom_score_adj: invalid argument\\\"\"\n". ``` This fix validates the Env in the container spec before it is sent to containerd/runc. Integration tests have been created to cover the changes. This fix is part of fix for 25099 (not complete yet, non-utf case may require a fix in `runc`). This fix is related to 25300. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* | | always add but hide experimental cmds and flagsVictor Vieux2016-11-081-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Victor Vieux <vieux@docker.com> update cobra and use Tags Signed-off-by: Victor Vieux <vieux@docker.com> allow client to talk to an older server Signed-off-by: Victor Vieux <vieux@docker.com>
* | Windows: Add cpu count optionDarren Stahl2016-11-041-0/+3
| | | | | | | | Signed-off-by: Darren Stahl <darst@microsoft.com>
* | Add `--cpus` flag to control cpu resourcesYong Tang2016-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix tries to address the proposal raised in 27921 and add `--cpus` flag for `docker run/create`. Basically, `--cpus` will allow user to specify a number (possibly partial) about how many CPUs the container will use. For example, on a 2-CPU system `--cpus 1.5` means the container will take 75% (1.5/2) of the CPU share. This fix adds a `NanoCPUs` field to `HostConfig` since swarmkit alreay have a concept of NanoCPUs for tasks. The `--cpus` flag will translate the number into reused `NanoCPUs` to be consistent. This fix adds integration tests to cover the changes. Related docs (`docker run` and Remote APIs) have been updated. This fix fixes 27921. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* | cli: add `--mount` to `docker run`Akihiro Suda2016-11-031-0/+5
|/ | | | Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
* Fix issue related to duplicate identical bind mounts for `docker run`Yong Tang2016-11-011-2/+5
| | | | | | | | | | | | | | | | | | This fix tries to address the issue raised in 27969 where duplicate identical bind mounts for `docker run` caused additional volumes to be created. The reason was that in `runconfig`, if duplicate identical bind mounts have been specified, the `copts.volumes.Delete(bind)` will not truly delete the second entry from the slice. (Only the first entry is deleted). This fix fixes the issue. An integration test has been added to cover the changes This fix fixes 27969. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add `--env-file` flag to `docker create service`Yong Tang2016-10-271-4/+4
| | | | | | | | | | | | | This fix tries to address the issue in 24712 and add `--env-file` file to `docker create service`. Related documentation has been updated. An additional integration has been added. This fix fixes 24712. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Merge pull request #23430 from erikstmartin/realtime-threadsVincent Demeester2016-10-271-84/+90
|\ | | | | Implementing support for --cpu-rt-period and --cpu-rt-runtime
| * Implementing support for --cpu-rt-period and --cpu-rt-runtime so thatErik St. Martin2016-10-261-84/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containers may specify these cgroup values at runtime. This will allow processes to change their priority to real-time within the container when CONFIG_RT_GROUP_SCHED is enabled in the kernel. See #22380. Also added sanity checks for the new --cpu-rt-runtime and --cpu-rt-period flags to ensure that that the kernel supports these features and that runtime is not greater than period. Daemon will support a --cpu-rt-runtime flag to initialize the parent cgroup on startup, this prevents the administrator from alotting runtime to docker after each restart. There are additional checks that could be added but maybe too far? Check parent cgroups to ensure values are <= parent, inspecting rtprio ulimit and issuing a warning. Signed-off-by: Erik St. Martin <alakriti@gmail.com>
* | Return error if env file contains non-ascii or utf8 bytes (for windows)Yong Tang2016-10-255-1/+45
|/ | | | | | | | | | | | | | | | | | | | This fix tries to address the issue raised in 26179 where an env file with non-ascii or utf8 bytes will crash on windows platform. The issue is two-fold: - Windows will adds a BOM mark at the begining with Notepad as the editor - Non-utf8 bytes can not be handled by env file parser. This fix removes utf8 BOM marker if exists so that utf8 encoded env file could be processed. This fix also returns an error (instead of a runtime CreateProcess crash) if env file contains non-utf8 bytes, thus giving users better experiences. Additional test cases has been added in unit tests. This fix fixes 26179. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Update `docker stop` and `docker restart` to allow not specifying timeout ↵Yong Tang2016-10-171-3/+3
| | | | | | and use the one specified at container creation time. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add config parameter to change per-container stop timeout during daemon shutdownYong Tang2016-10-171-0/+5
| | | | | | | | | | | | | This fix tries to add a flag `--stop-timeout` to specify the timeout value (in seconds) for the container to stop before SIGKILL is issued. If stop timeout is not specified then the default timeout (10s) is used. Additional test cases have been added to cover the change. This fix is related to #22471. Another pull request will add `--shutdown-timeout` to daemon for #22471. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Merge pull request #27366 from morelena/use_containsSebastiaan van Stijn2016-10-131-1/+1
|\ | | | | all: use strings.Contains instead Index
| * all: use strings.Contains instead IndexElena Morozova2016-10-131-1/+1
| | | | | | | | Signed-off-by: Elena Morozova <lelenanam@gmail.com>
* | all: replace loop with single appendElena Morozova2016-10-131-3/+1
|/ | | | Signed-off-by: Elena Morozova <lelenanam@gmail.com>
* Windows: Support credential specsJohn Howard2016-10-061-0/+2
| | | | Signed-off-by: John Howard <jhoward@microsoft.com>
* configure docker-init binary pathAntonio Murdaca2016-09-271-0/+2
| | | | Signed-off-by: Antonio Murdaca <runcom@redhat.com>
* Add init process for zombie fightingMichael Crosby2016-09-192-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a small C binary for fighting zombies. It is mounted under `/dev/init` and is prepended to the args specified by the user. You enable it via a daemon flag, `dockerd --init`, as it is disable by default for backwards compat. You can also override the daemon option or specify this on a per container basis with `docker run --init=true|false`. You can test this by running a process like this as the pid 1 in a container and see the extra zombie that appears in the container as it is running. ```c int main(int argc, char ** argv) { pid_t pid = fork(); if (pid == 0) { pid = fork(); if (pid == 0) { exit(0); } sleep(3); exit(0); } printf("got pid %d and exited\n", pid); sleep(20); } ``` Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
* validate build-argsakeven2016-09-122-0/+51
| | | | Signed-off-by: sakeven <jc5930@sina.cn>
* Add engine-api types to dockerMichael Crosby2016-09-075-8/+8
| | | | | | | This moves the types for the `engine-api` repo to the existing types package. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
* Convert dockerd to use cobra and pflagDaniel Nephin2016-08-251-0/+5
| | | | Signed-off-by: Daniel Nephin <dnephin@docker.com>
* Merge pull request #24073 from johnharris85/move-restart-policy-check-to-daemonVincent Demeester2016-08-252-29/+13
|\ | | | | Move restart-policy validation from client to daemon.
| * Move restart-policy validation from client to daemon.johnharris852016-08-062-29/+13
| | | | | | | | Signed-off-by: John Harris <john@johnharris.io>
* | remove fl prefix in containerOptionsallencloud2016-08-111-310/+311
| | | | | | | | Signed-off-by: allencloud <allen.sun@daocloud.io>
* | Wait container's removal via Events APIZhang Wei2016-08-081-2/+2
| | | | | | | | | | | | | | If AutoRemove is set, wait until client get `destroy` events, or get `detach` events that implies container is detached but not stopped. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
* | Move --rm to daemon sideZhang Wei2016-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `--rm` is a client side flag which caused lots of problems: 1. if client lost connection to daemon, including client crash or be killed, there's no way to clean garbage container. 2. if docker stop a `--rm` container, this container won't be autoremoved. 3. if docker daemon restart, container is also left over. 4. bug: `docker run --rm busybox fakecmd` will exit without cleanup. In a word, client side `--rm` flag isn't sufficient for garbage collection. Move the `--rm` flag to daemon will be more reasonable. What this commit do is: 1. implement a `--rm` on daemon side, adding one flag `AutoRemove` into HostConfig. 2. Allow `run --rm -d`, no conflicting `--rm` and `-d` any more, auto-remove can work on detach mode. 3. `docker restart` a `--rm` container will succeed, the container won't be autoremoved. This commit will help a lot for daemon to do garbage collection for temporary containers. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
* | Allow unset `--entrypoint` in `docker run` or `docker create`Yong Tang2016-08-051-0/+3
|/ | | | | | | | | | | | | | This fix tries to address the issue raised in #23498 to allow unset `--entrypoint` in `docker run` or `docker create`. This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`) is passed, unset the Entrypoint during the container run. Additional integration tests have been created to cover changes in this fix. This fix fixes #23498. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* It should be volume not binds for first arg in callDecodeContainerConfig()lixiaobing100512672016-08-021-9/+9
| | | | Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
* Merge pull request #24705 from thaJeztah/update-flag-descriptionsArnaud Porterie2016-07-181-2/+2
|\ | | | | Improve flag help consistency, and update docs
| * Improve flag help consistency, and update docsSebastiaan van Stijn2016-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | This adds the `--live-restore` option to the documentation. Also synched usage description in the documentation with the actual description, and re-phrased some flag descriptions to be a bit more consistent. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | better command `docker network create -h` outputallencloud2016-07-161-1/+1
|/ | | | Signed-off-by: allencloud <allen.sun@daocloud.io>
* Rename `--net` to `--network`Arnaud Porterie (icecrime)2016-07-121-2/+8
| | | | | | | | | | Add a `--network` flag which replaces `--net` without deprecating it yet. The `--net` flag remains hidden and supported. Add a `--network-alias` flag which replaces `--net-alias` without deprecating it yet. The `--net-alias` flag remains hidden and supported. Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>