Reputation: 188
This is my Docker file
FROM ubuntu
RUN apt-get update
RUN apt-get install –y apache2
RUN apt-get install –y apache2-utils
RUN apt-get clean
EXPOSE 80 CMD [“apache2ctl”, “-D”, “FOREGROUND”]
This is the error I get
Step 6/6 : EXPOSE 80 CMD ["apache2ct1","-D","FOREGROUND"]
Invalid containerPort: CMD
Upvotes: 4
Views: 1406
Reputation: 1748
EXPOSE
does not provide CMD
itself, CMD
is a separate parameter in Docker file syntax. With that been said your Dockerfile should be like this:
FROM ubuntu
RUN apt-get update
RUN apt-get install –y apache2
RUN apt-get install –y apache2-utils
RUN apt-get clean
EXPOSE 80
CMD [“apache2ctl”, “-D”, “FOREGROUND”]
Upvotes: 8