Browse code

Merge pull request #5005 from shykes/deprecate-insert

Deprecate 'docker insert'

Michael Crosby authored on 2014/04/04 09:16:25
Showing 5 changed files
... ...
@@ -56,7 +56,6 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
56 56
 		{"images", "List images"},
57 57
 		{"import", "Create a new filesystem image from the contents of a tarball"},
58 58
 		{"info", "Display system-wide information"},
59
-		{"insert", "Insert a file in an image"},
60 59
 		{"inspect", "Return low-level information on a container"},
61 60
 		{"kill", "Kill a running container"},
62 61
 		{"load", "Load an image from a tar archive"},
... ...
@@ -85,7 +84,9 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
85 85
 	return nil
86 86
 }
87 87
 
88
+// FIXME: 'insert' is deprecated.
88 89
 func (cli *DockerCli) CmdInsert(args ...string) error {
90
+	fmt.Fprintf(os.Stderr, "Warning: '%s' is deprecated and will be removed in a future version. Please use 'docker build' and 'ADD' instead.\n")
89 91
 	cmd := cli.Subcmd("insert", "IMAGE URL PATH", "Insert a file from URL in the IMAGE at PATH")
90 92
 	if err := cmd.Parse(args); err != nil {
91 93
 		return nil
... ...
@@ -458,6 +458,7 @@ func getImagesSearch(eng *engine.Engine, version version.Version, w http.Respons
458 458
 	return job.Run()
459 459
 }
460 460
 
461
+// FIXME: 'insert' is deprecated as of 0.10, and should be removed in a future version.
461 462
 func postImagesInsert(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
462 463
 	if err := parseForm(r); err != nil {
463 464
 		return err
... ...
@@ -711,34 +711,6 @@ preserved.
711 711
 	WARNING: No swap limit support
712 712
 
713 713
 
714
-.. _cli_insert:
715
-
716
-``insert``
717
-
718
-::
719
-
720
-    Usage: docker insert IMAGE URL PATH
721
-
722
-    Insert a file from URL in the IMAGE at PATH
723
-
724
-Use the specified ``IMAGE`` as the parent for a new image which adds a
725
-:ref:`layer <layer_def>` containing the new file. The ``insert`` command does
726
-not modify the original image, and the new image has the contents of the parent
727
-image, plus the new file.
728
-
729
-
730
-Examples
731
-~~~~~~~~
732
-
733
-Insert file from GitHub
734
-.......................
735
-
736
-.. code-block:: bash
737
-
738
-    $ sudo docker insert 8283e18b24bc https://raw.github.com/metalivedev/django/master/postinstall /tmp/postinstall.sh
739
-    06fd35556d7b
740
-
741 714
 .. _cli_inspect:
742 715
 
743 716
 ``inspect``
... ...
@@ -640,6 +640,7 @@ func TestImagesFilter(t *testing.T) {
640 640
 	}
641 641
 }
642 642
 
643
+// FIXE: 'insert' is deprecated and should be removed in a future version.
643 644
 func TestImageInsert(t *testing.T) {
644 645
 	eng := NewTestEngine(t)
645 646
 	defer mkRuntimeFromEngine(eng, t).Nuke()
... ...
@@ -82,6 +82,7 @@ func InitServer(job *engine.Job) engine.Status {
82 82
 	job.Eng.Hack_SetGlobalVar("httpapi.server", srv)
83 83
 	job.Eng.Hack_SetGlobalVar("httpapi.runtime", srv.runtime)
84 84
 
85
+	// FIXME: 'insert' is deprecated and should be removed in a future version.
85 86
 	for name, handler := range map[string]engine.Handler{
86 87
 		"export":           srv.ContainerExport,
87 88
 		"create":           srv.ContainerCreate,
... ...
@@ -641,7 +642,9 @@ func (srv *Server) ImagesSearch(job *engine.Job) engine.Status {
641 641
 	return engine.StatusOK
642 642
 }
643 643
 
644
+// FIXME: 'insert' is deprecated and should be removed in a future version.
644 645
 func (srv *Server) ImageInsert(job *engine.Job) engine.Status {
646
+	fmt.Fprintf(job.Stderr, "Warning: '%s' is deprecated and will be removed in a future version. Please use 'build' and 'ADD' instead.\n", job.Name)
645 647
 	if len(job.Args) != 3 {
646 648
 		return job.Errorf("Usage: %s IMAGE URL PATH\n", job.Name)
647 649
 	}