Apache docket container not starting using docker-compose up












0















I'm working on a use case to create a Docker container for an apache server for a CMS application.



Below is the folder structure for the docket container.



apache-rproxy-docker (folder)
-docker-compose.yml
- httpd (folder)
- Dockerfile
- httpd.conf


docker-compose.yml



version: '2.1'

services:
apache:
build: httpd/
ports:
- "80:80"
networks:
- my_network
restart: always

networks:
my_network:
driver: bridge


Dockerfile



FROM httpd:2.4
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf


httpd.conf



Listen 80

ServerName localhost:80
ServerAdmin admin@localhost

ErrorLog logs/error.log
LogLevel error

###
# Note that the following LoadModule lines only represent the minimum 'Web-Developer' Suite configuration.
#
# Also note that some of the following LoadModule lines, which are commented out, are still loaded under…
# confSuite-extra*.conf
# confextra*.conf
# …configuration files -- for modular reasons.
#
# For example:
# mod_deflate is loaded under confSuite-extramod_deflate_logio.conf and NOT under httpd.conf
# status_module is loaded under confextrahttpd-info.conf and NOT under httpd.conf
#
# Check last part of httpd.conf for the Apache base and 'Web-Developer' *.conf files that are included.
###

#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_default_module modules/mod_authn_default.so
#LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_default_module modules/mod_authz_default.so
#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule imagemap_module modules/mod_imagemap.so
#LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so


#CMS
<VirtualHost *:80>
ServerName cms.dev.local

ProxyPreserveHost On
#INCLUDE THE EXTRA PROXYPASS RULE FOR /site HERE
ProxyPass /site/ http://localhost:8080/site/
ProxyPass / http://localhost:8080/cms/
ProxyPassReverse / http://localhost:8080/cms/
ProxyPassReverseCookiePath /cms /
</VirtualHost>


I have a couple of issues which are holding me back,




  1. While I'm able to build the container with no issue, but when trying to up the container using "docker-compose up", the container starts and terminates instantaneously without any errors.

  2. I don't see the port mapping for the container, which is odd.


enter image description here



Below is the output on executing docker inspect container_id.



[
{
"Id": "1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86",
"Created": "2018-11-19T21:32:39.9551494Z",
"Path": "httpd-foreground",
"Args": ,
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 1,
"Error": "",
"StartedAt": "2018-11-19T21:32:40.7494723Z",
"FinishedAt": "2018-11-19T21:32:40.8537987Z"
},
"Image": "sha256:31f9d98b9ee458dbf1befb5e07c87c6ef959dcc2ef690fe523fd887b12f9dbf9",
"ResolvConfPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hostname",
"HostsPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hosts",
"LogPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86-json.log",
"Name": "/apache-rproxy-docker_apache2_1_71f4a0b7076b",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": ,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "apache-rproxy-docker_spa_network",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": ,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a-init/diff:/var/lib/docker/overlay2/84adfc08eb41b4f6ede14df10775b291c8195ade8b5d6351892e7c0f0606bc92/diff:/var/lib/docker/overlay2/5e42bbf563f3fbc5829685509b13f1d5536886a68ee5bd913bd4910dc9737478/diff:/var/lib/docker/overlay2/48ccff5d0d55c955e8e3e49b62c01865826dbfd01bd25206c411ae69f08bda4e/diff:/var/lib/docker/overlay2/fa24d9a31cc583d8a9583e659d94a5fc507328449cfb066bbcd2d3da2d26d2bd/diff:/var/lib/docker/overlay2/33fec7b43c22926678461a9b352c8cafdc7ede8303cb3d90722e30c0f20731c2/diff:/var/lib/docker/overlay2/c91cbd2e7230cc22d9ac1e170ca724c478c4b708e0edc433dd035f4ff36d9957/diff",
"MergedDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/merged",
"UpperDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/diff",
"WorkDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/work"
},
"Name": "overlay2"
},
"Mounts": ,
"Config": {
"Hostname": "1d40fcc6c4c1",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HTTPD_PREFIX=/usr/local/apache2",
"HTTPD_VERSION=2.4.37",
"HTTPD_SHA256=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726",
"HTTPD_PATCHES=",
"APACHE_DIST_URLS=https://www.apache.org/dyn/closer.cgi?action=download&filename= thttps://www-us.apache.org/dist/ thttps://www.apache.org/dist/ thttps://archive.apache.org/dist/"
],
"Cmd": [
"httpd-foreground"
],
"ArgsEscaped": true,
"Image": "apache-rproxy-docker_apache2",
"Volumes": null,
"WorkingDir": "/usr/local/apache2",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "df3b431078c66f67a39bb27012c1d8237e21a65cac4c1a69a30db3f25f27d7d3",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "apache-rproxy-docker",
"com.docker.compose.service": "apache2",
"com.docker.compose.slug": "71f4a0b7076baa5b84ae33dda673173f29bb709e4904493b2b80847fa98f8e4",
"com.docker.compose.version": "1.23.1"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "d27a9df7fe5a9e75f5c3444f95565389cccde58f3791237c266430b1cced8d18",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/d27a9df7fe5a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"apache-rproxy-docker_spa_network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"apache2",
"1d40fcc6c4c1"
],
"NetworkID": "c2a24a5495f429efcff44ca247af058e29503a8e5659355cab7d0f3fe135f3b8",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]


I'm working on the docker for the first time. Any help would be really appreciated.



Thanks!










share|improve this question




















  • 1





    We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

    – mkasberg
    Nov 19 '18 at 19:38











  • @mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

    – phemanthkumar28
    Nov 19 '18 at 21:25


















0















I'm working on a use case to create a Docker container for an apache server for a CMS application.



Below is the folder structure for the docket container.



apache-rproxy-docker (folder)
-docker-compose.yml
- httpd (folder)
- Dockerfile
- httpd.conf


docker-compose.yml



version: '2.1'

services:
apache:
build: httpd/
ports:
- "80:80"
networks:
- my_network
restart: always

networks:
my_network:
driver: bridge


Dockerfile



FROM httpd:2.4
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf


httpd.conf



Listen 80

ServerName localhost:80
ServerAdmin admin@localhost

ErrorLog logs/error.log
LogLevel error

###
# Note that the following LoadModule lines only represent the minimum 'Web-Developer' Suite configuration.
#
# Also note that some of the following LoadModule lines, which are commented out, are still loaded under…
# confSuite-extra*.conf
# confextra*.conf
# …configuration files -- for modular reasons.
#
# For example:
# mod_deflate is loaded under confSuite-extramod_deflate_logio.conf and NOT under httpd.conf
# status_module is loaded under confextrahttpd-info.conf and NOT under httpd.conf
#
# Check last part of httpd.conf for the Apache base and 'Web-Developer' *.conf files that are included.
###

#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_default_module modules/mod_authn_default.so
#LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_default_module modules/mod_authz_default.so
#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule imagemap_module modules/mod_imagemap.so
#LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so


#CMS
<VirtualHost *:80>
ServerName cms.dev.local

ProxyPreserveHost On
#INCLUDE THE EXTRA PROXYPASS RULE FOR /site HERE
ProxyPass /site/ http://localhost:8080/site/
ProxyPass / http://localhost:8080/cms/
ProxyPassReverse / http://localhost:8080/cms/
ProxyPassReverseCookiePath /cms /
</VirtualHost>


I have a couple of issues which are holding me back,




  1. While I'm able to build the container with no issue, but when trying to up the container using "docker-compose up", the container starts and terminates instantaneously without any errors.

  2. I don't see the port mapping for the container, which is odd.


enter image description here



Below is the output on executing docker inspect container_id.



[
{
"Id": "1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86",
"Created": "2018-11-19T21:32:39.9551494Z",
"Path": "httpd-foreground",
"Args": ,
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 1,
"Error": "",
"StartedAt": "2018-11-19T21:32:40.7494723Z",
"FinishedAt": "2018-11-19T21:32:40.8537987Z"
},
"Image": "sha256:31f9d98b9ee458dbf1befb5e07c87c6ef959dcc2ef690fe523fd887b12f9dbf9",
"ResolvConfPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hostname",
"HostsPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hosts",
"LogPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86-json.log",
"Name": "/apache-rproxy-docker_apache2_1_71f4a0b7076b",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": ,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "apache-rproxy-docker_spa_network",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": ,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a-init/diff:/var/lib/docker/overlay2/84adfc08eb41b4f6ede14df10775b291c8195ade8b5d6351892e7c0f0606bc92/diff:/var/lib/docker/overlay2/5e42bbf563f3fbc5829685509b13f1d5536886a68ee5bd913bd4910dc9737478/diff:/var/lib/docker/overlay2/48ccff5d0d55c955e8e3e49b62c01865826dbfd01bd25206c411ae69f08bda4e/diff:/var/lib/docker/overlay2/fa24d9a31cc583d8a9583e659d94a5fc507328449cfb066bbcd2d3da2d26d2bd/diff:/var/lib/docker/overlay2/33fec7b43c22926678461a9b352c8cafdc7ede8303cb3d90722e30c0f20731c2/diff:/var/lib/docker/overlay2/c91cbd2e7230cc22d9ac1e170ca724c478c4b708e0edc433dd035f4ff36d9957/diff",
"MergedDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/merged",
"UpperDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/diff",
"WorkDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/work"
},
"Name": "overlay2"
},
"Mounts": ,
"Config": {
"Hostname": "1d40fcc6c4c1",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HTTPD_PREFIX=/usr/local/apache2",
"HTTPD_VERSION=2.4.37",
"HTTPD_SHA256=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726",
"HTTPD_PATCHES=",
"APACHE_DIST_URLS=https://www.apache.org/dyn/closer.cgi?action=download&filename= thttps://www-us.apache.org/dist/ thttps://www.apache.org/dist/ thttps://archive.apache.org/dist/"
],
"Cmd": [
"httpd-foreground"
],
"ArgsEscaped": true,
"Image": "apache-rproxy-docker_apache2",
"Volumes": null,
"WorkingDir": "/usr/local/apache2",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "df3b431078c66f67a39bb27012c1d8237e21a65cac4c1a69a30db3f25f27d7d3",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "apache-rproxy-docker",
"com.docker.compose.service": "apache2",
"com.docker.compose.slug": "71f4a0b7076baa5b84ae33dda673173f29bb709e4904493b2b80847fa98f8e4",
"com.docker.compose.version": "1.23.1"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "d27a9df7fe5a9e75f5c3444f95565389cccde58f3791237c266430b1cced8d18",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/d27a9df7fe5a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"apache-rproxy-docker_spa_network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"apache2",
"1d40fcc6c4c1"
],
"NetworkID": "c2a24a5495f429efcff44ca247af058e29503a8e5659355cab7d0f3fe135f3b8",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]


I'm working on the docker for the first time. Any help would be really appreciated.



Thanks!










share|improve this question




















  • 1





    We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

    – mkasberg
    Nov 19 '18 at 19:38











  • @mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

    – phemanthkumar28
    Nov 19 '18 at 21:25
















0












0








0








I'm working on a use case to create a Docker container for an apache server for a CMS application.



Below is the folder structure for the docket container.



apache-rproxy-docker (folder)
-docker-compose.yml
- httpd (folder)
- Dockerfile
- httpd.conf


docker-compose.yml



version: '2.1'

services:
apache:
build: httpd/
ports:
- "80:80"
networks:
- my_network
restart: always

networks:
my_network:
driver: bridge


Dockerfile



FROM httpd:2.4
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf


httpd.conf



Listen 80

ServerName localhost:80
ServerAdmin admin@localhost

ErrorLog logs/error.log
LogLevel error

###
# Note that the following LoadModule lines only represent the minimum 'Web-Developer' Suite configuration.
#
# Also note that some of the following LoadModule lines, which are commented out, are still loaded under…
# confSuite-extra*.conf
# confextra*.conf
# …configuration files -- for modular reasons.
#
# For example:
# mod_deflate is loaded under confSuite-extramod_deflate_logio.conf and NOT under httpd.conf
# status_module is loaded under confextrahttpd-info.conf and NOT under httpd.conf
#
# Check last part of httpd.conf for the Apache base and 'Web-Developer' *.conf files that are included.
###

#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_default_module modules/mod_authn_default.so
#LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_default_module modules/mod_authz_default.so
#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule imagemap_module modules/mod_imagemap.so
#LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so


#CMS
<VirtualHost *:80>
ServerName cms.dev.local

ProxyPreserveHost On
#INCLUDE THE EXTRA PROXYPASS RULE FOR /site HERE
ProxyPass /site/ http://localhost:8080/site/
ProxyPass / http://localhost:8080/cms/
ProxyPassReverse / http://localhost:8080/cms/
ProxyPassReverseCookiePath /cms /
</VirtualHost>


I have a couple of issues which are holding me back,




  1. While I'm able to build the container with no issue, but when trying to up the container using "docker-compose up", the container starts and terminates instantaneously without any errors.

  2. I don't see the port mapping for the container, which is odd.


enter image description here



Below is the output on executing docker inspect container_id.



[
{
"Id": "1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86",
"Created": "2018-11-19T21:32:39.9551494Z",
"Path": "httpd-foreground",
"Args": ,
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 1,
"Error": "",
"StartedAt": "2018-11-19T21:32:40.7494723Z",
"FinishedAt": "2018-11-19T21:32:40.8537987Z"
},
"Image": "sha256:31f9d98b9ee458dbf1befb5e07c87c6ef959dcc2ef690fe523fd887b12f9dbf9",
"ResolvConfPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hostname",
"HostsPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hosts",
"LogPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86-json.log",
"Name": "/apache-rproxy-docker_apache2_1_71f4a0b7076b",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": ,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "apache-rproxy-docker_spa_network",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": ,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a-init/diff:/var/lib/docker/overlay2/84adfc08eb41b4f6ede14df10775b291c8195ade8b5d6351892e7c0f0606bc92/diff:/var/lib/docker/overlay2/5e42bbf563f3fbc5829685509b13f1d5536886a68ee5bd913bd4910dc9737478/diff:/var/lib/docker/overlay2/48ccff5d0d55c955e8e3e49b62c01865826dbfd01bd25206c411ae69f08bda4e/diff:/var/lib/docker/overlay2/fa24d9a31cc583d8a9583e659d94a5fc507328449cfb066bbcd2d3da2d26d2bd/diff:/var/lib/docker/overlay2/33fec7b43c22926678461a9b352c8cafdc7ede8303cb3d90722e30c0f20731c2/diff:/var/lib/docker/overlay2/c91cbd2e7230cc22d9ac1e170ca724c478c4b708e0edc433dd035f4ff36d9957/diff",
"MergedDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/merged",
"UpperDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/diff",
"WorkDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/work"
},
"Name": "overlay2"
},
"Mounts": ,
"Config": {
"Hostname": "1d40fcc6c4c1",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HTTPD_PREFIX=/usr/local/apache2",
"HTTPD_VERSION=2.4.37",
"HTTPD_SHA256=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726",
"HTTPD_PATCHES=",
"APACHE_DIST_URLS=https://www.apache.org/dyn/closer.cgi?action=download&filename= thttps://www-us.apache.org/dist/ thttps://www.apache.org/dist/ thttps://archive.apache.org/dist/"
],
"Cmd": [
"httpd-foreground"
],
"ArgsEscaped": true,
"Image": "apache-rproxy-docker_apache2",
"Volumes": null,
"WorkingDir": "/usr/local/apache2",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "df3b431078c66f67a39bb27012c1d8237e21a65cac4c1a69a30db3f25f27d7d3",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "apache-rproxy-docker",
"com.docker.compose.service": "apache2",
"com.docker.compose.slug": "71f4a0b7076baa5b84ae33dda673173f29bb709e4904493b2b80847fa98f8e4",
"com.docker.compose.version": "1.23.1"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "d27a9df7fe5a9e75f5c3444f95565389cccde58f3791237c266430b1cced8d18",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/d27a9df7fe5a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"apache-rproxy-docker_spa_network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"apache2",
"1d40fcc6c4c1"
],
"NetworkID": "c2a24a5495f429efcff44ca247af058e29503a8e5659355cab7d0f3fe135f3b8",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]


I'm working on the docker for the first time. Any help would be really appreciated.



Thanks!










share|improve this question
















I'm working on a use case to create a Docker container for an apache server for a CMS application.



Below is the folder structure for the docket container.



apache-rproxy-docker (folder)
-docker-compose.yml
- httpd (folder)
- Dockerfile
- httpd.conf


docker-compose.yml



version: '2.1'

services:
apache:
build: httpd/
ports:
- "80:80"
networks:
- my_network
restart: always

networks:
my_network:
driver: bridge


Dockerfile



FROM httpd:2.4
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf


httpd.conf



Listen 80

ServerName localhost:80
ServerAdmin admin@localhost

ErrorLog logs/error.log
LogLevel error

###
# Note that the following LoadModule lines only represent the minimum 'Web-Developer' Suite configuration.
#
# Also note that some of the following LoadModule lines, which are commented out, are still loaded under…
# confSuite-extra*.conf
# confextra*.conf
# …configuration files -- for modular reasons.
#
# For example:
# mod_deflate is loaded under confSuite-extramod_deflate_logio.conf and NOT under httpd.conf
# status_module is loaded under confextrahttpd-info.conf and NOT under httpd.conf
#
# Check last part of httpd.conf for the Apache base and 'Web-Developer' *.conf files that are included.
###

#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_default_module modules/mod_authn_default.so
#LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_default_module modules/mod_authz_default.so
#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule imagemap_module modules/mod_imagemap.so
#LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so


#CMS
<VirtualHost *:80>
ServerName cms.dev.local

ProxyPreserveHost On
#INCLUDE THE EXTRA PROXYPASS RULE FOR /site HERE
ProxyPass /site/ http://localhost:8080/site/
ProxyPass / http://localhost:8080/cms/
ProxyPassReverse / http://localhost:8080/cms/
ProxyPassReverseCookiePath /cms /
</VirtualHost>


I have a couple of issues which are holding me back,




  1. While I'm able to build the container with no issue, but when trying to up the container using "docker-compose up", the container starts and terminates instantaneously without any errors.

  2. I don't see the port mapping for the container, which is odd.


enter image description here



Below is the output on executing docker inspect container_id.



[
{
"Id": "1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86",
"Created": "2018-11-19T21:32:39.9551494Z",
"Path": "httpd-foreground",
"Args": ,
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 1,
"Error": "",
"StartedAt": "2018-11-19T21:32:40.7494723Z",
"FinishedAt": "2018-11-19T21:32:40.8537987Z"
},
"Image": "sha256:31f9d98b9ee458dbf1befb5e07c87c6ef959dcc2ef690fe523fd887b12f9dbf9",
"ResolvConfPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hostname",
"HostsPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/hosts",
"LogPath": "/var/lib/docker/containers/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86/1d40fcc6c4c1383213386bbdfbed0434a4b86ebbfc79e18d450691d57f190c86-json.log",
"Name": "/apache-rproxy-docker_apache2_1_71f4a0b7076b",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": ,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "apache-rproxy-docker_spa_network",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": ,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a-init/diff:/var/lib/docker/overlay2/84adfc08eb41b4f6ede14df10775b291c8195ade8b5d6351892e7c0f0606bc92/diff:/var/lib/docker/overlay2/5e42bbf563f3fbc5829685509b13f1d5536886a68ee5bd913bd4910dc9737478/diff:/var/lib/docker/overlay2/48ccff5d0d55c955e8e3e49b62c01865826dbfd01bd25206c411ae69f08bda4e/diff:/var/lib/docker/overlay2/fa24d9a31cc583d8a9583e659d94a5fc507328449cfb066bbcd2d3da2d26d2bd/diff:/var/lib/docker/overlay2/33fec7b43c22926678461a9b352c8cafdc7ede8303cb3d90722e30c0f20731c2/diff:/var/lib/docker/overlay2/c91cbd2e7230cc22d9ac1e170ca724c478c4b708e0edc433dd035f4ff36d9957/diff",
"MergedDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/merged",
"UpperDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/diff",
"WorkDir": "/var/lib/docker/overlay2/4040cf05d15260b3de19e00df9ef8f05305e581372162d3d280603d1d741148a/work"
},
"Name": "overlay2"
},
"Mounts": ,
"Config": {
"Hostname": "1d40fcc6c4c1",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HTTPD_PREFIX=/usr/local/apache2",
"HTTPD_VERSION=2.4.37",
"HTTPD_SHA256=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726",
"HTTPD_PATCHES=",
"APACHE_DIST_URLS=https://www.apache.org/dyn/closer.cgi?action=download&filename= thttps://www-us.apache.org/dist/ thttps://www.apache.org/dist/ thttps://archive.apache.org/dist/"
],
"Cmd": [
"httpd-foreground"
],
"ArgsEscaped": true,
"Image": "apache-rproxy-docker_apache2",
"Volumes": null,
"WorkingDir": "/usr/local/apache2",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "df3b431078c66f67a39bb27012c1d8237e21a65cac4c1a69a30db3f25f27d7d3",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "apache-rproxy-docker",
"com.docker.compose.service": "apache2",
"com.docker.compose.slug": "71f4a0b7076baa5b84ae33dda673173f29bb709e4904493b2b80847fa98f8e4",
"com.docker.compose.version": "1.23.1"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "d27a9df7fe5a9e75f5c3444f95565389cccde58f3791237c266430b1cced8d18",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/d27a9df7fe5a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"apache-rproxy-docker_spa_network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"apache2",
"1d40fcc6c4c1"
],
"NetworkID": "c2a24a5495f429efcff44ca247af058e29503a8e5659355cab7d0f3fe135f3b8",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "",
"DriverOpts": null
}
}
}
}
]


I'm working on the docker for the first time. Any help would be really appreciated.



Thanks!







docker apache2.4 hippocms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 21:38







phemanthkumar28

















asked Nov 19 '18 at 18:45









phemanthkumar28phemanthkumar28

149114




149114








  • 1





    We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

    – mkasberg
    Nov 19 '18 at 19:38











  • @mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

    – phemanthkumar28
    Nov 19 '18 at 21:25
















  • 1





    We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

    – mkasberg
    Nov 19 '18 at 19:38











  • @mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

    – phemanthkumar28
    Nov 19 '18 at 21:25










1




1





We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

– mkasberg
Nov 19 '18 at 19:38





We need the logs from the Apache container. The most relevant part will be the end (where I assume it's exiting for some reason). It might be easier if you remove restart: always at least temporarily. You can get the logs with docker-compose logs, or from the terminal itself it it's not in daemon mode.

– mkasberg
Nov 19 '18 at 19:38













@mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

– phemanthkumar28
Nov 19 '18 at 21:25







@mkasberg - One running "docker-compose logs". I just got this statement - Attaching to apache-rproxy-docker_apache_1_71f4a0b7076b

– phemanthkumar28
Nov 19 '18 at 21:25














1 Answer
1






active

oldest

votes


















1














OK, I was able to reproduce your issue using the files you provided. It's weird that you're not getting more info in the logs. But here's how I debugged it:




  1. The fact that the status is restarting is bad - it means your container isn't staying up. I removed the restart: always line, but got the same result.


  2. Let's narrow down the problem some more. I built your Dockerfile and ran it by running the following commands in the httpd directory: docker build -t apache-rproxy:latest . && docker run --rm -p 80:80 apache-rproxy:latest. Unfortunately, I got the same error with no additional logs.


  3. Let's debug some more. Try the same command with the official httpd image: docker run --rm -p 80:80 httpd:2.4. Notice that this time, httpd starts and begins logging, and the container remains alive.



Now, the only difference between the httpd:2.4 image and the apache-rproxy:latest image is your config file. So you something in your httpd.conf is preventing apache from starting (or even logging anything). Work out what the problem is there and I think you'll have a working setup.






share|improve this answer
























  • Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

    – phemanthkumar28
    Nov 19 '18 at 23:21











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380867%2fapache-docket-container-not-starting-using-docker-compose-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














OK, I was able to reproduce your issue using the files you provided. It's weird that you're not getting more info in the logs. But here's how I debugged it:




  1. The fact that the status is restarting is bad - it means your container isn't staying up. I removed the restart: always line, but got the same result.


  2. Let's narrow down the problem some more. I built your Dockerfile and ran it by running the following commands in the httpd directory: docker build -t apache-rproxy:latest . && docker run --rm -p 80:80 apache-rproxy:latest. Unfortunately, I got the same error with no additional logs.


  3. Let's debug some more. Try the same command with the official httpd image: docker run --rm -p 80:80 httpd:2.4. Notice that this time, httpd starts and begins logging, and the container remains alive.



Now, the only difference between the httpd:2.4 image and the apache-rproxy:latest image is your config file. So you something in your httpd.conf is preventing apache from starting (or even logging anything). Work out what the problem is there and I think you'll have a working setup.






share|improve this answer
























  • Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

    – phemanthkumar28
    Nov 19 '18 at 23:21
















1














OK, I was able to reproduce your issue using the files you provided. It's weird that you're not getting more info in the logs. But here's how I debugged it:




  1. The fact that the status is restarting is bad - it means your container isn't staying up. I removed the restart: always line, but got the same result.


  2. Let's narrow down the problem some more. I built your Dockerfile and ran it by running the following commands in the httpd directory: docker build -t apache-rproxy:latest . && docker run --rm -p 80:80 apache-rproxy:latest. Unfortunately, I got the same error with no additional logs.


  3. Let's debug some more. Try the same command with the official httpd image: docker run --rm -p 80:80 httpd:2.4. Notice that this time, httpd starts and begins logging, and the container remains alive.



Now, the only difference between the httpd:2.4 image and the apache-rproxy:latest image is your config file. So you something in your httpd.conf is preventing apache from starting (or even logging anything). Work out what the problem is there and I think you'll have a working setup.






share|improve this answer
























  • Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

    – phemanthkumar28
    Nov 19 '18 at 23:21














1












1








1







OK, I was able to reproduce your issue using the files you provided. It's weird that you're not getting more info in the logs. But here's how I debugged it:




  1. The fact that the status is restarting is bad - it means your container isn't staying up. I removed the restart: always line, but got the same result.


  2. Let's narrow down the problem some more. I built your Dockerfile and ran it by running the following commands in the httpd directory: docker build -t apache-rproxy:latest . && docker run --rm -p 80:80 apache-rproxy:latest. Unfortunately, I got the same error with no additional logs.


  3. Let's debug some more. Try the same command with the official httpd image: docker run --rm -p 80:80 httpd:2.4. Notice that this time, httpd starts and begins logging, and the container remains alive.



Now, the only difference between the httpd:2.4 image and the apache-rproxy:latest image is your config file. So you something in your httpd.conf is preventing apache from starting (or even logging anything). Work out what the problem is there and I think you'll have a working setup.






share|improve this answer













OK, I was able to reproduce your issue using the files you provided. It's weird that you're not getting more info in the logs. But here's how I debugged it:




  1. The fact that the status is restarting is bad - it means your container isn't staying up. I removed the restart: always line, but got the same result.


  2. Let's narrow down the problem some more. I built your Dockerfile and ran it by running the following commands in the httpd directory: docker build -t apache-rproxy:latest . && docker run --rm -p 80:80 apache-rproxy:latest. Unfortunately, I got the same error with no additional logs.


  3. Let's debug some more. Try the same command with the official httpd image: docker run --rm -p 80:80 httpd:2.4. Notice that this time, httpd starts and begins logging, and the container remains alive.



Now, the only difference between the httpd:2.4 image and the apache-rproxy:latest image is your config file. So you something in your httpd.conf is preventing apache from starting (or even logging anything). Work out what the problem is there and I think you'll have a working setup.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 19 '18 at 22:00









mkasbergmkasberg

6,81622634




6,81622634













  • Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

    – phemanthkumar28
    Nov 19 '18 at 23:21



















  • Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

    – phemanthkumar28
    Nov 19 '18 at 23:21

















Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

– phemanthkumar28
Nov 19 '18 at 23:21





Thank you !! :-) I did try something similar, using the steps laid out in matthewsetter.com/basic-docker-compose-debugging. Even I came to the conclusion with the issue being the httpd.conf file.

– phemanthkumar28
Nov 19 '18 at 23:21




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380867%2fapache-docket-container-not-starting-using-docker-compose-up%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()