I am new to Docker Containers. But I am very confused with a few things. My goal is to create docker container with ubuntu 16.04,Nginx and nodejs. From googling and tururials I only found docker-compose.yml file with services like nginx, mysql etc.

I am wondering how I define the os (linux flavour). I know there are images on docker hub. I am very lost please help.

  • You could use nginx and mysql images from Docker hub directly. These will have a minimalistic OS underneath. Why do you need a full blown OS image like of Ubuntu 16.04? – seshadri_c Oct 24 '20 at 15:12
  • That is the requirement – Shahid Karimi Oct 24 '20 at 16:07
  • 1
    Then you would have to create the images yourself (hint: Dockerfile) with the components you need on top of the Ubuntu OS image. – seshadri_c Oct 24 '20 at 16:15
  • You can create two images using Dockerfile. Once for Nginx and another for nodejs. Then run the containers from them. You can upload the images in dockerhub. Going further you want to run containers using docker-compose. It assures that whenever the containers stops, it will start it again. – Prakash Nov 2 '20 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.