Commit Graph

458 Commits

Author SHA1 Message Date
Povilas Kanapickas
f376700972
Merge pull request #1104 from rjeffman/disable_dns
Add support for disable_dns, dns and ignore on network creation
2025-01-19 19:41:30 +02:00
Rafael Guterres Jeffman
9be3ec985f Add network "dns" support
This patch add 'x-podman.dns' option to the 'network' configuration,
allowing users to set the DNS resolvers for a defined network.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-01-17 13:58:13 -03:00
Rafael Guterres Jeffman
6e642dca1f Add network "disable-dns" support
Podman allows to create a network disabling the DNS plugin with
'--disable-dns', but this option is not available in the compose spec.

This patch add 'x-podman.disable-dns' to the podman-compose options,
allowing the creation of a network with the DNS plugin disabled.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-01-17 12:14:15 -03:00
indra
2aa042b9c7 expand service environment_variables before adding to subs_dict
Also modifies an existing integration test to expect an empty string as `docker-compose` warns that
`ZZVAR3` is not set and defaults it to an empty string per the acutal output here.

```yaml
$ docker-compose -f container-compose.load-.env-in-project.yaml config
WARN[0000] The "ZZVAR3" variable is not set. Defaulting to a blank string.
name: project
services:
  app:
    command:
      - /bin/busybox
      - sh
      - -c
      - env | grep ZZ
    environment:
      ZZVAR1: This value is loaded but should be overwritten
      ZZVAR2: This value is loaded from .env in project/ directory
      ZZVAR3: ""
...
```

Signed-off-by: indra <indra.talip@gmail.com>
2025-01-16 21:00:49 +11:00
Emanuel Rietveld
bc4177fbdc Exclude dependent containers on up if --no-deps.
Fixes #398.

Signed-off-by: Emanuel Rietveld <e.j.rietveld@gmail.com>
2025-01-15 22:32:28 +01:00
Emanuel Rietveld
8206cc3ea2 Run should not add --requires if --no-deps.
Fixes #717.

Signed-off-by: Emanuel Rietveld <e.j.rietveld@gmail.com>
2025-01-15 22:29:51 +01:00
Povilas Kanapickas
9cbc4c1dcd Release 1.3.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:16:01 +02:00
Felix Rubio
804852b218 Provide support for cache_from and cache_to fields
Signed-off-by: Felix Rubio <felix@kngnt.org>
2025-01-05 12:35:30 +02:00
Yusuke Matsubara
f11e08eaac Read log output by chunks if a line is too long
Fixes #1096.

Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-01-05 12:28:13 +02:00
Povilas Kanapickas
9964604b17 Extract container_to_build_args()
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-30 00:52:45 +02:00
Songmin Li
ac7ec5c166
Support network level mac_address attribute
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-29 22:59:58 +08:00
Songmin Li
346f7a57f0 Ignore creating networks on network_mode=bridge.
When using bridge mode, podman-compose will use the default `podman` network.
We do not need to create this network, so just return as other network_mode.

Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-21 22:52:37 +02:00
Songmin Li
55642247e3 Add integration test for network scoped aliases
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-21 22:52:37 +02:00
Songmin Li
978a1381bc Support network scoped service aliases
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-21 22:52:37 +02:00
Songmin Li
4a232f5e32 Merge single and multi network handling in get_net_args_from_networks()
The behavior has not changed, single-network has a special case.

Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 20:00:17 +02:00
Songmin Li
aa8c6fd598 Simplify network handling in get_net_args_from_networks()
Note that multiple_nets is now guaranteed to be not empty in processing
stage.

Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 20:00:15 +02:00
Songmin Li
fb0bbd6fe1 Cleanup network alias processing
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 20:00:13 +02:00
Songmin Li
b324029f25 Simplify network name processing when there is single network
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 20:00:11 +02:00
Songmin Li
590c371db2 Move network alias processing to common location
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 20:00:06 +02:00
Povilas Kanapickas
16196a1f6d Simplify ip address processing in get_net_args_from_networks()
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-18 19:59:28 +02:00
Songmin Li
2dfbb59097 Extract multiple network handling in get_net_args_from_networks()
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 19:59:27 +02:00
Songmin Li
a34d1d1a31 Remove unused ip_assignments in get_net_args_from_networks()
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 19:59:26 +02:00
Songmin Li
d6da65e6c9 Extract get_net_args_from_networks()
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 19:59:25 +02:00
Songmin Li
de2c33d7ae Simplify get_net_args_from_network_mode()
This commit takes into account that network_mode won't have networks
attribute set, accordingly get_net_args_from_network_mode() can
calculate complete net_args easily.

Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 19:59:24 +02:00
Povilas Kanapickas
2891be01d7 Ensure that network_mode and networks are not present at the same time
See
https://docs.docker.com/reference/compose-file/services/#network_mode

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-18 19:59:23 +02:00
Songmin Li
a023dc145b Extract get_net_args_from_network_mode()
Modified-by: Povilas Kanapickas <povilas@radix.lt>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 19:59:22 +02:00
Songmin Li
2cfc617f9e
Support docker-compose like default network behavior
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 08:48:21 +08:00
Jeremy Visser
054c66b568 Add device_cgroup_rules support
"device_cgroup_rules: []" is defined in the Compose file specification,
and corresponds to "podman run --device-cgroup-rule="

Signed-off-by: Jeremy Visser <jeremy@visser.name>
2024-12-06 08:19:54 +11:00
Felix Rubio
145ae47c48 Simplified statements to retrieve keys from dictionaries
Signed-off-by: Felix Rubio <felix@kngnt.org>
2024-12-02 22:13:10 +02:00
Felix Rubio
a67fa0beb5 Adding support for conditional dependencies
Signed-off-by: Felix Rubio <felix@kngnt.org>
2024-12-02 22:13:10 +02:00
Felix Rubio
3ba0396e7a Normalize depends_on service property
Signed-off-by: Felix Rubio <felix@kngnt.org>
Modified-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-02 22:08:48 +02:00
Felix Rubio
973e15ba23 Wrap dependencies within a class
Signed-off-by: Felix Rubio <felix@kngnt.org>
Modified-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-02 22:08:48 +02:00
Felix Rubio
002c2e400b Extract run_container()
Signed-off-by: Felix Rubio <felix@kngnt.org>
Modified-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-02 22:00:59 +02:00
Timon de Groot
db0aad97bd podman-compose down removes networks
Fixes #490

Signed-off-by: Timon de Groot <timon.degroot@hypernode.com>
2024-10-21 08:31:09 +02:00
Povilas Kanapickas
a3fb4b373a
Merge pull request #1058 from banditopazzo/705-ssh-key-support-in-build
feat: add support for ssh property in the build command
2024-10-15 03:18:41 +03:00
banditopazzo
ab33954f6c add ssh support for build command
Fixes #705: Add support for ssh property in the build command

Signed-off-by: Domenico Salvatore <banditopazzo@gmail.com>
2024-10-15 00:35:10 +02:00
Timon de Groot
90f54b9ca5 Add x-podman.no_hosts extension
Signed-off-by: Timon de Groot <timon.degroot@hypernode.com>
2024-10-14 17:02:36 +02:00
Chris Shucksmith
4a7329b9e3 Revert "Use defined environment variables in the image build process"
This reverts commit 901adf47d0.
fixes #985 and #931

Signed-off-by: Chris Shucksmith <chris@shucksmith.co.uk>
2024-09-06 23:12:09 +03:00
legobt
ea239c4b77
Simplify secrets assignment
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:01:16 +00:00
legobt
9fdee76858
Initialize default values in PodmanCompose constructor
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:01:08 +00:00
legobt
0a6e0a35e1
Fix services replicas type
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:00:40 +00:00
legobt
26e6651d6c
Type hints via annotations
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:00:36 +00:00
legobt
462603383c
Remove is_dict,is_str for better pyright inference
When support for python3.8 and python3.9 has been dropped, it will be possible to eat the cak and
have it due to PEP-647.

Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:00:30 +00:00
legobt
ed58ac0879
clean up redundant default_net variable
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-01 23:16:13 +00:00
legobt
305f25b4d6
clean up redundant proj_name
- remove unutilized proj_name parameter from volume_ls

Signed-off-by: legobt <6wbvkn0j@anonaddy.me>

proj_name
2024-08-01 23:16:13 +00:00
Povilas Kanapickas
585d344d0a
Merge pull request #1004 from lisongmin/substitution-with-service-environment
Substitution with service environment
2024-07-27 00:06:46 +03:00
Songmin Li
b5eaf314ad Support variable substitution with service's environment
This commit introduces the ability to substitute environment variables
within the 'environment' section of the service definition.

This allows for more dynamic configuration of services.

Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-07-27 00:04:06 +03:00
Beat Küng
b3c49df6eb podman_compose.py: support "platform" property in the build command
This was already added to container_to_args() in https://github.com/containers/podman-compose/pull/470
which is used for the 'up' and 'run' commands.

Definition in the schema: https://github.com/compose-spec/compose-spec/blob/main/schema/compose-spec.json#L329

Signed-off-by: Beat Küng <beat-kueng@gmx.net>
2024-07-26 23:58:11 +03:00
Jason Chua
7d7e64fe5a
Update docs+messages to reflect uidmaps/gidmaps code
Signed-off-by: Jason Chua <jasonc1804@gmail.com>
2024-07-22 20:54:41 -07:00
bg
e2eb883709 Add --network=none if network_mode: none is set; fixes #1001.
Signed-off-by: bg <bg@nerilex.org>
2024-07-17 01:41:04 +03:00