{"action":"created","issue":{"url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/290","repository_url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin","labels_url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/290/comments","events_url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/290/events","html_url":"https://github.com/bmuschko/gradle-docker-plugin/issues/290","id":182600690,"number":290,"title":"Add commands to build using docker-java-application","user":{"login":"wwadge","id":152416,"avatar_url":"https://avatars.githubusercontent.com/u/152416?v=3","gravatar_id":"","url":"https://api.github.com/users/wwadge","html_url":"https://github.com/wwadge","followers_url":"https://api.github.com/users/wwadge/followers","following_url":"https://api.github.com/users/wwadge/following{/other_user}","gists_url":"https://api.github.com/users/wwadge/gists{/gist_id}","starred_url":"https://api.github.com/users/wwadge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwadge/subscriptions","organizations_url":"https://api.github.com/users/wwadge/orgs","repos_url":"https://api.github.com/users/wwadge/repos","events_url":"https://api.github.com/users/wwadge/events{/privacy}","received_events_url":"https://api.github.com/users/wwadge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false},"assignees":[{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-12T18:36:50Z","updated_at":"2016-10-12T19:53:39Z","closed_at":null,"body":"I want to use java:8-jre-alpine as a base image which does not contain bash and thus causes spring boot applications to fail to load. I need to add a line in the generated build file: \r\n\r\n```apk update && apk add bash```\r\n\r\nbut there doesn't seem to be a way to do this via the docker-java-application plugin.\r\n\r\nCan you support adding arbitary commands eg: runCommand(...) to be appended to the generated build files?"},"comment":{"url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/comments/253319801","html_url":"https://github.com/bmuschko/gradle-docker-plugin/issues/290#issuecomment-253319801","issue_url":"https://api.github.com/repos/bmuschko/gradle-docker-plugin/issues/290","id":253319801,"user":{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T19:53:39Z","updated_at":"2016-10-12T19:53:39Z","body":"@wwadge `docker-java-application` is a _is a highly opinonated plugin_ so it supports certain workflow. However to solve your problem you can use just Gradle features.\r\n\r\n`docker-java-application` adds task `dockerDistTar` of type [Dockerfile](https://github.com/bmuschko/gradle-docker-plugin/blob/master/src/main/groovy/com/bmuschko/gradle/docker/tasks/image/Dockerfile.groovy). You can find it in the task graph and then add instructions you need - use [instruction()](https://github.com/bmuschko/gradle-docker-plugin/blob/master/src/main/groovy/com/bmuschko/gradle/docker/tasks/image/Dockerfile.groovy#L67) method. Eg.:\r\n\r\n````groovy\r\ntasks.whenTaskAdded { task ->\r\n    if(task instanceof Dockerfile) {\r\n        task.instruction('RUN apk update && apk add bash')\r\n    }\r\n}\r\n````\r\n\r\nPlease note that I didn't test this :-)"}}
{"actor":{"display_login":"orzeh"}}