# Docker ends running after initialization ( service apache2 start )

**URL:** <https://forums.docker.com/t/docker-ends-running-after-initialization-service-apache2-start/34726>\
**Category:** General\
**Created:** [July 9, 2017, 3:27pm UTC](https://forums.docker.com/t/docker-ends-running-after-initialization-service-apache2-start/34726 "2017-07-09T15:27:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ypspef](https://avatars.discourse-cdn.com/v4/letter/y/f6c823/32.png) [@ypspef](https://forums.docker.com/u/ypspef)\
**Post date:** [July 9, 2017, 3:27pm UTC](https://forums.docker.com/t/docker-ends-running-after-initialization-service-apache2-start/34726/1 "2017-07-09T15:27:59Z")

</div>

I’m trying to build my own apache image.  
My running environment is

Version 17.06.0-ce  
API version 1.30  
Go version go1.8.3  
OS type linux  
OS Debian GNU/Linux 9 (stretch)  
Architecture amd64  
Kernel version 4.9.0-3-amd64

This is my Dockerfile

################################################

FROM debian:stable

WORKDIR /app

ENV TERM=xterm

RUN apt-get update

RUN apt-get install -y php7.0

RUN apt-get install -y apt-utils

RUN apt-get install -y mc

RUN apt-get install -y apache2

VOLUME /webserver\_data

EXPOSE 80

ENTRYPOINT /usr/sbin/service apache2 start

################################################

As far as I’ve read, the container stops running when the last command it runs ends.  
But what I really want to is to start the apache2 and leave the container listening for connections.  
Is this possible ?  
What am I missing ?

Thanks.  
Regards.

---

<div class="post-metadata">

**Author:** ![ssbkang](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@ssbkang](https://forums.docker.com/u/ssbkang)\
**Post date:** [July 10, 2017, 9:41pm UTC](https://forums.docker.com/t/docker-ends-running-after-initialization-service-apache2-start/34726/2 "2017-07-10T21:41:30Z")

</div>

You could run “docker logs -f {image ID]” to review the logs - building and running your dockerfile, it produces the following error message:

```
[....] Starting Apache httpd web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message. ok

```

It would require setting up ENV variables as well as ServerName.
