{"action":"created","issue":{"url":"https://api.github.com/repos/rectorphp/rector/issues/1181","repository_url":"https://api.github.com/repos/rectorphp/rector","labels_url":"https://api.github.com/repos/rectorphp/rector/issues/1181/labels{/name}","comments_url":"https://api.github.com/repos/rectorphp/rector/issues/1181/comments","events_url":"https://api.github.com/repos/rectorphp/rector/issues/1181/events","html_url":"https://github.com/rectorphp/rector/issues/1181","id":419249261,"node_id":"MDU6SXNzdWU0MTkyNDkyNjE=","number":1181,"title":"[Docker] Make image easier to configure","user":{"login":"azdanov","id":6123841,"node_id":"MDQ6VXNlcjYxMjM4NDE=","avatar_url":"https://avatars2.githubusercontent.com/u/6123841?v=4","gravatar_id":"","url":"https://api.github.com/users/azdanov","html_url":"https://github.com/azdanov","followers_url":"https://api.github.com/users/azdanov/followers","following_url":"https://api.github.com/users/azdanov/following{/other_user}","gists_url":"https://api.github.com/users/azdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/azdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azdanov/subscriptions","organizations_url":"https://api.github.com/users/azdanov/orgs","repos_url":"https://api.github.com/users/azdanov/repos","events_url":"https://api.github.com/users/azdanov/events{/privacy}","received_events_url":"https://api.github.com/users/azdanov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"JanMikes","id":3995003,"node_id":"MDQ6VXNlcjM5OTUwMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/3995003?v=4","gravatar_id":"","url":"https://api.github.com/users/JanMikes","html_url":"https://github.com/JanMikes","followers_url":"https://api.github.com/users/JanMikes/followers","following_url":"https://api.github.com/users/JanMikes/following{/other_user}","gists_url":"https://api.github.com/users/JanMikes/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMikes/subscriptions","organizations_url":"https://api.github.com/users/JanMikes/orgs","repos_url":"https://api.github.com/users/JanMikes/repos","events_url":"https://api.github.com/users/JanMikes/events{/privacy}","received_events_url":"https://api.github.com/users/JanMikes/received_events","type":"User","site_admin":false},"assignees":[{"login":"JanMikes","id":3995003,"node_id":"MDQ6VXNlcjM5OTUwMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/3995003?v=4","gravatar_id":"","url":"https://api.github.com/users/JanMikes","html_url":"https://github.com/JanMikes","followers_url":"https://api.github.com/users/JanMikes/followers","following_url":"https://api.github.com/users/JanMikes/following{/other_user}","gists_url":"https://api.github.com/users/JanMikes/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMikes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMikes/subscriptions","organizations_url":"https://api.github.com/users/JanMikes/orgs","repos_url":"https://api.github.com/users/JanMikes/repos","events_url":"https://api.github.com/users/JanMikes/events{/privacy}","received_events_url":"https://api.github.com/users/JanMikes/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2019-03-10T23:52:17Z","updated_at":"2019-03-11T09:48:12Z","closed_at":null,"author_association":"COLLABORATOR","body":"Right now I couldn't find a way to add `--level` or any other flag when using `docker run -v $(pwd):/project rector/rector:latest`. It only works with a `rector.yaml` file.\r\n\r\nBy changing Dockerfile it's possible to use `docker run -t rector process . --level symfony40 --dry-run`.\r\n\r\n```dockerfile\r\nFROM composer:latest AS composer\r\n\r\nCOPY ./composer.json /app\r\n\r\nRUN composer install --no-dev\r\n\r\n\r\nFROM php:7.1-cli\r\n\r\nWORKDIR /rector\r\n\r\nCOPY . /rector\r\nCOPY --from=composer /app .\r\n\r\nENTRYPOINT [ \"bin/rector\" ]\r\n# CMD [\"bin/rector\", \"process\", \"/project\", \"--dry-run\", \"--config\", \"/project/rector.yaml\"]\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/rectorphp/rector/issues/comments/471471699","html_url":"https://github.com/rectorphp/rector/issues/1181#issuecomment-471471699","issue_url":"https://api.github.com/repos/rectorphp/rector/issues/1181","id":471471699,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MTQ3MTY5OQ==","user":{"login":"azdanov","id":6123841,"node_id":"MDQ6VXNlcjYxMjM4NDE=","avatar_url":"https://avatars2.githubusercontent.com/u/6123841?v=4","gravatar_id":"","url":"https://api.github.com/users/azdanov","html_url":"https://github.com/azdanov","followers_url":"https://api.github.com/users/azdanov/followers","following_url":"https://api.github.com/users/azdanov/following{/other_user}","gists_url":"https://api.github.com/users/azdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/azdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azdanov/subscriptions","organizations_url":"https://api.github.com/users/azdanov/orgs","repos_url":"https://api.github.com/users/azdanov/repos","events_url":"https://api.github.com/users/azdanov/events{/privacy}","received_events_url":"https://api.github.com/users/azdanov/received_events","type":"User","site_admin":false},"created_at":"2019-03-11T09:48:12Z","updated_at":"2019-03-11T09:48:12Z","author_association":"COLLABORATOR","body":"Ah, thanks for the feedback. Didn't know that CMD could be overridden after specified in the Dockerfile.\r\n\r\nHere's a new version as you suggested. The size is definetely smaller.\r\n\r\n```\r\nrector/rector:alpine 131MB\r\nrector/rector:latest 386MB\r\n```\r\n\r\n```dockerfile\r\nFROM composer:latest AS composer\r\n\r\nCOPY composer.json composer.json\r\nCOPY composer.lock composer.lock\r\n\r\nRUN composer global require hirak/prestissimo && \\\r\n  composer install --prefer-dist --no-scripts --no-dev --no-autoloader && \\\r\n  rm -rf /root/.composer\r\n\r\nFROM php:7.1-cli-alpine\r\n\r\nCOPY --from=composer /app .\r\n\r\nWORKDIR /rector\r\n\r\nCOPY . /rector\r\n\r\nENTRYPOINT [ \"bin/rector\" ]\r\n```\r\n\r\nWould you like a PR?"}}
{"actor":{"display_login":"azdanov"}}