Cannot run container

Hi All,

I’m new with Docker

Create a Dockerfile to build apache, below is my code

FROM ubuntu:14.04

MAINTAINER Jacky

RUN apt-get update && apt-get install -y apache2 && apt-get clean && rm -rf /var/lib/apt/lists/*

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2

EXPOSE 80

CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]

After build image, then I using this command to run container

docker run -d --name apache jacky/ubuntuapache:14.04

this container cannot UP, it’s Exited after I ran that command. Something went wrong here?

Looking for someone help!

Thanks in advance,

Jacky

Greetings,

if you docker logs -f CONTAINER_ID

[Mon Jul 13 06:51:28.059665 2015] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Jul 13 06:51:28.059843 2015] [core:warn] [pid 1] AH00111: Config variable ${APACHE_PID_FILE} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

Invalid Mutex directory in argument file:${APACHE_LOCK_DIR} seems to be the problem,
this could help you http://askubuntu.com/a/452060

2 Likes

Yeah I got it, Thank your quick help

Regard,
Jacky

1 Like

Hi jack,

 i have a some problem.. how did you do crctly.. i don't understand the answer.. could you share the screenshot how will i resolve the error..??