Merge pull request #5005 from shykes/deprecate-insert

Deprecate 'docker insert'
This commit is contained in:
Michael Crosby 2014-04-03 17:16:25 -07:00
Родитель 468cb80c59 615ac8feb2
Коммит 09aa28eca0
5 изменённых файлов: 7 добавлений и 29 удалений

Просмотреть файл

@ -56,7 +56,6 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
{"images", "List images"}, {"images", "List images"},
{"import", "Create a new filesystem image from the contents of a tarball"}, {"import", "Create a new filesystem image from the contents of a tarball"},
{"info", "Display system-wide information"}, {"info", "Display system-wide information"},
{"insert", "Insert a file in an image"},
{"inspect", "Return low-level information on a container"}, {"inspect", "Return low-level information on a container"},
{"kill", "Kill a running container"}, {"kill", "Kill a running container"},
{"load", "Load an image from a tar archive"}, {"load", "Load an image from a tar archive"},
@ -85,7 +84,9 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
return nil return nil
} }
// FIXME: 'insert' is deprecated.
func (cli *DockerCli) CmdInsert(args ...string) error { func (cli *DockerCli) CmdInsert(args ...string) error {
fmt.Fprintf(os.Stderr, "Warning: '%s' is deprecated and will be removed in a future version. Please use 'docker build' and 'ADD' instead.\n")
cmd := cli.Subcmd("insert", "IMAGE URL PATH", "Insert a file from URL in the IMAGE at PATH") cmd := cli.Subcmd("insert", "IMAGE URL PATH", "Insert a file from URL in the IMAGE at PATH")
if err := cmd.Parse(args); err != nil { if err := cmd.Parse(args); err != nil {
return nil return nil

Просмотреть файл

@ -458,6 +458,7 @@ func getImagesSearch(eng *engine.Engine, version version.Version, w http.Respons
return job.Run() return job.Run()
} }
// FIXME: 'insert' is deprecated as of 0.10, and should be removed in a future version.
func postImagesInsert(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error { func postImagesInsert(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := parseForm(r); err != nil { if err := parseForm(r); err != nil {
return err return err

Просмотреть файл

@ -711,34 +711,6 @@ preserved.
WARNING: No swap limit support WARNING: No swap limit support
.. _cli_insert:
``insert``
----------
::
Usage: docker insert IMAGE URL PATH
Insert a file from URL in the IMAGE at PATH
Use the specified ``IMAGE`` as the parent for a new image which adds a
:ref:`layer <layer_def>` containing the new file. The ``insert`` command does
not modify the original image, and the new image has the contents of the parent
image, plus the new file.
Examples
~~~~~~~~
Insert file from GitHub
.......................
.. code-block:: bash
$ sudo docker insert 8283e18b24bc https://raw.github.com/metalivedev/django/master/postinstall /tmp/postinstall.sh
06fd35556d7b
.. _cli_inspect: .. _cli_inspect:
``inspect`` ``inspect``

Просмотреть файл

@ -640,6 +640,7 @@ func TestImagesFilter(t *testing.T) {
} }
} }
// FIXE: 'insert' is deprecated and should be removed in a future version.
func TestImageInsert(t *testing.T) { func TestImageInsert(t *testing.T) {
eng := NewTestEngine(t) eng := NewTestEngine(t)
defer mkRuntimeFromEngine(eng, t).Nuke() defer mkRuntimeFromEngine(eng, t).Nuke()

Просмотреть файл

@ -82,6 +82,7 @@ func InitServer(job *engine.Job) engine.Status {
job.Eng.Hack_SetGlobalVar("httpapi.server", srv) job.Eng.Hack_SetGlobalVar("httpapi.server", srv)
job.Eng.Hack_SetGlobalVar("httpapi.runtime", srv.runtime) job.Eng.Hack_SetGlobalVar("httpapi.runtime", srv.runtime)
// FIXME: 'insert' is deprecated and should be removed in a future version.
for name, handler := range map[string]engine.Handler{ for name, handler := range map[string]engine.Handler{
"export": srv.ContainerExport, "export": srv.ContainerExport,
"create": srv.ContainerCreate, "create": srv.ContainerCreate,
@ -641,7 +642,9 @@ func (srv *Server) ImagesSearch(job *engine.Job) engine.Status {
return engine.StatusOK return engine.StatusOK
} }
// FIXME: 'insert' is deprecated and should be removed in a future version.
func (srv *Server) ImageInsert(job *engine.Job) engine.Status { func (srv *Server) ImageInsert(job *engine.Job) engine.Status {
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)
if len(job.Args) != 3 { if len(job.Args) != 3 {
return job.Errorf("Usage: %s IMAGE URL PATH\n", job.Name) return job.Errorf("Usage: %s IMAGE URL PATH\n", job.Name)
} }