How to fill user input for interactive command for "RUN" in Docker ?

 

Many a times while building the docker image of Ubuntu, the build gets stuck with a timezone prompt waiting for the user to confirm their timezone.

Prompt:

  Please select the geographic area in which you live. Subsequent configuration   
  questions will narrow this down by presenting a list of cities, representing  
  the time zones in which they are located.  
   
 1. Africa  3. Antarctica 5. Arctic 7. Atlantic 9. Indian  11. SystemV 13. Etc  
 2. America 4. Australia  6. Asia  8. Europe  10. Pacific 12. US  

The issue can be easily fixed by adding the below lines to the Dockerfile.

Solution:

 ENV TZ=Asia/Kolkata \  
    DEBIAN_FRONTEND=noninteractive  
   
 RUN apt-get update && \  
   apt-get install tzdata  

Post a Comment

0 Comments