Skip to content

Commit 1800b34

Browse files
committed
Quadlet build - add support for IgnoreFile key
Resolves: #27268 Signed-off-by: Ygal Blum <[email protected]>
1 parent 571031f commit 1800b34

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
@@ -1724,6 +1724,7 @@ Valid options for `[Build]` are listed below:
17241724
| ForceRM=false | --force-rm=false |
17251725
| GlobalArgs=--log-level=debug | --log-level=debug |
17261726
| GroupAdd=keep-groups | --group-add=keep-groups |
1727+
| IgnoreFile=/path/to/.customignore | --ignorefile=/path/to/.customignore |
17271728
| ImageTag=localhost/imagename | --tag=localhost/imagename |
17281729
| Label=label | --label=label |
17291730
| Network=host | --network=host |
@@ -1831,6 +1832,13 @@ Assign additional groups to the primary user running within the container proces
18311832

18321833
This is equivalent to the `--group-add` option of `podman build`.
18331834

1835+
### `IgnoreFile=`
1836+
1837+
Path to an alternate .containerignore file to use when building the image.
1838+
Note that when using a relative path you should also set `SetWorkingDirectory=`
1839+
1840+
This is equivalent to the `--ignorefile` option of `podman build`.
1841+
18341842
### `ImageTag=`
18351843

18361844
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
@@ -113,6 +113,7 @@ const (
113113
KeyHealthTimeout = "HealthTimeout"
114114
KeyHostName = "HostName"
115115
KeyHttpProxy = "HttpProxy"
116+
KeyIgnoreFile = "IgnoreFile"
116117
KeyImage = "Image"
117118
KeyImageTag = "ImageTag"
118119
KeyInterfaceName = "InterfaceName"
@@ -446,6 +447,7 @@ var (
446447
KeyForceRM: true,
447448
KeyGlobalArgs: true,
448449
KeyGroupAdd: true,
450+
KeyIgnoreFile: true,
449451
KeyImageTag: true,
450452
KeyLabel: true,
451453
KeyNetwork: true,
@@ -1392,6 +1394,7 @@ func ConvertBuild(build *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
13921394
stringKeys := map[string]string{
13931395
KeyArch: "--arch",
13941396
KeyAuthFile: "--authfile",
1397+
KeyIgnoreFile: "--ignorefile",
13951398
KeyTarget: "--target",
13961399
KeyVariant: "--variant",
13971400
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)