Skip to content

Commit 2d82203

Browse files
committed
Rename bud to build, while keeping an alias for to bud.
Signed-off-by: Kirill Shirinkin <[email protected]>
1 parent afe00c3 commit 2d82203

21 files changed

+427
-423
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ $ sudo ./lighttpd.sh
104104
| Command | Description |
105105
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
106106
| [buildah-add(1)](/docs/buildah-add.md) | Add the contents of a file, URL, or a directory to the container. |
107-
| [buildah-bud(1)](/docs/buildah-bud.md) | Build an image using instructions from Dockerfiles. |
107+
| [buildah-build(1)](/docs/buildah-build.md) | Build an image using instructions from Containerfiles or Dockerfiles. |
108108
| [buildah-commit(1)](/docs/buildah-commit.md) | Create an image from a working container. |
109109
| [buildah-config(1)](/docs/buildah-config.md) | Update image configuration settings. |
110110
| [buildah-containers(1)](/docs/buildah-containers.md) | List the working containers and their base images. |

buildah.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func GetBuildInfo(b *Builder) BuilderInfo {
245245
}
246246
}
247247

248-
// CommonBuildOptions are resources that can be defined by flags for both buildah from and build-using-dockerfile
248+
// CommonBuildOptions are resources that can be defined by flags for both buildah from and build
249249
type CommonBuildOptions = define.CommonBuildOptions
250250

251251
// BuilderOptions are used to initialize a new Builder.

cmd/buildah/bud.go renamed to cmd/buildah/build.go

+20-20
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/spf13/cobra"
2121
)
2222

23-
type budOptions struct {
23+
type buildOptions struct {
2424
*buildahcli.LayerResults
2525
*buildahcli.BudResults
2626
*buildahcli.UserNSResults
@@ -29,61 +29,61 @@ type budOptions struct {
2929
}
3030

3131
func init() {
32-
budDescription := `
32+
buildDescription := `
3333
Builds an OCI image using instructions in one or more Containerfiles.
3434
3535
If no arguments are specified, Buildah will use the current working directory
3636
as the build context and look for a Containerfile. The build fails if no
3737
Containerfile nor Dockerfile is present.`
3838

3939
layerFlagsResults := buildahcli.LayerResults{}
40-
budFlagResults := buildahcli.BudResults{}
40+
buildFlagResults := buildahcli.BudResults{}
4141
fromAndBudResults := buildahcli.FromAndBudResults{}
4242
userNSResults := buildahcli.UserNSResults{}
4343
namespaceResults := buildahcli.NameSpaceResults{}
4444

45-
budCommand := &cobra.Command{
46-
Use: "bud",
47-
Aliases: []string{"build-using-dockerfile"},
45+
buildCommand := &cobra.Command{
46+
Use: "build",
47+
Aliases: []string{"build-using-dockerfile", "bud"},
4848
Short: "Build an image using instructions in a Containerfile",
49-
Long: budDescription,
49+
Long: buildDescription,
5050
RunE: func(cmd *cobra.Command, args []string) error {
51-
br := budOptions{
51+
br := buildOptions{
5252
&layerFlagsResults,
53-
&budFlagResults,
53+
&buildFlagResults,
5454
&userNSResults,
5555
&fromAndBudResults,
5656
&namespaceResults,
5757
}
58-
return budCmd(cmd, args, br)
58+
return buildCmd(cmd, args, br)
5959
},
60-
Example: `buildah bud
60+
Example: `buildah build
6161
buildah bud -f Containerfile.simple .
6262
buildah bud --volume /home/test:/myvol:ro,Z -t imageName .
6363
buildah bud -f Containerfile.simple -f Containerfile.notsosimple .`,
6464
}
65-
budCommand.SetUsageTemplate(UsageTemplate())
65+
buildCommand.SetUsageTemplate(UsageTemplate())
6666

67-
flags := budCommand.Flags()
67+
flags := buildCommand.Flags()
6868
flags.SetInterspersed(false)
6969

70-
// BUD is a all common flags
71-
budFlags := buildahcli.GetBudFlags(&budFlagResults)
72-
budFlags.StringVar(&budFlagResults.Runtime, "runtime", util.Runtime(), "`path` to an alternate runtime. Use BUILDAH_RUNTIME environment variable to override.")
70+
// build is a all common flags
71+
buildFlags := buildahcli.GetBudFlags(&buildFlagResults)
72+
buildFlags.StringVar(&buildFlagResults.Runtime, "runtime", util.Runtime(), "`path` to an alternate runtime. Use BUILDAH_RUNTIME environment variable to override.")
7373

7474
layerFlags := buildahcli.GetLayerFlags(&layerFlagsResults)
7575
fromAndBudFlags, err := buildahcli.GetFromAndBudFlags(&fromAndBudResults, &userNSResults, &namespaceResults)
7676
if err != nil {
77-
logrus.Errorf("failed to setup From and Bud flags: %v", err)
77+
logrus.Errorf("failed to setup From and Build flags: %v", err)
7878
os.Exit(1)
7979
}
8080

81-
flags.AddFlagSet(&budFlags)
81+
flags.AddFlagSet(&buildFlags)
8282
flags.AddFlagSet(&layerFlags)
8383
flags.AddFlagSet(&fromAndBudFlags)
8484
flags.SetNormalizeFunc(buildahcli.AliasFlags)
8585

86-
rootCmd.AddCommand(budCommand)
86+
rootCmd.AddCommand(buildCommand)
8787
}
8888

8989
func getContainerfiles(files []string) []string {
@@ -98,7 +98,7 @@ func getContainerfiles(files []string) []string {
9898
return containerfiles
9999
}
100100

101-
func budCmd(c *cobra.Command, inputArgs []string, iopts budOptions) error {
101+
func buildCmd(c *cobra.Command, inputArgs []string, iopts buildOptions) error {
102102
output := ""
103103
tags := []string{}
104104
if c.Flag("tag").Changed {

contrib/completions/bash/buildah

+1-1
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ esac
11841184
local commands=(
11851185
add
11861186
bud
1187-
build-using-dockerfile
1187+
build
11881188
commit
11891189
config
11901190
containers

define/build.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"golang.org/x/sync/semaphore"
1111
)
1212

13-
// CommonBuildOptions are resources that can be defined by flags for both buildah from and build-using-dockerfile
13+
// CommonBuildOptions are resources that can be defined by flags for both buildah from and build
1414
type CommonBuildOptions struct {
1515
// AddHost is the list of hostnames to add to the build container's /etc/hosts.
1616
AddHost []string

developmentplan.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
* Integration into Kubernetes and potentially other tools. The biggest requirement for this is to be able run Buildah within a standard linux container without SYS_ADMIN privileges. This would allow Buildah to run non-privileged containers inside of Kubernetes, so you could distribute your container workloads.
88

9-
* Integration with User Namespace, Podman has this already and the goal is to get `buildah bud` and `buildah run` to be able to run its containers in a usernamespace to give the builder better security isolation from the host.
9+
* Integration with User Namespace, Podman has this already and the goal is to get `buildah build` and `buildah run` to be able to run its containers in a usernamespace to give the builder better security isolation from the host.
1010

11-
* Buildah `buildah bud` command's goal is to have feature parity with other OCI image and container build systems.
11+
* Buildah `buildah build` command's goal is to have feature parity with other OCI image and container build systems.
1212

1313
* Addressing issues from the community as reported in the [Issues](https://github.com/containers/buildah/issues) page.

docs/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ docs: $(patsubst %.md,%.1,$(wildcard *.md))
1212
install:
1313
install -d ${DESTDIR}/${MANDIR}/man1
1414
install -m 0644 buildah*.1 ${DESTDIR}/${MANDIR}/man1
15+
install -m 0644 links/buildah*.1 ${DESTDIR}/${MANDIR}/man1
1516

1617
.PHONY: clean
1718
clean:

docs/buildah-bud.md renamed to docs/buildah-build.md

+37-35
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# buildah-bud "1" "April 2017" "buildah"
1+
# buildah-build "1" "April 2017" "buildah"
22

33
## NAME
4-
buildah\-bud - Build an image using instructions from Containerfiles
4+
buildah\-build - Build an image using instructions from Containerfiles
55

66
## SYNOPSIS
77

8-
**buildah build-using-dockerfile** [*options*] [*context*]
8+
**buildah build** [*options*] [*context*]
99

1010
**buildah bud** [*options*] [*context*]
1111

12-
**bud** is an alias for **build-using-dockerfile**.
12+
**buildah build-using-dockerfile** [*options*] [*context*]
13+
14+
**build** has aliases **bud** and **build-using-dockerfile**.
1315

1416
## DESCRIPTION
1517
Builds an image using instructions from one or more Containerfiles or Dockerfiles and a specified
@@ -479,7 +481,7 @@ Adds global flags for the container rutime. To list the supported flags, please
479481
consult the manpages of the selected container runtime.
480482

481483
Note: Do not pass the leading `--` to the flag. To pass the runc flag `--log-format json`
482-
to buildah bud, the option given would be `--runtime-flag log-format=json`.
484+
to buildah build, the option given would be `--runtime-flag log-format=json`.
483485

484486
**--secret**=**id=id,src=path**
485487

@@ -749,59 +751,59 @@ Please refer to the [Using Build Time Variables](#using-build-time-variables) se
749751

750752
### Build an image using local Containerfiles
751753

752-
buildah bud .
754+
buildah build .
753755

754-
buildah bud -f Containerfile .
756+
buildah build -f Containerfile .
755757

756-
cat ~/Dockerfile | buildah bud -f - .
758+
cat ~/Dockerfile | buildah build -f - .
757759

758-
buildah bud -f Dockerfile.simple -f Dockerfile.notsosimple .
760+
buildah build -f Dockerfile.simple -f Dockerfile.notsosimple .
759761

760-
buildah bud --timestamp=$(date '+%s') -t imageName .
762+
buildah build --timestamp=$(date '+%s') -t imageName .
761763

762-
buildah bud -t imageName .
764+
buildah build -t imageName .
763765

764-
buildah bud --tls-verify=true -t imageName -f Dockerfile.simple .
766+
buildah build --tls-verify=true -t imageName -f Dockerfile.simple .
765767

766-
buildah bud --tls-verify=false -t imageName .
768+
buildah build --tls-verify=false -t imageName .
767769

768-
buildah bud --runtime-flag log-format=json .
770+
buildah build --runtime-flag log-format=json .
769771

770-
buildah bud -f Containerfile --runtime-flag debug .
772+
buildah build -f Containerfile --runtime-flag debug .
771773

772-
buildah bud --authfile /tmp/auths/myauths.json --cert-dir ~/auth --tls-verify=true --creds=username:password -t imageName -f Dockerfile.simple .
774+
buildah build --authfile /tmp/auths/myauths.json --cert-dir ~/auth --tls-verify=true --creds=username:password -t imageName -f Dockerfile.simple .
773775

774-
buildah bud --memory 40m --cpu-period 10000 --cpu-quota 50000 --ulimit nofile=1024:1028 -t imageName .
776+
buildah build --memory 40m --cpu-period 10000 --cpu-quota 50000 --ulimit nofile=1024:1028 -t imageName .
775777

776-
buildah bud --security-opt label=level:s0:c100,c200 --cgroup-parent /path/to/cgroup/parent -t imageName .
778+
buildah build --security-opt label=level:s0:c100,c200 --cgroup-parent /path/to/cgroup/parent -t imageName .
777779

778-
buildah bud --arch=arm --variant v7 -t imageName .
780+
buildah build --arch=arm --variant v7 -t imageName .
779781

780-
buildah bud --volume /home/test:/myvol:ro,Z -t imageName .
782+
buildah build --volume /home/test:/myvol:ro,Z -t imageName .
781783

782-
buildah bud -v /home/test:/myvol:z,U -t imageName .
784+
buildah build -v /home/test:/myvol:z,U -t imageName .
783785

784-
buildah bud -v /var/lib/dnf:/var/lib/dnf:O -t imageName .
786+
buildah build -v /var/lib/dnf:/var/lib/dnf:O -t imageName .
785787

786-
buildah bud --layers -t imageName .
788+
buildah build --layers -t imageName .
787789

788-
buildah bud --no-cache -t imageName .
790+
buildah build --no-cache -t imageName .
789791

790-
buildah bud -f Containerfile --layers --force-rm -t imageName .
792+
buildah build -f Containerfile --layers --force-rm -t imageName .
791793

792-
buildah bud --no-cache --rm=false -t imageName .
794+
buildah build --no-cache --rm=false -t imageName .
793795

794-
buildah bud --dns-search=example.com --dns=223.5.5.5 --dns-option=use-vc .
796+
buildah build --dns-search=example.com --dns=223.5.5.5 --dns-option=use-vc .
795797

796-
buildah bud -f Containerfile.in -t imageName .
798+
buildah build -f Containerfile.in -t imageName .
797799

798800
### Building an multi-architecture image using the --manifest option (requires emulation software)
799801

800-
buildah bud --arch arm --manifest myimage /tmp/mysrc
802+
buildah build --arch arm --manifest myimage /tmp/mysrc
801803

802-
buildah bud --arch amd64 --manifest myimage /tmp/mysrc
804+
buildah build --arch amd64 --manifest myimage /tmp/mysrc
803805

804-
buildah bud --arch s390x --manifest myimage /tmp/mysrc
806+
buildah build --arch s390x --manifest myimage /tmp/mysrc
805807

806808
buildah bud --platform linux/s390x,linux/ppc64le,linux/amd64 --manifest myimage /tmp/mysrc
807809

@@ -811,21 +813,21 @@ buildah bud --platform linux/arm64 --platform linux/amd64 --manifest myimage /tm
811813

812814
This will clone the specified GitHub repository from the URL and use it as context. The Containerfile or Dockerfile at the root of the repository is used as the context of the build. This only works if the GitHub repository is a dedicated repository.
813815

814-
buildah bud github.com/scollier/purpletest
816+
buildah build github.com/scollier/purpletest
815817

816818
Note: You can set an arbitrary Git repository via the git:// scheme.
817819

818820
### Building an image using a URL to a tarball'ed context
819821
Buildah will fetch the tarball archive, decompress it and use its contents as the build context. The Containerfile or Dockerfile at the root of the archive and the rest of the archive will get used as the context of the build. If you pass an -f PATH/Containerfile option as well, the system will look for that file inside the contents of the tarball.
820822

821-
buildah bud -f dev/Containerfile https://10.10.10.1/docker/context.tar.gz
823+
buildah build -f dev/Containerfile https://10.10.10.1/docker/context.tar.gz
822824

823825
Note: supported compression formats are 'xz', 'bzip2', 'gzip' and 'identity' (no compression).
824826

825827
### Using Build Time Variables
826828
#### Replace the value set for the HTTP_PROXY environment variable within the Containerfile.
827829

828-
buildah bud --build-arg=HTTP_PROXY="http://127.0.0.1:8321"
830+
buildah build --build-arg=HTTP_PROXY="http://127.0.0.1:8321"
829831

830832
## ENVIRONMENT
831833

@@ -849,7 +851,7 @@ are stored while pulling and pushing images. Defaults to '/var/tmp'.
849851
### `.containerignore`/`.dockerignore`
850852

851853
If the .containerignore/.dockerignore file exists in the context directory,
852-
`buildah bud` reads its contents. If both exist, then .containerignore is used.
854+
`buildah build` reads its contents. If both exist, then .containerignore is used.
853855
Use the `--ignorefile` flag to override the ignore file path location. Buildah uses the content to exclude files and directories from the context directory, when executing COPY and ADD directives in the Containerfile/Dockerfile
854856

855857
Users can specify a series of Unix shell globals in a

docs/buildah.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Buildah can set up environment variables from the env entry in the [engine] tabl
139139
| Command | Description |
140140
| --------------------- | --------------------------------------------------- |
141141
| buildah-add(1) | Add the contents of a file, URL, or a directory to the container. |
142-
| buildah-bud(1) | Build an image using instructions from Dockerfiles. |
142+
| buildah-build(1) | Build an image using instructions from Dockerfiles. |
143143
| buildah-commit(1) | Create an image from a working container. |
144144
| buildah-config(1) | Update image configuration settings. |
145145
| buildah-containers(1) | List the working containers and their base images. |

docs/cni-examples/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
When [buildah](https://github.com/containers/buildah)'s `buildah run`
2-
command is used, or when `buildah build-using-dockerfile` needs to handle a
2+
command is used, or when `buildah build` needs to handle a
33
`RUN` instruction, the processes which `buildah` starts are run in their own
44
network namespace unless the `--network=host` option is used.
55

docs/containertools/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ familiar container cli commands.
8585
Some of the commands between the projects overlap:
8686

8787
* build
88-
The `podman build` and `buildah bud` commands have significant overlap as Podman borrows large pieces of the `podman build` implementation from Buildah.
88+
The `podman build` and `buildah build` commands have significant overlap as Podman borrows large pieces of the `podman build` implementation from Buildah.
8989

9090
* run
9191
The `buildah run` and `podman run` commands are similar but different. As explained above Podman and Buildah have a different concept of a container. An easy way to think of it is the `buildah run` command emulates the RUN command in a Dockerfile while the `podman run` command emulates the `docker run` command in functionality. As Buildah and Podman have somewhat different concepts of containers, you can not see Podman containers from within Buildah or vice versa.

docs/links/buildah-bud.1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.so man1/buildah-build.1

docs/tutorials/01-intro.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ OCI container images built with `buildah` are completely standard as expected. S
234234

235235
# dnf -y remove docker
236236

237-
## Using Dockerfiles with Buildah
237+
## Using Containerfiles/Dockerfiles with Buildah
238238

239-
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.
239+
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.
240240

241241
Find one of your Dockerfiles or create a file called Dockerfile. Use the following example or some variation if you'd like:
242242

@@ -254,13 +254,13 @@ Find one of your Dockerfiles or create a file called Dockerfile. Use the followi
254254
# Run the httpd
255255
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
256256

257-
Now run `buildah bud` with the name of the Dockerfile and the name to be given to the created image (e.g. fedora-httpd):
257+
Now run `buildah build` with the name of the Dockerfile and the name to be given to the created image (e.g. fedora-httpd):
258258

259-
# buildah bud -f Dockerfile -t fedora-httpd .
259+
# buildah build -f Dockerfile -t fedora-httpd .
260260

261-
or, because `buildah bud` defaults to Dockerfile (note the period at the end of the example):
261+
or, because `buildah build` defaults to Dockerfile (note the period at the end of the example):
262262

263-
# buildah bud -t fedora-httpd .
263+
# buildah build -t fedora-httpd .
264264

265265
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`:
266266

docs/tutorials/03-on-build.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ EOF
5757
Now to create the first container and verify that ONBUILD has been set:
5858

5959
```
60-
# buildah bud --format=docker -f Dockerfile -t onbuild-image .
60+
# buildah build --format=docker -f Dockerfile -t onbuild-image .
6161
# buildah inspect --format '{{.Docker.Config.OnBuild}}' onbuild-image
6262
[RUN touch /bar]
6363
```
6464

6565
The second container is now created and the `/bar` file will be created within it:
6666

6767
```
68-
# buildah bud --format=docker -f Dockerfile-2 -t result-image .
68+
# buildah build --format=docker -f Dockerfile-2 -t result-image .
6969
STEP 1: FROM onbuild-image
7070
STEP 2: RUN touch /bar # Note /bar created here based on the ONBUILD in Dockerfile
7171
STEP 3: RUN touch /baz
@@ -94,7 +94,7 @@ First a Fedora container will be created with `buildah from`, then the `/foo` fi
9494
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:
9595

9696
```
97-
# buildah bud --format=docker -f Dockerfile-2 -t result-image .
97+
# buildah build --format=docker -f Dockerfile-2 -t result-image .
9898
STEP 1: FROM onbuild-image
9999
STEP 2: RUN touch /bar # Note /bar created here based on the ONBUILD in Dockerfile
100100
STEP 3: RUN touch /baz

docs/tutorials/05-openshift-rootless-bud.md renamed to docs/tutorials/05-openshift-rootless-build.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ sh-5.0$ mkdir output
284284
And finally build the image, testing that everything works as expected:
285285

286286
````console
287-
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
287+
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
288288
STEP 1: FROM fedora:33
289289
Getting image source signatures
290290
Copying blob 453ed60def9c done

0 commit comments

Comments
 (0)