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.

  • is it possible to wrap an entire ubuntu 14 os in a docker image
  • How to mount Virtualbox shared volumes in Docker-Compose
  • Small binary file is changed on building Docker image using spotify maven plugin
  • Why the docker keeps both image and image container on VM?
  • Running Docker Commands with a bash script inside a container
  • Exceptions in .dockerignore
  • Using SUID in Alpine Docker Image
  • docker nginx stream balancer 404
  • Docker: can't RUN psql commands from Dockerfile
  • Copy files from host system to docker image before starting the container
  • Docker - wordpress deployed on Digital Ocean Droplet - where is the wp-content?
  • connect to container using ssh after adding new user and installing ssh
  • 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.