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.

  • How to configure the directory where to store each database?
  • How to perform code analysis in sonarqube in docker in a ASP.NET web application
  • How do I expose ports on Heroku with a Dockerfile?
  • How to pass an environment variable into a RUN command
  • Setup Mesos-DNS dockerized on a mesos cluster
  • How to mount volume from container to host in Docker?
  • Docker registry --insecure-registry not working
  • Multiple Docker images filesystem scan
  • Docker: using container with headless Selenium Chromedriver
  • Resolve error: An error occurred while installing mysql2 (0.4.5), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.4.5'`
  • Colorized output from docker to websocket
  • Does Apache Mesos + Marathon support LXD cluster management?
  • 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.