brooklyncentral / clocker

Apache Brooklyn cloud native infrastructure blueprints
Apache License 2.0
426 stars 66 forks source link

Entrypoint being ignored when starting container #276

Closed johnmccabe closed 8 years ago

johnmccabe commented 8 years ago

Deploying a hub image such as mariadb or wordpress sees the container being started with the ENTRYPOINT being skipped (resulting in the failure of the container where it contains essential steps). Also note that docker ps reports the command as the last CMD in the Dockerfile when deployed via Clocker rather than the ENTRYPOINT when deployed via the docker cli.

For example, starting mariadb from the command line I see the following:

bc0794fc9cb6        mariadb                  "/docker-entrypoint.s"   18 seconds ago      Up 17 seconds       3306/tcp                 my_mariadb

But starting the same container via clocker I see the following (skipping the entrypoint resulting in its failing):

9d05a9d845bc        4898c21213910b7c92f584e44f5f23a02317fa4fd0e0eb3977d5a89a9210e52a   "mysqld"                 19 minutes ago      Exited (1) 19 minutes ago          db_yw6zpdzw

I notice the same behaviour for both Wordpress and MariaDB. See, mariadb Dockerfile, wordpress Dockerfile

Note The container shows as running in the console, but dead via docker ps.

Example yaml:

location: dc
services:
- type: docker:mariadb:5.5
  env:
    MYSQL_ROOT_PASSWORD: "marmalad3"
  openPorts:
  - 3456
johnmccabe commented 8 years ago

Compared the output from inspect between the docker cli and clocker deployed image:

3,8c3,6
<     "Id": "f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3",
<     "Created": "2016-04-14T11:10:07.43469464Z",
<     "Path": "/docker-entrypoint.sh",
<     "Args": [
<         "mysqld"
<     ],
---
>     "Id": "7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033",
>     "Created": "2016-04-14T12:38:47.486323884Z",
>     "Path": "mysqld",
>     "Args": [],
18,19c16,17
<         "StartedAt": "2016-04-14T11:10:07.537381588Z",
<         "FinishedAt": "2016-04-14T11:10:07.628735917Z"
---
>         "StartedAt": "2016-04-14T12:38:47.908757131Z",
>         "FinishedAt": "2016-04-14T12:38:48.204781306Z"
42,46c40,44
<     "ResolvConfPath": "/var/lib/docker/containers/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/resolv.conf",
<     "HostnamePath": "/var/lib/docker/containers/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/hostname",
<     "HostsPath": "/var/lib/docker/containers/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/hosts",
<     "LogPath": "/var/lib/docker/containers/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3-json.log",
<     "Name": "/happy_bartik",
---
>     "ResolvConfPath": "/var/lib/docker/containers/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/resolv.conf",
>     "HostnamePath": "/var/lib/docker/containers/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/hostname",
>     "HostsPath": "/var/lib/docker/containers/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/hosts",
>     "LogPath": "/var/lib/docker/containers/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033-json.log",
>     "Name": "/container-0f",
67,68c65,66
<         "MemorySwappiness": -1,
<         "Privileged": false,
---
>         "MemorySwappiness": null,
>         "Privileged": true,
71c69
<         "PublishAllPorts": false,
---
>         "PublishAllPorts": true,
76c74
<         "Devices": [],
---
>         "Devices": null,
85c83
<             "Name": "no",
---
>             "Name": "",
105,107c103,105
<             "MergedDir": "/var/lib/docker/overlay/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/merged",
<             "UpperDir": "/var/lib/docker/overlay/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/upper",
<             "WorkDir": "/var/lib/docker/overlay/f140a2e48cf2fe3dde57833e02562eb249ec4412a1536c22a65f70127e89fdf3/work"
---
>             "MergedDir": "/var/lib/docker/overlay/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/merged",
>             "UpperDir": "/var/lib/docker/overlay/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/upper",
>             "WorkDir": "/var/lib/docker/overlay/7b5b657fe59fd5e913c8f988d2ac7621abee103506eb4bce0460053c325b8033/work"
112,113c110,111
<             "Name": "144f3a460a9a0e116fbaf125a4f858ed8b8509526cab97a367f64ec12c8cdff9",
<             "Source": "/var/lib/docker/volumes/144f3a460a9a0e116fbaf125a4f858ed8b8509526cab97a367f64ec12c8cdff9/_data",
---
>             "Name": "1f33811fc024b8990b5873c9433fe3465bca4c6146481502b25a2a0e6710c304",
>             "Source": "/var/lib/docker/volumes/1f33811fc024b8990b5873c9433fe3465bca4c6146481502b25a2a0e6710c304/_data",
121c119
<         "Hostname": "f140a2e48cf2",
---
>         "Hostname": "container-0f",
125,126c123,124
<         "AttachStdout": true,
<         "AttachStderr": true,
---
>         "AttachStdout": false,
>         "AttachStderr": false,
128c126,128
<             "3306/tcp": {}
---
>             "22/tcp": {},
>             "3306/tcp": {},
>             "3456/tcp": {}
134a135
>             "MYSQL_ROOT_PASSWORD=helooooooo",
142c143
<         "Image": "mariadb:5.5",
---
>         "Image": "4898c21213910b7c92f584e44f5f23a02317fa4fd0e0eb3977d5a89a9210e52a",
148,150c149
<         "Entrypoint": [
<             "/docker-entrypoint.sh"
<         ],
---
>         "Entrypoint": [],
154c153
<         "Labels": {}
---
>         "Labels": null
grkvlt commented 8 years ago

Fixed in #272 by https://github.com/jclouds/jclouds-labs/pull/260 and https://github.com/jclouds/jclouds-labs/pull/261

johnmccabe commented 8 years ago

Thanks @grkvlt looks good.