How to make current environment as image docker in ubunu 14.04?

I have ubuntu 14.04 and installed node.js and many modules recently.
How can I create docker image that have current environment (the image has to use installed node.js in the ubnutu 14.04 and all its modules) without installing nodejs and modules on new Image.

  • Certificate error while running boot2Docker
  • Open existing nvidia-docker container
  • Selenium Grid with Docker set Language for Firefox
  • Docker: How to connect to Postgresql container without exposing port
  • Wrong type error on an interface intended to test a method using Docker's client API
  • Pagecache and dirty pages in paused container
  • Kubernetes - How to run kubectl commands inside a container?
  • Does putting ARG at top of Dockerfile prevent layer re-use?
  • Docker-compose: no access to Wordpress files
  • TCP receives packets, but it ignores them
  • Using rexray volume driver for AWS
  • How can I access a shell on the VM Linux host when using the Docker Windows Beta
  • One Solution collect form web for “How to make current environment as image docker in ubunu 14.04?”

    There are two options:

    1. Docker Commit the current image and then push it to a repository as your base image.
    2. Use a Dockerfile to repeat the steps you have done manually to create your base image.

    You can then use FROM in your downstream images to get the current state without having to rebuild it. Option 2 is preferred as you can see exactly how an image was created and easily make changes.

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