This is what docker images
shows before I run docker build
.
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
myapp latest a38da0bd9e0b 6 seconds ago 523.8 MB
golang onbuild b4997c557048 10 days ago 517.2 MB
After I make some changes to the myapp
source code, I run docker build -t myapp .
and I end up with images named <none>
.
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
myapp latest a38da0bd9e0b Less than a second ago ago 523.8 MB
<none> <none> e4209f97e819 10 minutes ago 523.8 MB
golang onbuild b4997c557048 10 days ago 517.2 MB
I know I can remove them with docker rmi <IMAGE ID>
, but why does that happen in the first place? How can I prevent that from happening? The Dockerfile
I'm building looks like this.
FROM golang:onbuild
EXPOSE 8080