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.

  • Connecting to a specific shell instance in a docker container?
  • Docker not mounting a folder as volume
  • Can we create volumes inside docker container
  • How to enable the Docker Remote API on Windows
  • Docker cp Path not specified
  • Symfony 3 with Docker and nginx
  • Error in docker-compose build. version issue
  • Connect to a PostgreSQL database on a Docker container
  • Is it possible to import OSM data from inside psql?
  • How can I delete Docker's images?
  • Can't remove image due to error: “Error response from daemon: reference does not exist”
  • Docker commands do not respond anymore
  • 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.