1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

22 commits

Author SHA1 Message Date
David Calavera
eaa9c1b97e Merge pull request #13596 from jfrazelle/11414-fix-once-and-for-all
fix bug with rmi multiple tag
2015-05-29 15:10:22 -07:00
Jessica Frazelle
185f392691 fix bug with rmi multiple tag
Signed-off-by: Jessica Frazelle <princess@docker.com>
2015-05-29 14:04:06 -07:00
Doug Davis
71a4990229 Fix error when trying to delete an image due to a bad container
I ran into a situation where I was trying:
	`docker rmi busybox`
and it kept failing saying:
    `could not find image: Prefix can't be empty`

While I have no idea how I got into this situation, it turns out this is
error message is from `daemon.canDeleteImage()`. In that func we loop over
all containers checking to see if they're using the image we're trying to
delete.  In my case though, I had a container with no ImageID. So the code
would die tryig to find that image (hence the "Prefix can't be empty" err).
This would stop all processing despite the fact that the container we're
checking had nothing to do with 'busybox'.

My change logs the bad situation in the logs and then skips that container.
There's no reason to fail all `docker rmi ...` calls just because of one
bad container.

Will continue to try to figure out how I got a container w/o an ImageID
but as of now I have no idea, I didn't do anything but normal docker cli
commands.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-27 19:19:43 -07:00
Deng Guangxing
795a58fb44 'docker rmi -f IMAGE_ID' untag all names and delete the image
If an image has been tagged to multiple repos and tags, 'docker
rmi -f IMAGE_ID' will just untag one random repo instead of
untagging all and deleting the image. This patch implement
this. This commit is composed of:

        *untag all names and delete the image

        *add test to this feature

        *modify commandline/cli.md to explain this

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2015-04-11 09:24:21 +08:00
Antonio Murdaca
e4afc379dc Remove job from rmi
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 19:39:14 +02:00
Alexander Morozov
c9eb37f975 Remove engine usage for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 08:43:18 -07:00
Doug Davis
0b2fa9c707 Remove engine.Table from docker history and docker rmi
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-03 08:31:30 -07:00
Lei Jitang
013fb87543 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-28 09:07:20 +08:00
Antonio Murdaca
c79b9bab54 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-25 22:32:08 +01:00
Antonio Murdaca
b80fae7356 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 18:19:59 +01:00
Andy Goldstein
a2b0c9778f Add ability to refer to image by name + digest
Add ability to refer to an image by repository name and digest using the
format repository@digest. Works for pull, push, run, build, and rmi.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
2015-03-17 10:10:42 +00:00
Doug Davis
eeb36c9348 Better error message for "docker rmi ''"
See: https://github.com/docker/docker/issues/10867

While looking at #10867 I noticed that the error message generated for
a blank image ID wasn't very helpful so this fixes that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-04 13:21:59 -08:00
Lei Jitang
d9d9175507 Fix docker remover an image show misleading conflicts
due to its dependency is tagged to multiple repositories

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-02-26 12:01:35 +08:00
Srini Brahmaroutu
7a9c944b82 Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-02-23 18:43:10 +00:00
Josh Hawn
8936789919 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-18 14:03:38 -08:00
Doug Davis
d942c59b69 Wrap strings that could look like ints in quotes
When we use the engine/env object we can run into a situation where
a string is passed in as the value but later on when we json serialize
the name/value pairs, because the string is made up of just numbers
it appears as an integer and not a string - meaning no quotes.  This
can cause parsing issues for clients.

I tried to find all spots where we call env.Set() and the type of the
name being set might end up having a value that could look like an int
(like author). In those cases I switched it to use env.SetJson() instead
because that will wrap it in quotes.

One interesting thing to note about the testcase that I modified is that
the escaped quotes should have been there all along and we were incorrectly
letting it thru. If you look at the metadata stored for that resource you
can see the quotes were escaped and we lost them during the serialization
steps because of the env.Set() stuff.  The use of env is probably not the
best way to do all of this.

Closes: #9602

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-15 05:10:49 -08:00
Jessica Frazelle
ac40e7cbb3 Fix for rmi -f when error "no such id". (9056)
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-11-17 17:04:10 -08:00
Jessica Frazelle
b2efdc538d Removing an image that fails, also removes the image name/tag.
Fixes #7845 and #7801, and a real pain point I had :)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-11 11:29:25 -07:00
Alexandr Morozov
e0339d4b88
Use State as embedded to Container
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-03 00:01:11 +04:00
Solomon Hykes
1c11d7f93e Rename "log_event" to "log"
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:23 +00:00
Alexandr Morozov
8d056423f8 Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:08:19 +00:00
Solomon Hykes
7a5e3df162 Move "image_delete" to daemon/image_delete.go
Note: this cannot yet be moved to graph/ because of a lingering
dependency on daemon. This has been noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00