mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
Rename bud to build, while keeping an alias for to bud.
Signed-off-by: Kirill Shirinkin <kirill@hey.com>
This commit is contained in:
@@ -234,9 +234,9 @@ OCI container images built with `buildah` are completely standard as expected. S
|
||||
|
||||
# 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 Dockerfiles. 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 Dockerfiles. Not a problem. Buildah can build images using a Dockerfile. The `build` command takes a Dockerfile as input and produces an OCI image.
|
||||
|
||||
Find one of your Dockerfiles or create a file called Dockerfile. Use the following example or some variation if you'd like:
|
||||
|
||||
@@ -254,13 +254,13 @@ Find one of your Dockerfiles or create a file called Dockerfile. Use the followi
|
||||
# Run the httpd
|
||||
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
|
||||
|
||||
Now run `buildah bud` with the name of the Dockerfile and the name to be given to 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 of the example):
|
||||
|
||||
# buildah bud -t fedora-httpd .
|
||||
# buildah build -t fedora-httpd .
|
||||
|
||||
You will see all the steps of the Dockerfile executing. Afterwards `buildah images` will show you the new image. Now we need to create the container using `buildah from` and test it with `buildah run`:
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ EOF
|
||||
Now to create the first container and verify that ONBUILD has been set:
|
||||
|
||||
```
|
||||
# buildah bud --format=docker -f Dockerfile -t onbuild-image .
|
||||
# buildah build --format=docker -f Dockerfile -t onbuild-image .
|
||||
# buildah inspect --format '{{.Docker.Config.OnBuild}}' onbuild-image
|
||||
[RUN touch /bar]
|
||||
```
|
||||
@@ -65,7 +65,7 @@ Now to create the first container and verify that ONBUILD has been set:
|
||||
The second container is now created and the `/bar` file will be created within it:
|
||||
|
||||
```
|
||||
# buildah bud --format=docker -f Dockerfile-2 -t result-image .
|
||||
# buildah build --format=docker -f Dockerfile-2 -t result-image .
|
||||
STEP 1: FROM onbuild-image
|
||||
STEP 2: RUN touch /bar # Note /bar created here based on the ONBUILD in Dockerfile
|
||||
STEP 3: RUN touch /baz
|
||||
@@ -94,7 +94,7 @@ First a Fedora container will be created with `buildah from`, then the `/foo` fi
|
||||
The onbuild-image has been created, so now create a container from it using the same commands as the first example using the second Dockerfile:
|
||||
|
||||
```
|
||||
# buildah bud --format=docker -f Dockerfile-2 -t result-image .
|
||||
# buildah build --format=docker -f Dockerfile-2 -t result-image .
|
||||
STEP 1: FROM onbuild-image
|
||||
STEP 2: RUN touch /bar # Note /bar created here based on the ONBUILD in Dockerfile
|
||||
STEP 3: RUN touch /baz
|
||||
|
||||
@@ -284,7 +284,7 @@ sh-5.0$ mkdir output
|
||||
And finally build the image, testing that everything works as expected:
|
||||
|
||||
````console
|
||||
sh-5.0$ buildah -v /home/build/output:/output:rw -v /home/build/test-script.sh:/test-script.sh:ro bud -t myimage -f Containerfile.test
|
||||
sh-5.0$ buildah -v /home/build/output:/output:rw -v /home/build/test-script.sh:/test-script.sh:ro build -t myimage -f Containerfile.test
|
||||
STEP 1: FROM fedora:33
|
||||
Getting image source signatures
|
||||
Copying blob 453ed60def9c done
|
||||
@@ -20,7 +20,7 @@ Learn how Buildah can use the ONBUILD instruction in either a Dockerfile or via
|
||||
|
||||
Learn how to include Buildah as a library in your build tool.
|
||||
|
||||
**[Rootless OpenShift container](05-openshift-rootless-bud.md)**
|
||||
**[Rootless OpenShift container](05-openshift-rootless-build.md)**
|
||||
|
||||
Learn how to build an image from a rootless OpenShift container.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user