Docker RUN apt-get -y update && apt-get install -y fortunes

Tried to build my own docker, got a little problem, here’s the log
i was following the tutorial on Docker.

FROM docker/whalesay:lateset
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

This happened after RUN apt-get…

  • Accessing the same mongoDB instance from multiple Docker containers
  • Vagrant would not provision docker
  • “Create React App” with Docker
  • How to share .sock file between nginx docker and uwsgi docker?
  • how to make a non-hardcoded URL path in docker image to call backend service?
  • Connect to docker-machine using 'localhost'
  • W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_universe_source_Sources.gz is not what the server reported 213537 7925687
    W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages.gz is not what the server reported 11688 7588885
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources  Hash Sum mismatch
    
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-amd64/Packages  Hash Sum mismatch
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    

  • AWS Elastic Beanstalk Docker deployment failed
  • kubectl: Connection to server was refused
  • Why does docker list two separate images (one of which doesn't exist) for my container?
  • Need help on docker scaling of micro-services
  • Why docker container is consuming lot of memory?
  • Passing file as argument to Docker container
  • 3 Solutions collect form web for “Docker RUN apt-get -y update && apt-get install -y fortunes”

    run this command before apt-get update:

    sudo rm -rf /var/lib/apt/lists/*
    

    You’ve run out of space. Or more precisely, the amount of space dedicated to docker assets has been exceeded.

    Try this (on the host machine):

    $ docker rmi $(docker images -q)
    

    Or this: https://hub.docker.com/r/martin/docker-cleanup-volumes/

    Adding apt-get clean before the apt-get update solves my problem. You can try it.

    The Dockerfile should look like this:

    FROM docker/whalesay:latest
    RUN apt-get clean && apt-get -y update && apt-get install -y fortunes
    CMD /usr/games/fortune -a | cowsay
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.