@satyak (Satyak) posted a new topic, subject "About building image for web application". It read:

   Hi,  
    I'm new to docker. I'm trying to create image with Ubuntu, Java and Apache. What I did is I created an Image as below
    
    FROM ubuntu:16.04  
    FROM jdk:8  
    FROM apache
    
    My question is, is it right way to create an Image, because the images (Jdk and apache) which I got from docker hub may be built from a different Ubuntu version and I may get conflicts or they don't have any OS installed in it or it may not behave as intended?
    
    Please suggest a solution.
    
    Thanks

To which @coder98103 replied

    You are misusing FROM. It is not additive. You can only have one base image. Your example switches between 3 base images; it doesn't combine them.
    
    You probably want something like:
    [code] 
        FROM ubuntu:16.04
        RUN apt-get update
        RUN apt-get install -q -y openjdk-8-jdk apache2
    [/code]

After which, @oninoshiko (Oninoshiko) added

    In addition to what coder98103 says (which is completely correct), **I** generally try to separate my middle-ware from the web-server, whenever possible.

So @satyak (Satyak) replied

    Thanks for your reply.


{'source': 'discourse', 'url': 'https://forums.docker.com/t/about-building-image-for-web-application/70086', 'title': 'About building image for web application', 'views': 311, 'has_accepted_answer': False, 'word_count': 172, 'like_count': 2, 'reply_count': 1, 'participant_count': 3, 'posts': 4, 'tags': '', 'author': '@satyak (Satyak)', 'participants': '@satyak (Satyak), @coder98103, @oninoshiko (Oninoshiko)', 'image_url': [None], 'created_at': '2019-02-28T06:32:40.542Z', 'last_posted_at': '2019-03-01T05:23:19.583Z'}