is it possible to wrap an entire ubuntu 14 os in a docker image

I have a Ubuntu 14 desktop, on which I do some of my development work.
This work mainly revolves around Django & Flask development using PyCharm
I was wandering if it was possible to wrap the entire OS file system in a Docker container, so my whole development environment, including PyCharm and any other tools, would become portable

  • Building an application stack using Docker
  • How to provide parameter to docker run with “oc new-app” in OpenShift?
  • Setting a static IP to docker container using LXC driver
  • docker network connect to host second interface
  • Docker difference in start and stop times
  • Using variable interpolation in string in Docker
  • Limit number of open files in a Container
  • Execute a Firefox Browser in a Docker Container for Selenium testing
  • iptables rules break communication between Docker containers
  • Docker Volumes: Docker Volume does not get mounted correctly on Amazon Linux
  • Why docker container exits immediately
  • Where is the Docker daemon log on Ubuntu 14.04?
  • One Solution collect form web for “is it possible to wrap an entire ubuntu 14 os in a docker image”

    Yes, this is where Docker shines. Once you install Docker you can run:

    docker run --name my-dev -it ubuntu:14.04 /bin/bash

    and this will put you, as root, inside a Docker container’s bash prompt. It is for all intents and purposes the entire os without anything extra, you will need to install the extras, like pycharm, flask, django, etc. Your entire environment. The environment you start with has nothing, so you will have to add things like pip (apt-get install -y python-pip), and other goodies. Once you have your entire environment you can exit (with exit, or ^D) and you will be back in your host operating system. Then you can commit :

    docker commit -m 'this is my development image' my-dev my-dev

    This takes the Docker image you just ran (and updated with changes) and saves it on your machine with the tag my-dev:v1, any time in the future you can run this again using the invocation:

    docker run -it my-dev /bin/bash

    Building a Docker image like this is harder, it is easier once you learn how to make a Dockerfile that describes the base image (ubuntu:14.04) and all of the modifications you want to make to it in a file called Dockerfile. I have an example of a Dockerfile here:

    This builds my python development environment, including git, ssh keys, compilers, etc. It does have my name hardcoded in it, so, it won’t help you much doing development (I need to fix that). Anyway, you can download the Dockerfile, change it with your details in it, and create your own image like this:

    docker build -t my-dev -< Dockerfile

    There are hundreds of examples on the Docker hub which is where I started with mine.


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