"/bin/sh: 1: [“apache2ctl”,: not found" in docker

Viewed 3650

I have a simple Dockerfile

FROM ubuntu
RUN apt-get update
RUN apt-get install -y apache2
RUN apt-get install -y apache2-utils
RUN apt-get clean
RUN apt-get upgrade -y
EXPOSE 80
CMD [“apache2ctl”, “-D FOREGROUND”]

I build it with the following statement

docker build -t mywebserver .

That works quite well, but when I want to execute it with

docker run -p 80:80 mywebserver

it returns the error message you can see in the headline. I also tried /usr/sbin/apache2ctl instead of apache2ctl to make sure that it is not because of missing in the PATH but that did not help.

So thanks in advance for your help.

2 Answers
Related