I can not start apache using entry point

My Dockerfile content is:

FROM ubuntu:24.04
EXPOSE 80
EXPOSE 443

RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential && \
  apt-get install -y software-properties-common && \
  apt-get install -y byobu curl git htop man unzip vim wget && \
  rm -rf /var/lib/apt/lists/*

# update the repository sources list
# and install dependencies
RUN apt-get update \
    && apt-get install -y curl \
    && apt-get -y autoclean

RUN mkdir /client_ssl

RUN apt-get install -y mc

RUN apt install mariadb-client -y

RUN apt install mysql-client -y

RUN apt-get install -y lynx   # neede by mc F3

RUN apt-get install -y pkg-config   #needed by watchman

RUN apt-get install -y wget

RUN apt-get install -y gpg-agent wget

RUN apt-get update

RUN apt install -y apache2

RUN apt install -y php libapache2-mod-php php-mysql

# ENTRYPOINT ["/usr/sbin/apache2ctl start"]

I had to comment the ENTRYPOINT one since docker build can not find the apache2ctl command. My goal is to have Apache running at the end of my Dockerfile…
Any suggestions? Thanks in advance

Hi

As a suggestion, a question : why did you use an Ubuntu image and not a httpd (apache) one ?

Split your entrypoint to an array, first element. Will be the tool, second element will be “start”

Currently it looks for an executable named /usr/sbin/apache2ctl start

Also, you may want to have that “start” be in CMD rather than entrypoint

1 Like

For Learning and controlling purposes. Also, as I recall the image you are referring to does not use Ubuntu. Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.