"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/tutorials/01-intro.md" between
buildah-1.22.3.tar.gz and buildah-1.23.0.tar.gz

About: Buildah is a tool that facilitates building Open Container Initiative (OCI) container images.

01-intro.md  (buildah-1.22.3):01-intro.md  (buildah-1.23.0)
skipping to change at line 236 skipping to change at line 236
This is a new container from ipbabble [ 5 ] This is a new container from ipbabble [ 5 ]
This is a new container from ipbabble [ 6 ] This is a new container from ipbabble [ 6 ]
This is a new container from ipbabble [ 7 ] This is a new container from ipbabble [ 7 ]
This is a new container from ipbabble [ 8 ] This is a new container from ipbabble [ 8 ]
This is a new container from ipbabble [ 9 ] This is a new container from ipbabble [ 9 ]
OCI container images built with `buildah` are completely standard as expected. S o now it might be time to run: OCI container images built with `buildah` are completely standard as expected. S o now it might be time to run:
# dnf -y remove docker # dnf -y remove docker
## Using Dockerfiles with Buildah ## Using Containerfiles/Dockerfiles with Buildah
What if you have been using Docker for a while and have some existing Dockerfile s. Not a problem. Buildah can build images using a Dockerfile. The `build-using- dockerfile`, or `bud` for short, takes a Dockerfile as input and produces an OCI image. What if you have been using Docker for a while and have some existing Dockerfile s. Not a problem. Buildah can build images using a Dockerfile. The `build` comma nd takes a Dockerfile as input and produces an OCI image.
Find one of your Dockerfiles or create a file called Dockerfile. Use the followi ng example or some variation if you'd like: Find one of your Dockerfiles or create a file called Dockerfile. Use the followi ng example or some variation if you'd like:
# Base on the Fedora # Base on the Fedora
FROM fedora:latest FROM fedora:latest
MAINTAINER ipbabble email buildahboy@redhat.com # not a real email MAINTAINER ipbabble email buildahboy@redhat.com # not a real email
# Update image and install httpd # Update image and install httpd
RUN echo "Updating all fedora packages"; dnf -y update; dnf -y clean all RUN echo "Updating all fedora packages"; dnf -y update; dnf -y clean all
RUN echo "Installing httpd"; dnf -y install httpd RUN echo "Installing httpd"; dnf -y install httpd
# Expose the default httpd port 80 # Expose the default httpd port 80
EXPOSE 80 EXPOSE 80
# Run the httpd # Run the httpd
CMD ["/usr/sbin/httpd", "-DFOREGROUND"] CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
Now run `buildah bud` with the name of the Dockerfile and the name to be given t o the created image (e.g. fedora-httpd): Now run `buildah build` with the name of the Dockerfile and the name to be given to the created image (e.g. fedora-httpd):
# buildah bud -f Dockerfile -t fedora-httpd . # buildah build -f Dockerfile -t fedora-httpd .
or, because `buildah bud` defaults to Dockerfile (note the period at the end of the example): or, because `buildah build` defaults to Dockerfile (note the period at the end o f the example):
# buildah bud -t fedora-httpd . # buildah build -t fedora-httpd .
You will see all the steps of the Dockerfile executing. Afterwards `buildah imag es` will show you the new image. Now we need to create the container using `buil dah from` and test it with `buildah run`: You will see all the steps of the Dockerfile executing. Afterwards `buildah imag es` will show you the new image. Now we need to create the container using `buil dah from` and test it with `buildah run`:
# httpcontainer=$(buildah from fedora-httpd) # httpcontainer=$(buildah from fedora-httpd)
# buildah run $httpcontainer # buildah run $httpcontainer
While that container is running, in another shell run: While that container is running, in another shell run:
# curl localhost # curl localhost
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)