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.


  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.


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

Post a Comment