{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/buildah/pulls/comments/196793291","pull_request_review_id":130412565,"id":196793291,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Njc5MzI5MQ==","diff_hunk":"@@ -0,0 +1,103 @@\n+![buildah logo](../../logos/buildah-logo_large.png)\n+\n+# Buildah Tutorial 3 \n+## Using ONBUILD in Buildah \n+\n+The purpose of this tutorial is to demonstrate how Buildah can use a Dockerfile with the OnBuild command within it or how it can be used with the `buildah config` command.  The ONBUILD command stores a command in the meta data of the image which is then invoked whn the container is created.\n+\n+A note about this container images compliant with the [Open Container Initiative](https://www.opencontainers.org/) (OCI) [image specification](https://github.com/opencontainers/image-spec) do not support the ONBUILD instruction.  Therefore only containers that use the Docker format can use this technique.  Buildah is capable of working seamlessly with either OCI or Docker compliant images and containers. \n+\n+First step is to install Buildah and optionally Podman.  In short, `buildah run` emulates the RUN command that is found in a Dockerfile while the `podman run` command emulates the `docker run` command. \n+\n+## Setup\n+\n+The following assumes installation on Fedora.\n+ \n+Run as root because you will need to be root for running Buildah commands:\n+\n+    $ sudo -s\n+\n+Then install Buildah and optionally podman by running:\n+\n+    # dnf -y install buildah podman\n+\n+After installing Buildah we can see there are no images installed. The `buildah images` command will list all the images:\n+\n+    # buildah images\n+\n+We can also see that there are also no containers by running:\n+\n+    # buildah containers\n+  \n+## ONBUILD in a Dockerfile\n+\n+The following example is thanks to Chris Collins (GitHub @clcollins), the idea is a directory `/bar` will be created in the secondary container only.\n+\n+First create two Dockerfiles:\n+\n+```\n+$ cat << EOF > Dockerfile\n+FROM fedora:28","path":"docs/tutorials/03-on-build.md","position":40,"original_position":40,"commit_id":"77497a35aba2dca872a3614d8d29beac7a2fa0ae","original_commit_id":"77497a35aba2dca872a3614d8d29beac7a2fa0ae","user":{"login":"TomSweeneyRedHat","id":25613829,"node_id":"MDQ6VXNlcjI1NjEzODI5","avatar_url":"https://avatars3.githubusercontent.com/u/25613829?v=4","gravatar_id":"","url":"https://api.github.com/users/TomSweeneyRedHat","html_url":"https://github.com/TomSweeneyRedHat","followers_url":"https://api.github.com/users/TomSweeneyRedHat/followers","following_url":"https://api.github.com/users/TomSweeneyRedHat/following{/other_user}","gists_url":"https://api.github.com/users/TomSweeneyRedHat/gists{/gist_id}","starred_url":"https://api.github.com/users/TomSweeneyRedHat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomSweeneyRedHat/subscriptions","organizations_url":"https://api.github.com/users/TomSweeneyRedHat/orgs","repos_url":"https://api.github.com/users/TomSweeneyRedHat/repos","events_url":"https://api.github.com/users/TomSweeneyRedHat/events{/privacy}","received_events_url":"https://api.github.com/users/TomSweeneyRedHat/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2018-06-20T14:08:24Z","updated_at":"2018-06-20T14:08:25Z","html_url":"https://github.com/projectatomic/buildah/pull/808#discussion_r196793291","pull_request_url":"https://api.github.com/repos/projectatomic/buildah/pulls/808","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/comments/196793291"},"html":{"href":"https://github.com/projectatomic/buildah/pull/808#discussion_r196793291"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/808"}},"in_reply_to_id":196748742},"pull_request":{"url":"https://api.github.com/repos/projectatomic/buildah/pulls/808","id":195986532,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1OTg2NTMy","html_url":"https://github.com/projectatomic/buildah/pull/808","diff_url":"https://github.com/projectatomic/buildah/pull/808.diff","patch_url":"https://github.com/projectatomic/buildah/pull/808.patch","issue_url":"https://api.github.com/repos/projectatomic/buildah/issues/808","number":808,"state":"open","locked":false,"title":"WIP - ONBUILD tutorial","user":{"login":"TomSweeneyRedHat","id":25613829,"node_id":"MDQ6VXNlcjI1NjEzODI5","avatar_url":"https://avatars3.githubusercontent.com/u/25613829?v=4","gravatar_id":"","url":"https://api.github.com/users/TomSweeneyRedHat","html_url":"https://github.com/TomSweeneyRedHat","followers_url":"https://api.github.com/users/TomSweeneyRedHat/followers","following_url":"https://api.github.com/users/TomSweeneyRedHat/following{/other_user}","gists_url":"https://api.github.com/users/TomSweeneyRedHat/gists{/gist_id}","starred_url":"https://api.github.com/users/TomSweeneyRedHat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomSweeneyRedHat/subscriptions","organizations_url":"https://api.github.com/users/TomSweeneyRedHat/orgs","repos_url":"https://api.github.com/users/TomSweeneyRedHat/repos","events_url":"https://api.github.com/users/TomSweeneyRedHat/events{/privacy}","received_events_url":"https://api.github.com/users/TomSweeneyRedHat/received_events","type":"User","site_admin":false},"body":"Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>\r\n\r\nA new tutorial explaining the user of the ONBUILD instruction in a Dockerfile as it pertains to Buildah and how to set it via `buildah config`.  I'm planning to add a second example, but thought I'd get this out for an initial review.\r\n\r\nI'll convert this to a blog in the Project Atomic site once complete and will add ascinema to it.\r\n\r\nFYI @clcollins","created_at":"2018-06-19T23:38:28Z","updated_at":"2018-06-20T14:08:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93bae4a793fce834ec2e5afef5291aee4d2dc33a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/buildah/pulls/808/commits","review_comments_url":"https://api.github.com/repos/projectatomic/buildah/pulls/808/comments","review_comment_url":"https://api.github.com/repos/projectatomic/buildah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/buildah/issues/808/comments","statuses_url":"https://api.github.com/repos/projectatomic/buildah/statuses/77497a35aba2dca872a3614d8d29beac7a2fa0ae","head":{"label":"TomSweeneyRedHat:dev/tsweeney/onbuildtut","ref":"dev/tsweeney/onbuildtut","sha":"77497a35aba2dca872a3614d8d29beac7a2fa0ae","user":{"login":"TomSweeneyRedHat","id":25613829,"node_id":"MDQ6VXNlcjI1NjEzODI5","avatar_url":"https://avatars3.githubusercontent.com/u/25613829?v=4","gravatar_id":"","url":"https://api.github.com/users/TomSweeneyRedHat","html_url":"https://github.com/TomSweeneyRedHat","followers_url":"https://api.github.com/users/TomSweeneyRedHat/followers","following_url":"https://api.github.com/users/TomSweeneyRedHat/following{/other_user}","gists_url":"https://api.github.com/users/TomSweeneyRedHat/gists{/gist_id}","starred_url":"https://api.github.com/users/TomSweeneyRedHat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomSweeneyRedHat/subscriptions","organizations_url":"https://api.github.com/users/TomSweeneyRedHat/orgs","repos_url":"https://api.github.com/users/TomSweeneyRedHat/repos","events_url":"https://api.github.com/users/TomSweeneyRedHat/events{/privacy}","received_events_url":"https://api.github.com/users/TomSweeneyRedHat/received_events","type":"User","site_admin":false},"repo":{"id":85838433,"node_id":"MDEwOlJlcG9zaXRvcnk4NTgzODQzMw==","name":"buildah","full_name":"TomSweeneyRedHat/buildah","owner":{"login":"TomSweeneyRedHat","id":25613829,"node_id":"MDQ6VXNlcjI1NjEzODI5","avatar_url":"https://avatars3.githubusercontent.com/u/25613829?v=4","gravatar_id":"","url":"https://api.github.com/users/TomSweeneyRedHat","html_url":"https://github.com/TomSweeneyRedHat","followers_url":"https://api.github.com/users/TomSweeneyRedHat/followers","following_url":"https://api.github.com/users/TomSweeneyRedHat/following{/other_user}","gists_url":"https://api.github.com/users/TomSweeneyRedHat/gists{/gist_id}","starred_url":"https://api.github.com/users/TomSweeneyRedHat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomSweeneyRedHat/subscriptions","organizations_url":"https://api.github.com/users/TomSweeneyRedHat/orgs","repos_url":"https://api.github.com/users/TomSweeneyRedHat/repos","events_url":"https://api.github.com/users/TomSweeneyRedHat/events{/privacy}","received_events_url":"https://api.github.com/users/TomSweeneyRedHat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomSweeneyRedHat/buildah","description":"A tool which facilitates building OCI images","fork":true,"url":"https://api.github.com/repos/TomSweeneyRedHat/buildah","forks_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/forks","keys_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/teams","hooks_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/hooks","issue_events_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/issues/events{/number}","events_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/events","assignees_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/assignees{/user}","branches_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/branches{/branch}","tags_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/tags","blobs_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/statuses/{sha}","languages_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/languages","stargazers_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/stargazers","contributors_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/contributors","subscribers_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/subscribers","subscription_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/subscription","commits_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/issues/comments{/number}","contents_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/contents/{+path}","compare_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/merges","archive_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/downloads","issues_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/issues{/number}","pulls_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/pulls{/number}","milestones_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/milestones{/number}","notifications_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/labels{/name}","releases_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/releases{/id}","deployments_url":"https://api.github.com/repos/TomSweeneyRedHat/buildah/deployments","created_at":"2017-03-22T14:34:57Z","updated_at":"2018-06-19T14:43:33Z","pushed_at":"2018-06-19T23:33:48Z","git_url":"git://github.com/TomSweeneyRedHat/buildah.git","ssh_url":"git@github.com:TomSweeneyRedHat/buildah.git","clone_url":"https://github.com/TomSweeneyRedHat/buildah.git","svn_url":"https://github.com/TomSweeneyRedHat/buildah","homepage":"","size":10860,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"projectatomic:master","ref":"master","sha":"da7be327375a75d33b58df1ac979da051a94b39e","user":{"login":"projectatomic","id":6852258,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NTIyNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/6852258?v=4","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":80134675,"node_id":"MDEwOlJlcG9zaXRvcnk4MDEzNDY3NQ==","name":"buildah","full_name":"projectatomic/buildah","owner":{"login":"projectatomic","id":6852258,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NTIyNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/6852258?v=4","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/buildah","description":"A tool that facilitates building OCI images","fork":false,"url":"https://api.github.com/repos/projectatomic/buildah","forks_url":"https://api.github.com/repos/projectatomic/buildah/forks","keys_url":"https://api.github.com/repos/projectatomic/buildah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/buildah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/buildah/teams","hooks_url":"https://api.github.com/repos/projectatomic/buildah/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/buildah/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/buildah/events","assignees_url":"https://api.github.com/repos/projectatomic/buildah/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/buildah/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/buildah/tags","blobs_url":"https://api.github.com/repos/projectatomic/buildah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/buildah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/buildah/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/buildah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/buildah/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/buildah/languages","stargazers_url":"https://api.github.com/repos/projectatomic/buildah/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/buildah/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/buildah/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/buildah/subscription","commits_url":"https://api.github.com/repos/projectatomic/buildah/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/buildah/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/buildah/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/buildah/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/buildah/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/buildah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/buildah/merges","archive_url":"https://api.github.com/repos/projectatomic/buildah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/buildah/downloads","issues_url":"https://api.github.com/repos/projectatomic/buildah/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/buildah/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/buildah/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/buildah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/buildah/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/buildah/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/buildah/deployments","created_at":"2017-01-26T16:59:13Z","updated_at":"2018-06-20T13:14:17Z","pushed_at":"2018-06-20T13:14:13Z","git_url":"git://github.com/projectatomic/buildah.git","ssh_url":"git@github.com:projectatomic/buildah.git","clone_url":"https://github.com/projectatomic/buildah.git","svn_url":"https://github.com/projectatomic/buildah","homepage":"","size":16068,"stargazers_count":751,"watchers_count":751,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":91,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":91,"open_issues":38,"watchers":751,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/808"},"html":{"href":"https://github.com/projectatomic/buildah/pull/808"},"issue":{"href":"https://api.github.com/repos/projectatomic/buildah/issues/808"},"comments":{"href":"https://api.github.com/repos/projectatomic/buildah/issues/808/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/808/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/buildah/pulls/808/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/buildah/statuses/77497a35aba2dca872a3614d8d29beac7a2fa0ae"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"TomSweeneyRedHat"}}