New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added file tutorials/01-intro.md #302

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@ipbabble
Contributor

ipbabble commented Oct 29, 2017

Added a basic introduction to buildah tutorial

Topics covered:
buildah from a base
briefly describes containers/storage and containers/image
buildah run
buildah from scratch
installing packages and files to a scratch image
buildah push and running a buildah built container in docker
buildah bud

@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 29, 2017

Contributor

I'm not sure what to do. I noticed that I had placed the DCO in such a place that it got moved to the PR name. I went back and did a git amend on the commit comments and made sure the DCO was in the body of the comment. I did a push force and it still fails on the DCO? Any tips?

Contributor

ipbabble commented Oct 29, 2017

I'm not sure what to do. I noticed that I had placed the DCO in such a place that it got moved to the PR name. I went back and did a git amend on the commit comments and made sure the DCO was in the body of the comment. I did a push force and it still fails on the DCO? Any tips?

@TomSweeneyRedHat

This comment has been minimized.

Show comment
Hide comment
@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

Did you do a 'git commit --amend -s' and then do the git push? As long as your ~/.gitconfig has your name/email values in it, the signature should come for free.

Collaborator

TomSweeneyRedHat commented Oct 30, 2017

Did you do a 'git commit --amend -s' and then do the git push? As long as your ~/.gitconfig has your name/email values in it, the signature should come for free.

@nalind

This comment has been minimized.

Show comment
Hide comment
@nalind

nalind Oct 30, 2017

Collaborator

The (github: ipbabble) at the end of the Signed-off-by: line prevents it from being recognized by the regular expression used by the DCO check (^Signed-off-by: ([^<]+) <([^<>@]+@[^<>]+)>$).

Collaborator

nalind commented Oct 30, 2017

The (github: ipbabble) at the end of the Signed-off-by: line prevents it from being recognized by the regular expression used by the DCO check (^Signed-off-by: ([^<]+) <([^<>@]+@[^<>]+)>$).

@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 30, 2017

Contributor
Contributor

ipbabble commented Oct 30, 2017

@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 30, 2017

Contributor
Contributor

ipbabble commented Oct 30, 2017

@ipbabble ipbabble changed the title from Signed-off-by: William Henry <whenry@redhat.com> (github: ipbabble) to Added file tutorials/01-intro.md Oct 30, 2017

@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 30, 2017

Contributor

This build seems to be failing for some other reasons. IS the build broken?

Contributor

ipbabble commented Oct 30, 2017

This build seems to be failing for some other reasons. IS the build broken?

@rhatdan

This comment has been minimized.

Show comment
Hide comment
@rhatdan

rhatdan Oct 30, 2017

Member

bot retest

Member

rhatdan commented Oct 30, 2017

bot retest

@rhatdan

This comment has been minimized.

Show comment
Hide comment
@rhatdan
Member

rhatdan commented Oct 30, 2017

@rh-atomic-bot

This comment has been minimized.

Show comment
Hide comment
@rh-atomic-bot

rh-atomic-bot Oct 30, 2017

Collaborator

⌛️ Testing commit 1ac85ef with merge 686b8e4...

Collaborator

rh-atomic-bot commented Oct 30, 2017

⌛️ Testing commit 1ac85ef with merge 686b8e4...

rh-atomic-bot added a commit that referenced this pull request Oct 30, 2017

Added file tutorials/01-intro.md
Signed-off-by: William Henry <whenry@redhat.com>

A basic introduction to buildah tutorial

Topics covered:
buildah from a base
briefly describes containers/storage and containers/image
buildah run
buildah from scratch
installing packages and files to a scratch image
buildah push and running a buildah built container in docker
buildah bud

Signed-off-by: William Henry <whenry@redhat.com>

Closes: #302
Approved by: rhatdan
@TomSweeneyRedHat

This comment has been minimized.

Show comment
Hide comment
@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

This is failing in the rpm-build, looks to be the same issue as we're seeing in the logo PR #299. I don't believe it's an issue with this submit, but something funky in the build space.

#   Running scriptlet: glibc-2.25-10.fc26.x86_64                            93/93BDB1539 Build signature doesn't match environment
# go-compilers-golang-compiler-1-11.fc26.x86_64 was supposed to be installed but is not!
Collaborator

TomSweeneyRedHat commented Oct 30, 2017

This is failing in the rpm-build, looks to be the same issue as we're seeing in the logo PR #299. I don't believe it's an issue with this submit, but something funky in the build space.

#   Running scriptlet: glibc-2.25-10.fc26.x86_64                            93/93BDB1539 Build signature doesn't match environment
# go-compilers-golang-compiler-1-11.fc26.x86_64 was supposed to be installed but is not!
@rh-atomic-bot

This comment has been minimized.

Show comment
Hide comment
@rh-atomic-bot

rh-atomic-bot Oct 30, 2017

Collaborator

💔 Test failed - status-papr

Collaborator

rh-atomic-bot commented Oct 30, 2017

💔 Test failed - status-papr

@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 30, 2017

Contributor

@TomSweeneyRedHat Yeah I noticed that and thought it was probably the same as #299. Because when you were telling me to look at 299 I was thinking "but that failed". I see this is failing in the Red Hat CI and not Travis CI. So some sort of access to some build rpms (?)

Contributor

ipbabble commented Oct 30, 2017

@TomSweeneyRedHat Yeah I noticed that and thought it was probably the same as #299. Because when you were telling me to look at 299 I was thinking "but that failed". I see this is failing in the Red Hat CI and not Travis CI. So some sort of access to some build rpms (?)

Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
# Run the httpd
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
Now run `buildah bud` with the name of the Dockerfile and the image name (fedora-httpd):

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

You probably know, but you could have dropped the -f Dockerfile and just goine with 'buildah bud -t fedora-httpd .' I think most folks how are familiar with Docker might think they can't still use that syntax with Buildah if you use the below example.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

You probably know, but you could have dropped the -f Dockerfile and just goine with 'buildah bud -t fedora-httpd .' I think most folks how are familiar with Docker might think they can't still use that syntax with Buildah if you use the below example.

This comment has been minimized.

@ipbabble

ipbabble Oct 31, 2017

Contributor

I did not know. Done.

@ipbabble

ipbabble Oct 31, 2017

Contributor

I did not know. Done.

Show outdated Hide outdated docs/tutorials/01-intro.md Outdated
You will see the standard apache webpage.
Why not try and modify the Dockerfile. Do not install httpd, but instead ADD the runecho.sh file and have it run as the CMD.

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

Summation? Might be nice to add some pointers where they can get more info, thank them for their time, hope they'll contribute, etc., etc., etc.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

Summation? Might be nice to add some pointers where they can get more info, thank them for their time, hope they'll contribute, etc., etc., etc.

This comment has been minimized.

@ipbabble

ipbabble Oct 30, 2017

Contributor

Ack. Again I don't think that's needed right away. Can I (or you) add it later as a patch to this file or does it need to be there now? Also that would be important for the public blog - so it needs to be done for that for sure.

Or I can fix it now while the build is still broken and resubmit. But I'll need help on the git process. I'm sure it's more than just a git commit --amend -s ... I.e. come checkout, change and commit on my branch. (?)

@ipbabble

ipbabble Oct 30, 2017

Contributor

Ack. Again I don't think that's needed right away. Can I (or you) add it later as a patch to this file or does it need to be there now? Also that would be important for the public blog - so it needs to be done for that for sure.

Or I can fix it now while the build is still broken and resubmit. But I'll need help on the git process. I'm sure it's more than just a git commit --amend -s ... I.e. come checkout, change and commit on my branch. (?)

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

I'll send my super secret set of git commands to you in email. Hopefully they'll ease the pain.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

I'll send my super secret set of git commands to you in email. Hopefully they'll ease the pain.

This comment has been minimized.

@ipbabble

ipbabble Oct 31, 2017

Contributor

Added a Congratulations section.

@ipbabble

ipbabble Oct 31, 2017

Contributor

Added a Congratulations section.

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

👍

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

👍

@TomSweeneyRedHat

This comment has been minimized.

Show comment
Hide comment
@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

My comments are all nits. I'm fine with merging as is with the provisio of touchups in a follow on PR. I know @ipbabble has been having fun with git. Build issues are not related to this PR.

Collaborator

TomSweeneyRedHat commented Oct 30, 2017

My comments are all nits. I'm fine with merging as is with the provisio of touchups in a follow on PR. I know @ipbabble has been having fun with git. Build issues are not related to this PR.

@TomSweeneyRedHat

This comment has been minimized.

Show comment
Hide comment
@TomSweeneyRedHat

TomSweeneyRedHat Oct 30, 2017

Collaborator

@rh-atomic-bot, retest this please

Collaborator

TomSweeneyRedHat commented Oct 30, 2017

@rh-atomic-bot, retest this please

Added file tutorials/01-intro.md
A basic introduction to buildah tutorial

Topics covered:
buildah from a base
briefly describes containers/storage and containers/image
buildah run
buildah from scratch
installing packages and files to a scratch image
buildah push and running a buildah built container in docker
buildah bud

Signed-off-by: William Henry <whenry@redhat.com>
@ipbabble

This comment has been minimized.

Show comment
Hide comment
@ipbabble

ipbabble Oct 31, 2017

Contributor

Woohoo! Finally all tests passed.

Contributor

ipbabble commented Oct 31, 2017

Woohoo! Finally all tests passed.

@rhatdan

This comment has been minimized.

Show comment
Hide comment
@rhatdan

rhatdan Oct 31, 2017

Member

LGTM

Member

rhatdan commented Oct 31, 2017

LGTM

@rhatdan

This comment has been minimized.

Show comment
Hide comment
@rhatdan
Member

rhatdan commented Oct 31, 2017

@rh-atomic-bot

This comment has been minimized.

Show comment
Hide comment
@rh-atomic-bot

rh-atomic-bot Oct 31, 2017

Collaborator

📌 Commit 69d3e43 has been approved by rhatdan

Collaborator

rh-atomic-bot commented Oct 31, 2017

📌 Commit 69d3e43 has been approved by rhatdan

@rh-atomic-bot

This comment has been minimized.

Show comment
Hide comment
@rh-atomic-bot

rh-atomic-bot Oct 31, 2017

Collaborator

⌛️ Testing commit 69d3e43 with merge 79663fe...

Collaborator

rh-atomic-bot commented Oct 31, 2017

⌛️ Testing commit 69d3e43 with merge 79663fe...

@TomSweeneyRedHat

Looks really good William. Found a few typos and have a question for @rhatdan. I also did the tutorial itself and have a couple of comments based on that.

buildah run $container bash
Notice we get a new shell prompt because we are running a bash shell inside of the container. It should be noted that `buildah run` is not intended for running production containers. It is for helping debug during the build process.

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

I'm a little concerned that seeing the "not intended for running production containers" line will turn people off right here. @rhatdan, thoughts on how to talk about that here? Perhaps adding a CRI-O reference somewhere in the introductory section, then add a "that's a job for CRI-O" or some such here?

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

I'm a little concerned that seeing the "not intended for running production containers" line will turn people off right here. @rhatdan, thoughts on how to talk about that here? Perhaps adding a CRI-O reference somewhere in the introductory section, then add a "that's a job for CRI-O" or some such here?

buildah run $container -- dnf install java
The `--` syntax basically tells Buildah: there are no more `buildah run` command options after this point. The options after this point or for inside the containers shell. It is required if the command we specify includes command line options which are not meant for Buildah.

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

"or for inside" to "are for inside"

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

"or for inside" to "are for inside"

The `--` syntax basically tells Buildah: there are no more `buildah run` command options after this point. The options after this point or for inside the containers shell. It is required if the command we specify includes command line options which are not meant for Buildah.
Now running `buildah run $container java` will show that Java has been installed. It will return the `Usage`:

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

maybe "return the standard Java Usage output." ?

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

maybe "return the standard Java Usage output." ?

buildah containers
Its container name is working-container by default. And it's stored in the `$newcontainer` variable. Notice the image name (IMAGE NAME) is "scratch". This just indicates that there is no real image yet. i.e. It is containers/storage but there is no representation in containers/image. So when we run:

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

I'd suggest "default. And" to "default and"

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

I'd suggest "default. And" to "default and"

buildah containers
Its container name is working-container by default. And it's stored in the `$newcontainer` variable. Notice the image name (IMAGE NAME) is "scratch". This just indicates that there is no real image yet. i.e. It is containers/storage but there is no representation in containers/image. So when we run:

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

Since you're directing the reader to "Notice the image name" would it make sense to have an example output listed here? I know they're supposed to be following along on their computer and I'm sitting on the fence for the need of the example. So thought I'd throw it past you to mull over.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

Since you're directing the reader to "Notice the image name" would it make sense to have an example output listed here? I know they're supposed to be following along on their computer and I'm sitting on the fence for the need of the example. So thought I'd throw it past you to mull over.

or, because `buildah bud` defaults to Dockerfile:
buildah bud -t fedora-httpd

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

need a period at the end here. "buildah bud -t fedora-httpd ." FWIW. I usually add a "(Note the period at the end of this buildah bud example). " or some such just to draw attention to it more.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

need a period at the end here. "buildah bud -t fedora-httpd ." FWIW. I usually add a "(Note the period at the end of this buildah bud example). " or some such just to draw attention to it more.

Notice we get a new shell prompt because we are running a bash shell inside of the container. It should be noted that `buildah run` is not intended for running production containers. It is for helping debug during the build process.
Let's try running something else:

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

Unless the person thought to exit out of the container, they'd still be in the container at this point when you try to run java. You might want to make an explicit note to exit the container.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

Unless the person thought to exit out of the container, they'd still be in the container at this point when you try to run java. You might want to make an explicit note to exit the container.

Lets try installing it using:
buildah run $container -- dnf install java

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

do you want to include '-y' in the dnf command here?

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

do you want to include '-y' in the dnf command here?

buildah images
We don't see the image listed. There is no image. It is an empty container.

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

If you follow the example, there's a 'docker.io/library/fedora:latest' image listed. Perhaps it might be nice to add a step prior showing how to remove image (buildah rmi {image}) and/or change "no image" to something like "no corresponding scratch image".

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

If you follow the example, there's a 'docker.io/library/fedora:latest' image listed. Perhaps it might be nice to add a step prior showing how to remove image (buildah rmi {image}) and/or change "no image" to something like "no corresponding scratch image".

Let's try it out (showing the prompt in this example to demonstrate the difference):
# buildah run $newcontainer bash
bash-4.4# cd /usr/bin

This comment has been minimized.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

suggest adding a 'bash-4.4# ls' line after this one just to show off some more.

@TomSweeneyRedHat

TomSweeneyRedHat Oct 31, 2017

Collaborator

suggest adding a 'bash-4.4# ls' line after this one just to show off some more.

@rh-atomic-bot

This comment has been minimized.

Show comment
Hide comment
@rh-atomic-bot

rh-atomic-bot Oct 31, 2017

Collaborator

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing 79663fe to master...

Collaborator

rh-atomic-bot commented Oct 31, 2017

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing 79663fe to master...

nalind pushed a commit that referenced this pull request Apr 2, 2018

Merge pull request #302 from rhatdan/cleanup
cleanup network stack as well as storage when container shuts down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment