Skip to content

Commit f2a559a

Browse files
Merge pull request #27309 from ygalblum/quadlet-build-ignorefile
Quadlet build - add support for IgnoreFile key
2 parents 49c1fd6 + 1800b34 commit f2a559a

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

docs/source/markdown/podman-systemd.unit.5.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@ Valid options for `[Build]` are listed below:
17251725
| ForceRM=false | --force-rm=false |
17261726
| GlobalArgs=--log-level=debug | --log-level=debug |
17271727
| GroupAdd=keep-groups | --group-add=keep-groups |
1728+
| IgnoreFile=/path/to/.customignore | --ignorefile=/path/to/.customignore |
17281729
| ImageTag=localhost/imagename | --tag=localhost/imagename |
17291730
| Label=label | --label=label |
17301731
| Network=host | --network=host |
@@ -1840,6 +1841,13 @@ Assign additional groups to the primary user running within the container proces
18401841

18411842
This is equivalent to the `--group-add` option of `podman build`.
18421843

1844+
### `IgnoreFile=`
1845+
1846+
Path to an alternate .containerignore file to use when building the image.
1847+
Note that when using a relative path you should also set `SetWorkingDirectory=`
1848+
1849+
This is equivalent to the `--ignorefile` option of `podman build`.
1850+
18431851
### `ImageTag=`
18441852

18451853
Specifies the name which is assigned to the resulting image if the build process completes

pkg/systemd/quadlet/quadlet.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ const (
114114
KeyHealthTimeout = "HealthTimeout"
115115
KeyHostName = "HostName"
116116
KeyHttpProxy = "HttpProxy"
117+
KeyIgnoreFile = "IgnoreFile"
117118
KeyImage = "Image"
118119
KeyImageTag = "ImageTag"
119120
KeyInterfaceName = "InterfaceName"
@@ -448,6 +449,7 @@ var (
448449
KeyForceRM: true,
449450
KeyGlobalArgs: true,
450451
KeyGroupAdd: true,
452+
KeyIgnoreFile: true,
451453
KeyImageTag: true,
452454
KeyLabel: true,
453455
KeyNetwork: true,
@@ -1394,6 +1396,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
13941396
stringKeys := map[string]string{
13951397
KeyArch: "--arch",
13961398
KeyAuthFile: "--authfile",
1399+
KeyIgnoreFile: "--ignorefile",
13971400
KeyTarget: "--target",
13981401
KeyVariant: "--variant",
13991402
KeyRetry: "--retry",

test/e2e/quadlet/ignorefile.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## assert-podman-args "--ignorefile" "/path/to/.customignore"
2+
3+
[Build]
4+
ImageTag=localhost/imagename
5+
SetWorkingDirectory=unit
6+
IgnoreFile=/path/to/.customignore

test/e2e/quadlet_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ BOGUS=foo
10561056
Entry("Build - ForceRM Key", "force-rm.build"),
10571057
Entry("Build - GlobalArgs", "globalargs.build"),
10581058
Entry("Build - GroupAdd Key", "group-add.build"),
1059+
Entry("Build - IgnoreFile Key", "ignorefile.build"),
10591060
Entry("Build - Containers Conf Modules", "containersconfmodule.build"),
10601061
Entry("Build - Label Key", "label.build"),
10611062
Entry("Build - Multiple Tags", "multiple-tags.build"),

0 commit comments

Comments
 (0)