From e4e0816835424d7249bea2c5dc42229bdbe39406 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Thu, 12 Apr 2018 11:58:13 +0300 Subject: [PATCH 1/3] build.md: Document --build-arg without value This use case is currently _working correctly_, which is nice, but there is no documentation to be found about it. This PR fixes that. Signed-off-by: Per Lundberg Upstream-commit: 82c23208eeba822473d444221399a7102479a702 Component: cli --- .../cli/docs/reference/commandline/build.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/components/cli/docs/reference/commandline/build.md b/components/cli/docs/reference/commandline/build.md index 01ab913eca..0c1c491d33 100644 --- a/components/cli/docs/reference/commandline/build.md +++ b/components/cli/docs/reference/commandline/build.md @@ -425,6 +425,18 @@ Dockerfile are echoed during the build process. For detailed information on using `ARG` and `ENV` instructions, see the [Dockerfile reference](../builder.md). +You may also use the `--build-arg` flag without a value, in which case the value +from the local environment will be propagated into the Docker container being +built: + +```bash +$ export HTTP_PROXY=http://10.20.30.2:1234 +$ docker build --build-arg HTTP_PROXY . +``` + +This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) +for more information. + ### Optional security options (--security-opt) This flag is only supported on a daemon running on Windows, and only supports @@ -504,7 +516,7 @@ section in the userguide for more information. The `--squash` option has a number of known limitations: -- When squashing layers, the resulting image cannot take advantage of layer +- When squashing layers, the resulting image cannot take advantage of layer sharing with other images, and may use significantly more space. Sharing the base image is still supported. - When using this option you may see significantly more space used due to @@ -581,7 +593,7 @@ $ docker build --squash -t test . If everything is right, the history will look like this: ```bash -$ docker history test +$ docker history test IMAGE CREATED CREATED BY SIZE COMMENT 4e10cb5b4cac 3 seconds ago 12 B merge sha256:88a7b0112a41826885df0e7072698006ee8f621c6ab99fca7fe9151d7b599702 to sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb From 8037d00abb8b258c7f71d7c4cc965dd4ca6482b1 Mon Sep 17 00:00:00 2001 From: Henry N Date: Mon, 16 Apr 2018 16:01:53 +0200 Subject: [PATCH 2/3] docker load: Typofix in examples Remove the double "docker docker" from example Signed-off-by: Henry Ne Upstream-commit: 79c489d812524ae5a0ff26c44fa4bb2e309810bb Component: cli --- components/cli/docs/reference/commandline/load.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/docs/reference/commandline/load.md b/components/cli/docs/reference/commandline/load.md index 1c1d57f4fb..2bb99b87bb 100644 --- a/components/cli/docs/reference/commandline/load.md +++ b/components/cli/docs/reference/commandline/load.md @@ -35,7 +35,7 @@ bzip2, or xz) from a file or STDIN. It restores both images and tags. ## Examples ```bash -$ docker docker image ls +$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE From 46a62eba1d9f83ca0bb53e27e3212f4a7321aa19 Mon Sep 17 00:00:00 2001 From: Nassim 'Nass' Eddequiouaq Date: Mon, 16 Apr 2018 12:48:03 -0700 Subject: [PATCH 3/3] Revert unencryted storage warning prompt Signed-off-by: Nassim 'Nass' Eddequiouaq Upstream-commit: 3acf5d2e4741ac9beb3c121e8873523d90c05db4 Component: cli --- components/cli/cli/command/registry/login.go | 25 +++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/components/cli/cli/command/registry/login.go b/components/cli/cli/command/registry/login.go index 83c1554d55..4cd57b0c33 100644 --- a/components/cli/cli/command/registry/login.go +++ b/components/cli/cli/command/registry/login.go @@ -55,22 +55,15 @@ func NewLoginCommand(dockerCli command.Cli) *cobra.Command { return cmd } -// unencryptedPrompt prompts the user to find out whether they want to continue -// with insecure credential storage. If stdin is not a terminal, we assume they -// want it (sadly), because people may have been scripting insecure logins and -// we don't want to break them. Maybe they'll see the warning in their logs and -// fix things. -func unencryptedPrompt(dockerCli command.Streams, filename string) error { - fmt.Fprintln(dockerCli.Err(), fmt.Sprintf(unencryptedWarning, filename)) +// displayUnencryptedWarning warns the user when using an insecure credential storage. +// After a deprecation period, user will get prompted if stdin and stderr are a terminal. +// Otherwise, we'll assume they want it (sadly), because people may have been scripting +// insecure logins and we don't want to break them. Maybe they'll see the warning in their +// logs and fix things. +func displayUnencryptedWarning(dockerCli command.Streams, filename string) error { + _, err := fmt.Fprintln(dockerCli.Err(), fmt.Sprintf(unencryptedWarning, filename)) - if dockerCli.In().IsTerminal() { - if command.PromptForConfirmation(dockerCli.In(), dockerCli.Out(), "") { - return nil - } - return errors.Errorf("User refused unencrypted credentials storage.") - } - - return nil + return err } type isFileStore interface { @@ -146,7 +139,7 @@ func runLogin(dockerCli command.Cli, opts loginOptions) error { //nolint: gocycl store, isDefault := creds.(isFileStore) if isDefault { - err = unencryptedPrompt(dockerCli, store.GetFilename()) + err = displayUnencryptedWarning(dockerCli, store.GetFilename()) if err != nil { return err }