{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/compose/issues/1168","labels_url":"https://api.github.com/repos/docker/compose/issues/1168/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/1168/comments","events_url":"https://api.github.com/repos/docker/compose/issues/1168/events","html_url":"https://github.com/docker/compose/issues/1168","id":64047478,"number":1168,"title":"compose run with commit option","user":{"login":"madwire","id":99309,"avatar_url":"https://avatars.githubusercontent.com/u/99309?v=3","gravatar_id":"","url":"https://api.github.com/users/madwire","html_url":"https://github.com/madwire","followers_url":"https://api.github.com/users/madwire/followers","following_url":"https://api.github.com/users/madwire/following{/other_user}","gists_url":"https://api.github.com/users/madwire/gists{/gist_id}","starred_url":"https://api.github.com/users/madwire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madwire/subscriptions","organizations_url":"https://api.github.com/users/madwire/orgs","repos_url":"https://api.github.com/users/madwire/repos","events_url":"https://api.github.com/users/madwire/events{/privacy}","received_events_url":"https://api.github.com/users/madwire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-24T17:00:13Z","updated_at":"2015-03-24T17:00:13Z","closed_at":null,"body":"It would be great if compose had a commit option on the run command, this will help to improve productivity with various package manages. For example if Im building a rails app and I would like to change/update a dependancy. I would have to rebuild the docker image every time which can take some time. If after the run command it could commit the changes made to the docker image then it would save a load of time.\r\n\r\nSomething like this? `docker-compose run -c web bundle update`\r\n\r\nI have build a basic shell script which I currently use which is great, but it would be better if its built in.\r\n\r\n```shell\r\n#!/bin/bash\r\n\r\ndir=${PWD##*/} # Get current directory name \r\nimage_base=${dir//_/} # remove underscores\r\nservice_name=$1 # Service name\r\ndocker_image_name=$image_base'_'$service_name # build docker compose image name\r\n\r\ndocker-compose run $service_name $2 $3 $4 $5 $6 # pass args to service\r\nrun_container=$(docker ps -l -q) #get the last run container id\r\ndocker commit $run_container $docker_image_name #commit the image changes\r\ndocker rm $run_container # remove the run container\r\n```\r\nHow I use the script is like this `docker-compose-commit web bundle update`"}}