Running yum update in fedora 21 makes a very large image

I have the fedora 21 image pulled,

fedora              21                  834629358fe2        5 weeks ago         250.2 MB

I create a Dockerfile

  • Mapping a Volume in a docker
  • Docker on Windows getting “Could not locate Gemfile”
  • How can I update a specific docker image when changes are applied
  • Docker's `docker0` device dies repeatedly (`inet addr` disappears)
  • What is the concept of Ambassador in distributed systems?
  • Setting up Docker Postgres inside Python container
  • from fedora:21
    maintainer ...
    run yum -y update

    Then I do,

    sudo docker build -t eric/fedora:21 .

    But the size of this image is very large, about 650MB ,

    eric/fedora         21                  50cbf024d8f4        16 seconds ago      658.8 MB

    Is this OK, or am I doing something wrong?

  • docker php, nginx is super slow with wordpress
  • Build with docker into host directory
  • Unable to execute Postgresql commands with python in seperate docker containers
  • Is Postgres designed to write to shared data stores?
  • Starting Docker containers from PHP
  • Messed up Docker environment
  • One Solution collect form web for “Running yum update in fedora 21 makes a very large image”

    As first attempt, it is good practice removing the yum cache (or any cache system, as apt) in your Docker image. In case of yum you can use yum clean all.

    If it doesn’t fix the issue, you can run an instance of fedora:21 container, run yum update manually, and check why it increases so much its size. Maybe there are some missing packages from fedora image that are installed when you run yum update (tip: to check easily all the files changed in the container you can use docker diff).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.