how to change MTU inside docker container on ubuntu 14.4

I want to change MTU(Maximum Transmission Unit) inside docker which is running on ubuntu 14.04. Also docker container running with ubuntu 14.04.

The problem is that its docker0 interface on host os can change the MTU value from 1500 to 9000 but its doesn’t gives affects inside docker os. means inside docker it is running with a older value i.e 1500. And when I restart the docker services on host machine its all changes goes to default.

  • Docker compose with two files
  • how to make docker client connect to docker daemon over http
  • docker exec not working in docker-compose containers
  • Docker with App_Data volume?
  • How do I connect to a web app running on an image on docker hub?
  • Docker container not running properly
  • I had also tried with creating bridge connection with new interface but while I up that interface its down my whole network and doesn’t work anymore.

    Help will be highly appreciated

  • How to display the process id that opened a particular socket within a docker container?
  • Docker Proxy Setup
  • Docker for Mac: x509: certificate signed by unknown authority error
  • Multiple Websites and PHP Versions with Docker-Compose
  • Container keeps restarting when trying to run consul agent as docker container
  • not able to start uwsgi as a service in docker
  • One Solution collect form web for “how to change MTU inside docker container on ubuntu 14.4”

    See docs.docker.com/articles/networking/#docker0 extract “

    --mtu=BYTES — override the maximum packet length on docker0.
    

    On Ubuntu you would add these to the DOCKER_OPTS setting in /etc/default/docker on your Docker host and restarting the Docker service.”

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