Home > front end >  Apache installation from Dockerfile
Apache installation from Dockerfile

Time:06-27

I want to create a docker image that cointains the Apache web server (running in Ubuntu). When docker execute the command RUN apt install apache2 -y, the image creation process stops waiting for the geographical zone and it can't be set manually in the terminal. I want to set "8" for Europe and then "29" for Madrid. There is a way to stablish this information in a simple line command?

CodePudding user response:

This installs Apache and tzdata without prompting and then sets the time zone to Madrid.

FROM ubuntu:22.04
RUN apt-get update && DEBIAN_FRONTEND=NONINTERACTIVE apt-get install -y apache2 tzdata
ENV TZ=Europe/Madrid
  • Related