Compare commits

...

791 Commits
v1.0.3 ... main

Author SHA1 Message Date
Povilas Kanapickas 61392e9cba
Merge pull request #1243 from mokibit/fix-dockerfile-definition
Fix dockerfile definition if directory name ends with ".git"
2025-06-17 19:53:15 +03:00
Monika Kairaityte dd471c8918 Fix dockerfile definition if directory name ends with ".git"
After changes in 92f0a8583a, the
dockerfile parameter is igored if the (local) work directory's name ends
in `.git`.
This commit fixes the regression and adds more tests.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-17 19:43:29 +03:00
Povilas Kanapickas 1113c833da
Merge pull request #1242 from uosis/docker-compat
Add docker_compose_compat setting
2025-06-16 12:04:47 +03:00
Uosis 4177bae807 Add docker_compose_compat setting
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-15 18:31:06 -06:00
Povilas Kanapickas fa2252801a
Merge pull request #1241 from uosis/name-separator
Add support for using hyphens for name separation
2025-06-15 21:04:19 +03:00
Uosis 6635b8b570 cleanup bool parsing
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-13 19:20:09 -06:00
Uosis 8f55227167 add name_separator_compat
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-13 19:20:09 -06:00
Povilas Kanapickas 9cde3993f2
Merge pull request #1238 from uosis/env-var-override
Add support for providing x-podman settings using environment variables
2025-06-11 22:38:25 +03:00
Povilas Kanapickas 04155d0d09 Add documentation for env variables
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-11 22:31:56 +03:00
uosis 605495233e allow overriding x-podman using env vars 2025-06-11 22:27:45 +03:00
Povilas Kanapickas 3e579f65f0
Merge pull request #1235 from p12tic/readme
Update README
2025-06-05 18:34:40 +03:00
Povilas Kanapickas 034b86ea73 README: Remove basic usage section
There are plenty of resources on compose format, no need to repeat
anything. Beginners won't be helped by the examples and experienced
users will look into better places anyway.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:19 +03:00
Povilas Kanapickas bbdb63604e README: Update section on tests
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:18 +03:00
Povilas Kanapickas 93371b0f4e README: Merge all repositories under single section
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:17 +03:00
Povilas Kanapickas 27d1fc67a0 README: Add installation instructions on Debian
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:16 +03:00
Povilas Kanapickas 77bc9c5602
Merge pull request #1234 from p12tic/release-notes
Release notes for 1.4.1
2025-06-05 17:20:19 +03:00
Povilas Kanapickas 82dd0acab2 Release notes for 1.4.1
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 17:12:49 +03:00
Povilas Kanapickas 0e4f686f4b
Merge pull request #1231 from mokibit/fix-volume-bind-source
Fix relative host path resolution for volume bind mount source
2025-06-05 16:56:18 +03:00
Monika Kairaityte 0491269f53 Fix relative host path resolution for volume bind mount source
e03d675b9b broke relative host path
resolution by deleting os.chdir(). After this commit current working
directory is not relevant anymore.

Fixes e03d675b9b.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-05 16:46:07 +03:00
Povilas Kanapickas ee90712843
Merge pull request #1210 from jarovo/main
Add relabel option to secrets
2025-06-05 13:02:18 +03:00
Jaroslav Henner 82d7622c45
Add relabel option to secrets
On selinux enabled system, the secrets cannot be read without proper
relabeling or correct policy being set.

This patch enables user to instruc podman-copose to use :z or :Z podman
volume options to make podman relabel the file under bind-mount.

More info here:
https://unix.stackexchange.com/questions/728801/host-wide-consequences-of-setting-selinux-z-z-option-on-container-bind-mounts?rq=1

Signed-off-by: Jaroslav Henner <1187265+jarovo@users.noreply.github.com>
2025-06-05 00:13:58 +02:00
Povilas Kanapickas 4c6df85efa
Merge pull request #1224 from p12tic/podman-label
Expose io.podman.compose.service label
2025-05-29 22:18:42 +03:00
Povilas Kanapickas 7b3276e5d7 Expose io.podman.compose.service label
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-29 22:01:35 +03:00
Povilas Kanapickas fc6bfc9931
Merge pull request #1223 from p12tic/github-mypy
.github: Run mypy as part of checks
2025-05-29 21:38:59 +03:00
Povilas Kanapickas 949af2a50c .github: Run mypy as part of checks
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-29 21:23:21 +03:00
Povilas Kanapickas b650efbb33
Merge pull request #1222 from mokibit/print-full-dockerfile-path
Print full Dockerfile path instead of context on error
2025-05-28 17:34:45 +03:00
Monika Kairaityte 0b8b483cb7 Print full dockerfile path instead of context on error
Current error message does not provide the exact path where the
Dockerfile is being searched.

This commit distinguishes two types of errors when Dockerfile is not
found in build context:
- when the context does not have provided custom-named Dockerfile, the
path in the error message is absolute: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file/custom-named-Dockerfile"
- when the context does not have any Dockerfile, the path in the error
message is: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file"
Only this error message was used before the fix.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Co-authored-by: Siteshwar Vashisht <svashisht@redhat.com>
2025-05-28 16:19:38 +03:00
Povilas Kanapickas 0dcc864fdd
Merge pull request #1205 from mokibit/add-missing-init-py-files
tests/integration: Add missing __init__.py files to actually run tests and fix the broken ones
2025-05-26 22:27:48 +03:00
Monika Kairaityte 56238b10e3 tests/integration: Fix `service_scale` tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-26 18:19:11 +03:00
Monika Kairaityte d4ebf62e0e tests/integration: Fix `lifetime` tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-26 18:19:11 +03:00
Monika Kairaityte 83c7e9462e tests/integration: Add missing __init__.py files to actually run tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-24 22:09:30 +03:00
Povilas Kanapickas 835e3abe95
Merge pull request #1220 from p12tic/types
Enforce types using mypy
2025-05-24 17:35:52 +03:00
Povilas Kanapickas 248a63ebb0 test-requirements: Upgrade ruff
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:26:42 +03:00
Povilas Kanapickas efea0ee652 Address unused argument warnings
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:26:31 +03:00
Povilas Kanapickas 3c2978c9ca examples: Add type annotations
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:19:29 +03:00
Povilas Kanapickas 5765e5306b Use correct logging methods
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:19:29 +03:00
Povilas Kanapickas 0be50ffdfb Fix return value from compose_systemd()
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:19:29 +03:00
Povilas Kanapickas 1eae76ddca Add return type annotations to test_utils.py
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:19:29 +03:00
Povilas Kanapickas 6c46678082 Fix mypy warnings
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:19:29 +03:00
Povilas Kanapickas a3f48f830d tests/integration: Add type annotations
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:11:38 +03:00
Povilas Kanapickas dedb081550 tests/unit: Add type annotations
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:11:36 +03:00
Povilas Kanapickas ea22227625 Add mypy configuration
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 17:11:33 +03:00
Povilas Kanapickas 6b2665683c
Merge pull request #1211 from p12tic/tests-importable-directories
Move tests to directories that can be imported
2025-05-24 17:09:03 +03:00
Povilas Kanapickas 58df8497aa Move tests to directories that can be imported
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 16:47:49 +03:00
Povilas Kanapickas 741cb008c8
Merge pull request #1213 from p12tic/fixes
Miscellaneous code quality fixes
2025-05-24 16:05:18 +03:00
Povilas Kanapickas 39e21d8c11 Remove extraneous await on non-async function
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 15:29:53 +03:00
Povilas Kanapickas 02166f584a Use more standard call to list.append
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 15:29:53 +03:00
Povilas Kanapickas 8aeeafb98c Rename redefined variables
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 15:29:53 +03:00
Povilas Kanapickas 9162fe6438 Remove unused code
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-24 15:29:49 +03:00
Povilas Kanapickas cc10a61017
Merge pull request #1218 from mokibit/fix-build-ssh-path
Fix build ssh path to be relative to directory of compose file
2025-05-24 15:25:31 +03:00
Monika Kairaityte 08d06df0f2 Fix build ssh path to be relative to directory of compose file
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-24 12:58:59 +03:00
Povilas Kanapickas c26e188991
Merge pull request #1214 from mokibit/fix-cmd-healthcheck
Fix CMD healthchecks running with `/bin/sh`
2025-05-21 15:52:43 +03:00
Monika Kairaityte a983129e88 tests/unit: Add unit tests for fixing CMD healthcheck
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-20 16:54:25 +03:00
Ben Krieger 76b3055934 Fix CMD healthchecks running with /bin/sh
Signed-off-by: Ben Krieger <ben.krieger@intel.com>
2025-05-20 16:54:25 +03:00
Povilas Kanapickas f5e3162e91
Merge pull request #1212 from p12tic/normalize-depends-unittest
tests: Rewrite test_normalize_depends_on to unittest
2025-05-19 18:26:45 +03:00
Povilas Kanapickas 225999eab1 tests: Rewrite test_normalize_depends_on to unittest
This test was forgotten about during initial migration.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-19 17:56:28 +03:00
Povilas Kanapickas b86f8b1d61
Merge pull request #1201 from Norbiros/feat/custom-pod-name
Allow specifying custom pod name in `--in-pod`
2025-05-18 18:59:58 +03:00
norbiros 3d47849d28 Allow specifying custom pod name in `--in-pod`
Fixes #958: missing or incorrect use of --in-pod and pod-args
Fixes #693: --in-pod 'name' no function

Signed-off-by: norbiros <norbiros@protonmail.com>
Signed-off-by: Norbiros <norbiros@protonmail.com>
2025-05-18 18:46:15 +03:00
Povilas Kanapickas bfaf77a506
Merge pull request #1208 from mokibit/reset-depends-on
Fix reset tag attribute to also reset `depends_on` parameter
2025-05-18 18:42:52 +03:00
Monika Kairaityte 0c1c4ffea9 Fix reset tag attribute to also reset `depends_on` parameter
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-16 22:33:00 +03:00
Povilas Kanapickas 98f065b3e2
Merge pull request #1203 from mokibit/fix-test-paths-for-reset-override-tags
tests/integration: Fix paths to compose.yaml files for testing override and reset tags
2025-05-16 22:23:14 +03:00
Monika Kairaityte 6e30673260 tests/integration: Fix paths for testing override and reset tags
Tests were not run due to missing __init__.py files.
This commit adds missing files and fixes paths to compose.yaml files.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-16 21:51:11 +03:00
Povilas Kanapickas 9c09789948
Merge pull request #1193 from marat2509/main
feat(systemd): add unregister command to remove systemd service registration
2025-05-13 02:22:37 +03:00
Marat Budkevich 01214fa013 Add unregister command to remove systemd service registration
Signed-off-by: marat2509 <marat2509@users.noreply.github.com>
2025-05-12 22:53:09 +03:00
Povilas Kanapickas bd29caa797 Release 1.4.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-10 15:24:32 +03:00
Povilas Kanapickas f0928dd399
Merge pull request #1197 from p12tic/release
Release notes for 1.4.0
2025-05-10 15:23:07 +03:00
Povilas Kanapickas 6c9c09197a Release notes for 1.4.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-10 15:03:54 +03:00
Povilas Kanapickas cda84f439f
Merge pull request #1181 from zeyugao/main
Return non-zero exit_code on failure when doing `up -d`
2025-05-10 14:44:41 +03:00
Elsa 67616bdaac Handle exit code when compose up -d
Signed-off-by: Elsa <zeyugao@outlook.com>
2025-05-10 14:38:53 +03:00
Povilas Kanapickas 7497692b19
Merge pull request #1184 from schnell18/main
Fix service_healthy condition enforcing
2025-05-10 14:20:06 +03:00
Justin Zhang 782c44d4c3 tests: Style cleanup
Signed-off-by: Justin Zhang <schnell18@gmail.com>
2025-05-10 14:12:28 +03:00
Justin Zhang d7762a54f0 Fix service_healthy condition enforcing
Skip dependency health check to avoid compose-up hang for podman prior
to 4.6.0, which doesn't support --condition healthy.

Signed-off-by: Justin Zhang <schnell18@gmail.com>
2025-05-10 14:12:27 +03:00
Justin Zhang eba2ca2695 Skip running compose-down during up when there are no active containers
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-10 14:12:18 +03:00
Justin Zhang abe5965c9a tests: Improve reliability of network tests
The test did fail on my laptop with podman 5.4.1.

Signed-off-by: Justin Zhang <schnell18@gmail.com>
2025-05-10 14:10:22 +03:00
Justin Zhang 9e0da82726 Change compose-up to create then start container to avoid double exec
Signed-off-by: Justin Zhang <schnell18@gmail.com>
2025-05-10 13:58:23 +03:00
Povilas Kanapickas 6acdafd5b1
Merge pull request #1190 from gtebbutt/abort-on-failure
Add `--abort-on-container-failure` option
2025-05-10 13:51:23 +03:00
Justin Zhang 8638eb9b6d tests: Test selected env variables to improve robustness
Signed-off-by: Justin Zhang <schnell18@gmail.com>
2025-05-10 13:46:26 +03:00
gtebbutt e1d938ffa6 Add --abort-on-container-failure
Signed-off-by: gtebbutt <5956226+gtebbutt@users.noreply.github.com>
2025-05-10 13:41:29 +03:00
Povilas Kanapickas d532e09d7d
Merge pull request #1189 from mokibit/add-merge-reset-override
Implement `override` and `reset` analog to docker-compose
2025-05-08 01:16:15 +03:00
Monika Kairaityte 1dab256cdd tests/integration: Add override tag attribute test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Monika Kairaityte 2a33ef5c79 tests/integration: Add override tag service test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Monika Kairaityte 5ab734026c tests/integration: Add reset tag attribute test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Monika Kairaityte 35dc395483 tests/integration: Add reset tag service test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Monika Kairaityte 38a9263424 integration/tests: Move 'volumes_merge' tests to 'merge' directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Sebastian Sellmeier cbe9587973 Implement override and reset analog to docker-compose
Corresponding Docker compose file documentation:
https://docs.docker.com/reference/compose-file/merge/

Signed-off-by: Sebastian Sellmeier <mail@sebastian-sellmeier.de>
Co-authored-by: Monika Kairaityte <monika@kibit.lt>
2025-04-30 23:37:05 +03:00
Povilas Kanapickas 8bb43100b1
Merge pull request #1182 from zeyugao/pids_limit
Implement pids_limit
2025-04-21 23:50:31 +03:00
Elsa 98f166d2e4 Implement pids_limit
Signed-off-by: Elsa <zeyugao@outlook.com>
2025-04-21 22:51:37 +03:00
Povilas Kanapickas 150ab02446
Merge pull request #1187 from rgasquet/feature/add-cpuset-option
Feature: add cpuset option
2025-04-21 22:49:08 +03:00
Romain Gasquet ff58a0bff0 Add newsfragment
Signed-off-by: Romain Gasquet <romain.gasquet@neutron.fr>
2025-04-19 14:33:15 +02:00
Romain Gasquet 8d899ebb65 Feature: add cpuset option
Signed-off-by: Romain Gasquet <romain.gasquet@neutron.fr>
2025-04-19 14:10:30 +02:00
Povilas Kanapickas 342a39dcfe
Merge pull request #1179 from knarfS/fix_port_cmd
Fix port command
2025-04-14 18:05:53 +03:00
Povilas Kanapickas d6b8476573
Merge pull request #1180 from knarfS/add_rmi_arg
Add rmi argument for down command
2025-04-14 18:04:09 +03:00
Frank Stettner ae41ef08c3 tests/integration: Improve tests for port command
Refs #778 and #1039

Signed-off-by: Frank Stettner <frank-stettner@gmx.net>
2025-04-10 07:51:39 +02:00
Frank Stettner da46ee3910 Fix port command for dynamic host ports
Use `podman inspect` to get the actual host ports rather echoing the
defined ports from the compose yml.

Fixes #778 and #1039

Signed-off-by: Frank Stettner <frank-stettner@gmx.net>
2025-04-08 13:57:19 +02:00
Frank Stettner d80c31f578 tests/integration: Add tests for up and down command
Refs #387

Signed-off-by: Frank Stettner <frank-stettner@gmx.net>
2025-04-08 13:53:27 +02:00
Frank Stettner cefa68dc75 Implement rmi argument for down command
Fixes #387

Signed-off-by: Frank Stettner <frank-stettner@gmx.net>
2025-04-08 13:53:27 +02:00
Povilas Kanapickas 2e46ff0db2
Merge pull request #1159 from me-coder/container_scaling_update
Updates handling of scale/replicas parameter in CLI and compose file
2025-04-08 02:54:32 +03:00
Yashodhan Pise fbc4c7da80 Integration tests for container scaling changes
Signed-off-by: Yashodhan Pise <technoy@gmail.com>
2025-04-08 01:42:03 +03:00
Yashodhan Pise 11879d3e94 Updates handling of scale/replicas through CLI & compose file
Signed-off-by: Yashodhan Pise <technoy@gmail.com>
2025-04-08 01:37:15 +03:00
Yashodhan Pise 27cf8da06f Addition of relevant newsfragments file
Signed-off-by: Yashodhan Pise <technoy@gmail.com>
2025-04-05 20:32:58 +05:30
Povilas Kanapickas 10a30ba24a
Merge pull request #1173 from mokibit/automate-ulimit-test
tests/integration: Automate manual `ulimit` test
2025-04-04 17:12:42 +03:00
Monika Kairaityte a1be62fd31 tests/integration: Automate manual ulimit test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-04 16:31:26 +03:00
Povilas Kanapickas 15bf02a004
Merge pull request #1175 from mokibit/automate-volumes-merge-test
tests/integration: Automate manual `volumes_merge` test
2025-04-04 16:31:03 +03:00
Monika Kairaityte e45b5d5063 tests/integration: Automate manual `volumes_merge` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-04-04 15:22:45 +03:00
Povilas Kanapickas c46ecb226b
Merge pull request #1171 from mokibit/fix-git-build-url-context
Fix using git URL as build context
2025-03-31 00:26:56 +03:00
Monika Kairaityte e04b8f3a60 tests/integration: Add integration test for buid git URL as context
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-30 21:56:55 +03:00
Monika Kairaityte 815450aba9 tests/unit: Add test for buid git URL as context
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-30 21:56:55 +03:00
Monika Kairaityte 92f0a8583a Fix using git URL as build context
Podman-compose actually did not work with git URL as build context.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-30 21:56:55 +03:00
Monika Kairaityte 5f4fc4618c Add os.path.normpath to normalize dockerfile pathname
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-28 22:28:30 +02:00
Povilas Kanapickas 4d899edeb3
Merge pull request #1166 from piotr-kubiak/megre-args
Allow merging of args in both list and dict syntax
2025-03-24 13:35:31 +02:00
Piotr Kubiak f9489afaf5 Allow merging of args in both list and dict syntax
Signed-off-by: Piotr Kubiak <piotr-kubiak@users.noreply.github.com>
2025-03-24 13:31:19 +02:00
Povilas Kanapickas 7d7533772b
Merge pull request #1165 from drachenfels-de/fix-project-name-interpolation
Fix `COMPOSE_PROJECT_NAME` interpolation
2025-03-20 19:26:03 +02:00
Ruben Jenster 65b455f081 Fix project name evaluation order
The COMPOSE_PROJECT_NAME environment variable must override the
top-level name: attribute in the Compose file.

The precedence order is defined in the docker compose documentation
https://docs.docker.com/compose/how-tos/project-name/#set-a-project-name

Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2025-03-20 12:07:07 +01:00
Ruben Jenster 1aa750bacf integration/tests: Test project name override with COMPOSE_PROJECT_NAME env variable
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2025-03-20 12:07:07 +01:00
Ruben Jenster 98b9bb9f8e Fix interpolation for COMPOSE_PROJECT_NAME
Fixes #1073

Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2025-03-20 12:07:07 +01:00
Ruben Jenster 170411de8b test/integration: Test COMPOSE_PROJECT_NAME interpolation
Refs #1073

Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2025-03-20 12:07:01 +01:00
Povilas Kanapickas 0cf1378cb5
Merge pull request #1148 from mokazemi/fix/sigint-down
Handle SIGINT when running "up" command to shutdown gracefully
2025-03-20 00:14:11 +02:00
Mohammad Kazemi f5a6df6dc4 added changes to release notes
Signed-off-by: Mohammad Kazemi <mokazemi@disroot.org>
2025-03-19 16:02:34 +03:30
Mohammad Kazemi f106ea0c01 modifications to pass pylint test
Signed-off-by: Mohammad Kazemi <mokazemi@disroot.org>
2025-03-19 15:55:55 +03:30
Mohammad Kazemi b748c2666c add try-except block to handle error in case of shutdown error
Signed-off-by: Mohammad Kazemi <mokazemi@disroot.org>
2025-03-19 15:55:50 +03:30
Mohammad Kazemi 3973c476c4 catch SIGINT signal properly in 'up' function and call compose 'down' function for a graceful shutdown
Signed-off-by: Mohammad Kazemi <mokazemi@disroot.org>
2025-03-19 15:55:38 +03:30
Povilas Kanapickas 8b1bd0123c
Merge pull request #1168 from underground-software/build_exit
Properly surface errors from build commands
2025-03-19 12:50:16 +02:00
charliemirabile 2e7d83f7f0 Properly surface errors from build commands
the commit 38b13a3 ("Use asyncio for subprocess calls") broke the way
exit codes are reported from the podman compose build command.

The tasks are awaited as they finish which means that if a later build
finishes sucessfully after a failing build, it overwrites status.

Previously the `parse_return_code` function would skip updating the status
if the new return code was zero, but in removing it, this logic was not
carried forward.

Fixes: 38b13a3 ("Use asyncio for subprocess calls")
Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
2025-03-18 21:49:55 -04:00
Povilas Kanapickas 52e2912e0b
Merge pull request #1157 from mokibit/automate-selinux-test
test/integration: Automate manual `selinux` test
2025-03-11 18:15:55 +02:00
Monika Kairaityte 8ef537e247 test/integration: Automate manual `selinux` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-06 13:04:53 +02:00
Povilas Kanapickas 04fcc26a79
Merge pull request #1117 from rjeffman/no_exception_if_service_is_not_in_compose
Don't raise exception on inexistent services in 'down' command
2025-03-05 22:17:10 +02:00
Rafael Guterres Jeffman d4760712b7 Don't raise exception on inexistent services in 'down' command
When running 'podman-compose down <service>', if service is not part of
the compose, a KeyError exception is raised in function 'get_excluded'.

By only allowing evaluation of services that exist in the compose
provides a cleaner and gentler exit for this case.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-03-05 15:49:52 -03:00
Povilas Kanapickas 7c61f24467
Merge pull request #1158 from mokibit/automate-uidmaps-test
test/integration: Automate manual `uidmaps` test
2025-03-04 23:41:55 +02:00
Monika Kairaityte 202c3771a9 test/integration: Automate manual `uidmaps` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-03-04 22:28:50 +02:00
Povilas Kanapickas a54f0fa573
Merge pull request #1149 from AlexandreAANP/fix/windows-asyncio-loop
Fix event loop handling for Windows platform in compose_up function
2025-03-01 16:43:26 +02:00
Povilas Kanapickas 3353697402
Merge pull request #1152 from IamTheFij/config-quiet
Add quiet flag to podman-compose config
2025-03-01 16:42:20 +02:00
Povilas Kanapickas ca1b59c449
Merge pull request #1153 from IamTheFij/dco-hook
Add hook to check for signoff in commit messages
2025-03-01 16:39:50 +02:00
Ian Fijolek b9f27795c0 Add hook to check for signoff in commit messages
Since this is checked on PR, it could also be checked at commit so users can avoid making commits to
the tree without expected documentation.

Signed-off-by: Ian Fijolek <ian@iamthefij.com>
2025-02-28 13:05:54 -08:00
Ian Fijolek 4cd1642be0 Add quiet flag to podman-compose config
This skips printing and is useful for validating config files.

Signed-off-by: Ian Fijolek <ian@iamthefij.com>
2025-02-28 12:48:08 -08:00
Alexandre Pita fd401331e5 added release note to newsfragment directory
Signed-off-by: Alexandre Pita <alexandreanpita@gmail.com>
2025-02-27 11:45:38 +00:00
Alexandre Pita 37b27fa233 Refactor event loop handling to simplify logic for Windows platforms
Signed-off-by: Alexandre Pita <alexandreanpita@gmail.com>
2025-02-26 17:28:59 +00:00
Povilas Kanapickas 976847ef9b
Merge pull request #1143 from italomaia/bug/use-ruff
Bug: replaced black with ruff on pre-commit
2025-02-26 18:21:31 +02:00
Italo Maia c6b3d497d6 Adds lint exclusions already ignored by the code
Added flake8 excludes to rules that are already ignored by the current
code to avoid validation issues with code that has already been
approved. Added pylint disable to line with lint offense already
accepted.

Signed-off-by: Italo Maia <italo.maia@gmail.com>
2025-02-26 17:57:34 +02:00
Italo Maia 10ad739746 Replaces black with ruff on pre-commit-config
Current python files are already compatible with ruff, while very
incompatible with black standard therefore, this change just enforces
the reality of the codebase. Without it, pre-commit and the ci will
fight one-another with different formatting.

Signed-off-by: Italo Maia <italo.maia@gmail.com>
2025-02-26 17:57:20 +02:00
Alexandre Pita 784d798dac Fix event loop handling for Windows platform in compose_up function
Signed-off-by: Alexandre Pita <alexandreanpita@gmail.com>
2025-02-26 14:38:46 +00:00
Povilas Kanapickas dd01d039bf
Merge pull request #1140 from whym/rename-comment
Fix comment, add tests, improve coding style
2025-02-25 02:02:23 +02:00
Yusuke Matsubara 81a0a5933e Add more logging tests
Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-02-25 01:52:45 +02:00
Yusuke Matsubara c289a3b827 Fix logging test coding style
Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-02-25 01:52:39 +02:00
Yusuke Matsubara baccce4f3f Fix comments related to logging
Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-02-25 01:38:41 +02:00
Povilas Kanapickas 07af8488db
Merge pull request #1147 from joern19/main
Allow configuration of interface_name
2025-02-24 01:26:38 +02:00
Jörn Hirschfeld cbc5a8c8b3 Add newsfragment for interface_name option
Signed-off-by: Jörn Hirschfeld <joern@hirschfeld.tech>
2025-02-23 17:08:06 +01:00
Jörn Hirschfeld aeaceed7ba integration test for x-podman.interface_name option
Signed-off-by: Jörn Hirschfeld <joern@hirschfeld.tech>
2025-02-23 17:08:00 +01:00
Jörn Hirschfeld b1eb558b41 Document existence of x-podman.interface_name
Signed-off-by: Jörn Hirschfeld <joern@hirschfeld.tech>
2025-02-23 17:04:10 +01:00
Jörn Hirschfeld 1cdc9e6552 interface_name can be specified in net_config_
Signed-off-by: Jörn Hirschfeld <joern@hirschfeld.tech>
2025-02-23 17:04:10 +01:00
Povilas Kanapickas 2f8ed2137c
Merge pull request #1144 from mokibit/automate-secrets-tests
test/integration: Automate manual `secrets` test
2025-02-20 09:57:11 +02:00
Monika Kairaityte 838957b902 test/integration: Automate manual 'secrets' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-19 21:42:52 +02:00
Povilas Kanapickas 15380a809d
Merge pull request #1135 from rpluem-vf/keep_fds_open
Do not close file descriptors when executing podman
2025-02-18 13:26:15 +02:00
Ruediger Pluem d4e5859370 Do not close file descriptors when executing podman
Do not close file descriptors when executing podman. This allows
externally created file descriptors to be passed to containers.
These file descriptors might have been created through systemd
socket activation. See also
https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md#socket-activation-of-containers

Signed-off-by: Ruediger Pluem <ruediger.pluem@vodafone.com>
2025-02-12 11:35:51 +01:00
Povilas Kanapickas 593d7c825e
Merge pull request #1138 from mokibit/automate-seccomp-test
tests/integration: Automate manual `seccomp` test
2025-02-07 22:46:39 +02:00
Monika Kairaityte bfba7ba32d tests/integration: Automate manual `seccomp` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-07 22:38:58 +02:00
Povilas Kanapickas fe9be2d98f
Merge pull request #1133 from neocturne/pod-args
Implement x-podman.pod_args to override --pod-args default
2025-02-07 20:59:36 +02:00
Matthias Schiffer 43a2f1d01f
Implement x-podman.pod_args to override --pod-args default
Allow setting an argument list as x-podman.pod_args to override the
default value `--infra=false --share=`. `--pod-args` passed on the command
line takes precedence over the value set in docker-compose.yml; the values
are not merged.

Fixes #1057.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2025-02-07 12:11:19 +01:00
Povilas Kanapickas aa47a373ca
Merge pull request #1132 from mokibit/describe-test_pid
tests/integration: Describe `pid` test
2025-02-06 15:29:42 +02:00
Monika Kairaityte eaec19336f tests/integration: Describe `pid` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-06 15:16:44 +02:00
Povilas Kanapickas 34bee28bb8
Merge pull request #1131 from mokibit/automate-test-no_services
tests/integration: Automate manual `no_services` test
2025-02-05 20:53:38 +02:00
Monika Kairaityte bfea139362 tests/integration: Automate manual `no_services` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-05 20:47:59 +02:00
Povilas Kanapickas 4a81bce2a5
Merge pull request #1130 from mokibit/automate-nets_test_ip
tests/integration: Automate manual `nets_test_ip` test
2025-02-05 20:44:07 +02:00
Monika Kairaityte e626f15eff tests/integration: Automate manual `nets_test_ip` test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-05 19:31:43 +02:00
Povilas Kanapickas 974250caa5
Merge pull request #1128 from mokibit/automate-nets_test3
tests/integration: Automate manual `nets_test3` test
2025-02-03 22:59:45 +02:00
Monika Kairaityte 29404af723 tests/integration: Automate manual 'nets_test3' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-02-03 19:04:15 +02:00
Povilas Kanapickas d1ba2f4c7d
Merge pull request #1124 from notdian/file_not_found_error
remove incorrect os.chdir, handle relative extends/includes
2025-01-31 01:48:13 +02:00
notdian e03d675b9b Remove incorrect os.chdir call to fix folder error
Signed-off-by: notdian <dian@fishekqi.com>
2025-01-31 01:24:24 +02:00
Povilas Kanapickas 51d180d2d0
Merge pull request #1120 from mokibit/inform-user-to-use-newer-python
Throw a readable error on too old Python
2025-01-27 21:53:24 +02:00
Povilas Kanapickas 9c905f9012
Merge pull request #1116 from Zeglius/dockerfile_inline
Add support for dockerfile_inline
2025-01-27 21:52:05 +02:00
Monika Kairaityte bdb3e4e984 Throw a readable error on too old Python
podman-compose v1.0.6 is the last to support Python3.6. When newer
podman-compose version is used with too old Python, podman-compose gives
only a confusing error. This commit gives a clear message to use
upgraded Python version.
A descriptive error can not be thrown, as line "from __future__ imports"
must occur at the beginning of the file, but older Python (older than
Python3.7) does not recognize __future__ and throws an error
immediately.
Therefore, a comment is used to inform the user to update his Python
version.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-27 21:49:50 +02:00
Zeglius 105e390f6b Add support for dockerfile_inline
Fixes #864

Signed-off-by: Zeglius <33781398+Zeglius@users.noreply.github.com>
2025-01-27 21:45:42 +02:00
Povilas Kanapickas d79ff01e77
Merge pull request #1113 from mokibit/categorize-integration-tests
tests/integration: Categorize integration tests
2025-01-23 02:17:08 +02:00
Monika Kairaityte d9ef3d2cc6 tests/integration: Add missing __init__.py for network_scoped_aliases
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte d23ef4f481 tests/integration: Add missing __init__.py for build_labels test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte b685bce400 tests/integration: Move test utils to one test_utils file
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 7d5bf645f6 tests/integration: Move test "vol" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 9f7ae38bac tests/integration: Move test "ports" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 3cee4e015c tests/integration: Move test "config" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 498a1994ce tests/integration: Move test "env" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 488908f809 tests/integration: Move test "env_file" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte f7bcc4221e tests/integration: Move test "up_down" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte a73df712cc tests/integration: Move test "build_ulimits" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 50dc19f5f8 tests/integration: Move test "network" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 9029dce0f6 tests/integration: Move test "nets_test2" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte a8282c77d6 tests/integration: Move test "nets_test1" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte f4b775c7e4 tests/integration: Move test "nethost" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte adf30e0475 tests/integration: Move test "multicompose" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 41675c3916 tests/integration: Move test "ipam_default" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 6caf2eae42 tests/integration: Move test "interpolation" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 3093b00326 tests/integration: Move test "include" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 1c21d655ba tests/integration: Move test "in_pod" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 18e5fd64f3 tests/integration: Move test "filesystem" to corresponding dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 24bdfd1e17 tests/integration: Move test "extends_w_file_subdir" to corresp. dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte c2d3e156c2 tests/integration: Move test "extends_w_file" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte ba95100cff tests/integration: Move test "extends_w_empty_service" to corresp. dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:11:46 +02:00
Monika Kairaityte 6022669991 tests/integration: Move test "extends" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:01:44 +02:00
Monika Kairaityte e29df71d42 tests/integration: Move test "exit_from" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 02:01:44 +02:00
Monika Kairaityte 21b9d385b2 tests/integration: Move test "deps" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte 4c17ce2434 tests/integration: Move test "default_net_behavior" to corresponding dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte 09d54e9dcc tests/integration: Move test "build_secrets" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte f1dd9b374e tests/integration: Move test "build_fail" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte 87af67fe94 tests/integration: Move test "network_scoped_aliases" to corresp. dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte f1d663874e tests/integration: Move test "build" to corresponding directory
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
Monika Kairaityte 69ffff33f6 tests/integration: Move test "additional_contexts" to corresp. dir
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-01-23 01:48:47 +02:00
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
Povilas Kanapickas 0f2c717655
Merge pull request #1110 from indrat/1105-service-env-vars
expand service environment_variables before adding to subs_dict
2025-01-16 20:13:39 +02: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
Povilas Kanapickas a177603661
Merge pull request #1108 from bailsman/fix-398
Fixes #398: exclude deps on up if --no-deps
2025-01-15 23:51:37 +02: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 60ac5e43b3
Merge pull request #1107 from containers/dependabot/pip/virtualenv-20.26.6
build(deps): bump virtualenv from 20.25.1 to 20.26.6
2025-01-13 22:17:09 +02:00
dependabot[bot] 48c6c38fcd
build(deps): bump virtualenv from 20.25.1 to 20.26.6
Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.25.1 to 20.26.6.
- [Release notes](https://github.com/pypa/virtualenv/releases)
- [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/virtualenv/compare/20.25.1...20.26.6)

---
updated-dependencies:
- dependency-name: virtualenv
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 18:24:07 +00:00
Povilas Kanapickas 84f1fbd622
Merge pull request #1101 from p12tic/post-release-fixes
RELEASING: Fix release command
2025-01-07 21:24:36 +02:00
Povilas Kanapickas ac5291e10b RELEASING: Fix release command
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:18:35 +02:00
Povilas Kanapickas 9cbc4c1dcd Release 1.3.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:16:01 +02:00
Povilas Kanapickas c63d678887
Merge pull request #1100 from p12tic/release
Preparation for release
2025-01-07 21:15:30 +02:00
Povilas Kanapickas 6de335beb2 Release notes for 1.3.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:10:54 +02:00
Povilas Kanapickas 23799245bd Add documentation for how to create a release
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:06:45 +02:00
Povilas Kanapickas eda4815715 scripts: Add script to make new release
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:06:44 +02:00
Povilas Kanapickas cbb0cab814 scripts: Add script to create release notes
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-07 21:06:43 +02:00
Povilas Kanapickas 7c8696b2b2
Merge pull request #1099 from p12tic/python-3.13
Declare compatibility with Python 3.13
2025-01-05 13:20:47 +02:00
Povilas Kanapickas 483103ac3a Declare compatibility with Python 3.13
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-01-05 13:12:43 +02:00
Povilas Kanapickas e9f1029406
Merge pull request #1092 from flixman/main
Provide support for cache_from and cache_to fields
2025-01-05 13:11:53 +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
Povilas Kanapickas 0e3b372a29
Merge pull request #1098 from whym/readline
Fixes #1096: read log output by chunks if a line is too long
2025-01-05 12:32:51 +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 62789a2358
Merge pull request #1094 from p12tic/build-args-test
Add unit tests for image building
2024-12-30 01:04:16 +02:00
Povilas Kanapickas 35cf4bcb72 tests: Add test for container_to_build_args()
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-12-30 00:55:19 +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
Povilas Kanapickas 61fa24bf21
Merge pull request #1093 from lisongmin/add-network-level-mac_address-attr
Support network level mac_address attribute
2024-12-29 18:58:33 +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
Povilas Kanapickas 75d7be2b7b
Merge pull request #1087 from lisongmin/feat-support-network-scoped-aliases
Support network scoped service aliases
2024-12-22 00:54:26 +02: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
Povilas Kanapickas d803c4c3e8
Merge pull request #1088 from lisongmin/feat-default-net-behavior-compat
Support docker-compose like default network behavior
2024-12-18 18:01:50 +02:00
Songmin Li 420d19daf4
Add integration test for default network behavior
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-12-18 13:21:29 +08: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
Povilas Kanapickas 376f0817e6
Merge pull request #1085 from jeremyvisser/fix-device-cgroup-rules
Add device_cgroup_rules support
2024-12-06 11:02:16 +02: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
Povilas Kanapickas d9fc8e91f2
Merge pull request #1082 from flixman/main
Provide support for conditional dependencies
2024-12-02 22:18:53 +02: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
Povilas Kanapickas 626e278794
Merge pull request #1068 from jrnorth/patch-1
Fix Dockerfile link in readme
2024-11-18 22:05:35 +02:00
Povilas Kanapickas a358890d54
Merge pull request #1069 from containers/dependabot/github_actions/softprops/action-gh-release-2
build(deps): bump softprops/action-gh-release from 1 to 2
2024-11-11 21:14:11 +02:00
Povilas Kanapickas 9f3251ff3d
Merge pull request #1070 from containers/dependabot/github_actions/actions/checkout-4
build(deps): bump actions/checkout from 2 to 4
2024-11-11 21:13:14 +02:00
dependabot[bot] a9cfdb6704
build(deps): bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 21:47:54 +00:00
dependabot[bot] c0dc3e47fd
build(deps): bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 21:47:51 +00:00
Joseph North 41e69be201
Fix Dockerfile link in readme 2024-11-04 09:51:12 -07:00
Povilas Kanapickas 4ae6ccb5c0
Merge pull request #1043 from iruzo/main
Download and build podman-compose using docker/podman locally
2024-11-03 15:42:05 +02:00
ruzo 4203f799ee add release.yml workflow 2024-11-03 15:35:42 +02:00
ruzo 69e95be2f6 add Dockerfile and related scripts 2024-11-03 15:35:42 +02:00
Povilas Kanapickas 122a914b9b
Merge pull request #1062 from tdgroot/down_removes_network
podman-compose down removes networks
2024-10-21 23:45:26 +03: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
Povilas Kanapickas 4660feb04a
Merge pull request #1060 from tdgroot/podman_no_hosts_extension
Add x-podman.no_hosts extension
2024-10-14 18:05:25 +03: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
Povilas Kanapickas 7090de3bce
Merge pull request #1049 from mokibit/automate-nets_test2
tests/integration: Automate manual `nets_test2` test
2024-10-04 04:10:31 +03:00
Monika Kairaityte df8fa588a5 tests/integration: Automate manual 'nets_test2' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-10-01 12:26:42 +03:00
Povilas Kanapickas e2ae8bee04
Merge pull request #1048 from mokibit/automate-nets_test1
tests/integration: Automate manual `nets_test1` test
2024-09-29 15:04:40 +03:00
Monika Kairaityte 5c81bbfcb7 tests/integration: Automate manual 'nets_test1' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-29 14:44:17 +03:00
Povilas Kanapickas 22b0c4b348
Merge pull request #1040 from mokibit/automate-ipam-default-test
tests/integration: Automate manual `ipam_default` test
2024-09-26 21:41:49 +03:00
Povilas Kanapickas 380cf42dcd
Merge pull request #1047 from mokibit/delete-netprio-test
tests/integration: Delete `netprio` test
2024-09-26 21:37:50 +03:00
Monika Kairaityte deed4d51b0 tests/integration: Automate manual 'ipam_default' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-26 20:23:26 +03:00
Monika Kairaityte 08b3ac2633 tests/integration: Delete 'netprio' test
This functionality is not implemented in podman-compose so the test is
unneeded.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-26 20:10:37 +03:00
Povilas Kanapickas f8ea85e3af
Merge pull request #1045 from mokibit/automate-multicompose-test
tests/integration: Automate manual `multicompose` test
2024-09-24 19:56:24 +03:00
Monika Kairaityte 0de7e13f1a tests/integration: Automate manual 'multicompose' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-24 19:38:33 +03:00
Povilas Kanapickas da7fd4fe86
Merge pull request #1044 from mokibit/automate-nethost-test
tests/integration: Automate manual `nethost` test
2024-09-24 19:37:58 +03:00
Monika Kairaityte cb294d7519 tests/integration: Automate manual 'nethost' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-24 19:35:06 +03:00
Povilas Kanapickas 351858dbec
Merge pull request #1034 from mokibit/automate-interpolation-tests
tests/integration: Automate manual `interpolation` test
2024-09-24 19:32:16 +03:00
Monika Kairaityte 8d0dd214ae tests/integration: Automate manual 'interpolation' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-10 14:47:56 +03:00
Povilas Kanapickas 229650cba8
Merge pull request #1032 from shuckc/main
Revert "Use defined environment variables in the image build process"
2024-09-07 00:13:36 +03:00
Povilas Kanapickas ab832d23c7
Merge pull request #1031 from mokibit/relocate-filesystem-test
tests/integration: Relocate `filesystem` test
2024-09-06 23:12:37 +03: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
Monika Kairaityte de3f93c491 tests/integration: Relocate 'filesystem' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-06 20:08:13 +03:00
Povilas Kanapickas 54cc055a5c
Merge pull request #1029 from mokibit/automate-extends-with-file-subdir
tests/integration: Automate manual `extends_w_file_subdir` test
2024-09-06 20:07:51 +03:00
Monika Kairaityte f4bf69b68e tests/integration: Automate manual 'extends_w_file_subdir' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-06 19:47:14 +03:00
Povilas Kanapickas 5297b004af
Merge pull request #1028 from mokibit/automate-extends-with-file
tests/integration: Automate manual `extends_w_file` test
2024-09-06 19:46:59 +03:00
Povilas Kanapickas fd1fc833b0
Merge pull request #1026 from mokibit/automate-extends-empty-service-test
tests/integration: Automate manual `extends_w_empty_service` test
2024-09-06 19:45:30 +03:00
Monika Kairaityte 124879a7b9 tests/integration: Automate manual 'extends_w_file' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-05 15:25:33 +03:00
Monika Kairaityte 368efe2ee3 tests/integration: Automate manual 'extends_w_empty_service' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-09-05 13:16:38 +03:00
Povilas Kanapickas eeefd37996
Merge pull request #1016 from legobeat/refactor-resolvable-type-checks
fix: improve type resolutions
2024-08-03 17:01:13 +03:00
Povilas Kanapickas b7514a0647
Merge pull request #1018 from legobeat/drop-python-3.8
Minimum Python version 3.9
2024-08-03 17:00:02 +03:00
legobt 561094954d
test: Use stable apt-get cli for package installation
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 01:24:36 +00: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 8411db49d1
Minimum Python version 3.9
Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
2024-08-03 00:50:26 +00:00
Povilas Kanapickas fc90f60bf1
Merge pull request #1014 from legobeat/refactor-redundant-vars
refactor: clean up redundant proj_name, net vars
2024-08-02 10:22:28 +03: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 edadf73d82
Merge pull request #1017 from mokibit/automate-extends-tests
tests/integration: Automate manual 'extends' test
2024-08-01 21:41:30 +03:00
Monika Kairaityte dc04108b3e tests/integration: Automate manual 'extends' test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-08-01 21:29:43 +03:00
Povilas Kanapickas 348461ca77
Merge pull request #1007 from mokibit/automate-env-tests
tests/integration: Automate manual `env` tests
2024-07-30 14:09:55 +03:00
Monika Kairaityte 92dbd3690e tests/integration: Automate 'env-file-tests' manual tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-30 12:46:13 +02:00
Povilas Kanapickas a1e9a82693
Merge pull request #1012 from mokibit/automate-exit-from-tests
tests/integration: Automate manual `exit-from` tests
2024-07-30 11:16:17 +03:00
Monika Kairaityte 9e11c6bfbc tests/integration: Automate manual 'exit-from' tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-30 09:40:20 +02:00
Monika Kairaityte 0d24c41afb tests/integration: Automate 'env-tests' manual test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-29 10:39:49 +02: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
Povilas Kanapickas 3aa6d4d158
Merge pull request #1009 from bkueng/platform_build_cmd
podman_compose.py: support "platform" property in the build command
2024-07-27 00:04:54 +03:00
Songmin Li 34f5268e37 Add unittest for rec_subs
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
2024-07-27 00:04:06 +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
Povilas Kanapickas dbbd695463
Merge pull request #1008 from mokibit/automate-deps-test
tests/integration: Automate manual `deps` test
2024-07-23 23:12:17 +03:00
Povilas Kanapickas 1b1d3d8c25
Merge pull request #1010 from jasonchuanet/docs_uidmaps_gidmaps
Update docs+messages to reflect uidmaps/gidmaps code
2024-07-23 23:11:00 +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
Monika Kairaityte 3c9c18c6e0 tests/integration: Automate `deps` manual test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-22 15:19:34 +02:00
Povilas Kanapickas d0a2a44442
Merge pull request #1003 from njhanley/remove-branch-names-from-contrib-docs
Remove references to nonexistent devel and stable branches
2024-07-19 19:11:48 +03:00
Nick Hanley 1e66c28bbb Remove references to nonexistent devel and stable branches
Closes #894

Signed-off-by: Nick Hanley <nicholasjhanley@gmail.com>
2024-07-18 21:41:59 -04:00
Povilas Kanapickas b6eadd56b1
Merge pull request #1002 from nerilex/main
Add `--network=none` if `network_mode: none` is set
2024-07-17 05:19:19 +03:00
Povilas Kanapickas d95b4d026b Add newsfragment
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-17 01:43:45 +03: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
Povilas Kanapickas 0866492a7e
Merge pull request #1000 from zoumingzhe/main
Support python direct call _parse_args or run
2024-07-15 18:48:39 +03:00
Mingzhe Zou 85050097e5 Support python direct call _parse_args or run
For example:
```
>>> from podman_compose import podman_compose
>>> podman_compose._parse_args(['version'])
>>> podman_compose.run(['help'])
```

Signed-off-by: Mingzhe Zou <zoumingzhe@qq.com>
2024-07-15 12:04:39 +08:00
Povilas Kanapickas daab93b762
Merge pull request #997 from mokibit/automate-build-tests
Automate manual `build` tests
2024-07-08 22:42:00 +03:00
Monika Kairaityte 9fe30387ee tests/integration: Automate 'build_fail' manual test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-08 21:37:29 +02:00
Monika Kairaityte 0f8348bea7 tests/integration: Automate 'build' manual test
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-08 21:36:29 +02:00
Povilas Kanapickas 55ab3fa7f7
Merge pull request #994 from swick/wip/build-labels
Pass build description labels to podman build
2024-07-08 19:20:22 +03:00
Povilas Kanapickas 2091ade7b1 Add newsfragment
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-08 19:15:16 +03:00
Sebastian Wick ca58d7cd58 Pass build description labels to podman build
The Compose Specification supports adding labels to the build image
which is also used in practice. Support this and pass the labels to
`podman build`.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-07-08 19:15:16 +03:00
Povilas Kanapickas 3296c8d34f
Merge pull request #993 from p12tic/compose-file-links
Don't resolve links to compose file
2024-07-06 19:35:18 +03:00
Povilas Kanapickas dab6b1b98d
Merge pull request #992 from p12tic/docker-compose-name-compat
Add a way to remove dashes in default network names
2024-07-06 18:56:25 +03:00
Povilas Kanapickas 5bf4c0fdbe Add a way to remove dashes in default network names
This is the behavior exhibited by docker compose. The network names are
user-visible through external networks, so previously anyone who
migrated from docker-compose needed to change their configuration. Now
it is possible to select compatibility via a flag in x-podman global
dictionary.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-06 18:50:25 +03:00
Povilas Kanapickas 67c5352c3a Extract default_network_name_for_project()
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-06 18:32:09 +03:00
Povilas Kanapickas 5e0f7e5e19
Merge pull request #990 from p12tic/tests-single-container-up
tests: Add integration tests for up -d with single container at a time
2024-07-06 01:06:23 +03:00
Povilas Kanapickas 5040a37d47 tests: Add integration tests for up -d with single container at a time
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-06 00:59:50 +03:00
Povilas Kanapickas c82859b89f
Merge pull request #989 from p12tic/github-install-requirements-unconditionally
github: Install requirements unconditionally
2024-07-04 09:19:30 +03:00
Povilas Kanapickas 29195be77c github: Install requirements unconditionally
This makes tests less brittle as any renames to requirements files will
be noticed.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-04 09:17:27 +03:00
Povilas Kanapickas 1c74d6cd11
Merge pull request #988 from p12tic/tests-discovery
Discover tests instead of passing a list of files to unittest
2024-07-03 19:52:56 +03:00
Povilas Kanapickas 9a4af0ce62 Discover tests instead of passing a list of files to unittest
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-03 19:50:13 +03:00
Povilas Kanapickas 0517b9e34c
Merge pull request #987 from p12tic/check-if-pod-exists-before-creating
Check whether pod exists before trying to create one
2024-07-03 19:35:28 +03:00
Povilas Kanapickas 24038dace3 Check whether pod exists before trying to create one
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-07-03 19:31:13 +03:00
Povilas Kanapickas 0ea4cbe091
Merge pull request #984 from mokibit/reduce-path-calculation-duplication
tests/integration: Reduce base path calculation duplication
2024-07-03 09:13:49 +03:00
Monika Kairaityte 2056e703d5 tests/integration: Reduce base path calculation duplication
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-03 09:09:25 +03:00
Povilas Kanapickas 137c6207b2
Merge pull request #981 from mokibit/add-unittests-for-secrets
unittests: Added unit tests for podman-compose secrets
2024-07-02 20:52:34 +03:00
Monika Kairaityte 4ec57c1013 unittests: Added unit tests for podman-compose secrets
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-07-02 20:26:58 +03:00
Povilas Kanapickas d9a3572461
Merge pull request #978 from PlugNPush/main
Restore support for alt dockerfiles (removing hardcoded "Dockerfile")
2024-06-26 21:39:42 +03:00
Michaël Nass - PlugN fa3e0a7772 Alt Dockerfile names fix
Signed-off-by: Michaël Nass - PlugN <michael.nass@free.fr>
2024-06-26 19:09:20 +02:00
Povilas Kanapickas 0bcf0799b6
Merge pull request #976 from p12tic/tests-move-around
Move all tests to single directory "tests"
2024-06-26 11:30:21 +03:00
Povilas Kanapickas 18472b53ac Move all tests to single directory "tests"
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-06-26 11:28:16 +03:00
Povilas Kanapickas d38b26bb01
Release 1.2.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-06-26 10:43:28 +03:00
Povilas Kanapickas 22a4ad5806
Merge pull request #975 from p12tic/changelog
Add release notes for v1.2.0
2024-06-26 10:41:59 +03:00
Povilas Kanapickas 37e2cb28d4 Add release notes for v1.2.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-06-26 10:39:48 +03:00
Povilas Kanapickas 0cd3902c5f
Merge pull request #974 from p12tic/newsfragments
Use newsfragments pattern for the release notes
2024-06-26 10:37:54 +03:00
Povilas Kanapickas 6ef759c6fd Use newsfragments pattern for the release notes
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-06-26 10:21:03 +03:00
Povilas Kanapickas 16cbcf4152
Merge pull request #956 from Genzer/fix/loading-.env-breaking-since-1.1.0
Load .env from Compose file's directory and cwd
2024-06-24 23:37:33 +03:00
Genzer 67ce900885 Commit .env in tests/env-file-tests, bypassing root .gitignore
This commit adds a .gitignore in tests/env-file-tests to allow .env files
to be committed.

Fix: #937
Signed-off-by: Genzer <732937+Genzer@users.noreply.github.com>
2024-06-24 23:29:57 +03:00
Genzer 4e9f76768c Load .env from Compose file's directory and cwd
This commit loads dotenv `.env` (exactly that name) from the following location (the later takes
precedence):

- The `.env` file in the Compose file's directory.
- The `.env` file in the current working directory (invoking podman-compose).

This preserves the behavior prior to 1.1.0 and to match with Docker Compose CLI.

Fix: https://github.com/containers/podman-compose/issues/937
Signed-off-by: Genzer <732937+Genzer@users.noreply.github.com>
2024-06-24 23:29:56 +03:00
Povilas Kanapickas 84f7fdd7da
Merge pull request #971 from mokibit/type-env-secret-support
Add support for environment variable secrets
2024-06-24 23:17:34 +03:00
Monika Kairaityte 405001b990 Fix comment
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-06-24 21:24:34 +03:00
Monika Kairaityte 6b1aeff55f Add unittests for type=env secret
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-06-24 21:24:34 +03:00
Brett Calliss f06975b346 Update tests for type=env secret
Signed-off-by: Brett Calliss <brett@obligatory.email>
2024-06-24 20:12:44 +03:00
Brett Calliss 546cad5171 Add type=env secret support
Signed-off-by: Brett Calliss <brett@obligatory.email>
2024-06-24 20:12:44 +03:00
Povilas Kanapickas e07c28d127
Merge pull request #771 from wgnathanael/environment-precedence
Fix environment variable precedents
2024-06-22 20:00:08 +03:00
nathanael.noblet 935029dc33 Fix environment variable precedents
Per https://docs.docker.com/compose/environment-variables/envvars-precedence/#advanced-example

Signed-off-by: nathanael.noblet <nathanael.noblet@willowglensystems.com>
2024-06-22 19:58:02 +03:00
Povilas Kanapickas 80b2aa6ed0
Merge pull request #964 from mokibit/set-custom-in_pod-in-compose-file
Allow providing custom in_pod argument as a global compose file variable
2024-06-20 09:45:41 +03:00
Monika Kairaityte 360b85bf2d Allow providing custom in_pod argument as a global compose file variable
Default command line argument `in_pod` was set to True, but this breaks
the compose file for users who want to use `--userns` argument. This
commit sets default `in_pod` value to None, and later resolves whether
to create a pod by checking compose file, as new argument in compose
file x-podman is now available. Now it is convenient for users to pass
custom `in_pod` value (True or False) as a compose file argument when
command line value of `in_pod` is not provided.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-06-20 09:42:22 +03:00
Povilas Kanapickas 650a835eca
Merge pull request #966 from ArthoPacini/enhance/stdin-docker-compose-support
Add ability to input docker-compose.yaml via stdin
2024-06-19 20:06:15 +03:00
Artho Pacini 82740cc311 Add ability to input docker-compose.yaml via stdin
Signed-off-by: Artho Pacini <eu@arthopacini.com>
2024-06-18 00:05:31 +03:00
Artho Pacini 0f645e4c70 Add ability to input docker-compose.yaml via stdin
Signed-off-by: Artho Pacini <eu@arthopacini.com>
2024-06-18 00:05:31 +03:00
Artho Pacini 3b15170ccf Changed the global parser help message for file input, to reflect changes for reading from stdin
Signed-off-by: Artho Pacini <eu@arthopacini.com>
2024-06-18 00:05:31 +03:00
Artho Pacini 3359380ec6 Add ability to input docker-compose.yaml via stdin
Signed-off-by: Artho Pacini <eu@arthopacini.com>
2024-06-18 00:05:31 +03:00
Povilas Kanapickas 14f39e5b86
Merge pull request #965 from mokibit/fix-gidmap-typo
Fix x-podman.gidmap typo
2024-06-17 10:08:17 +03:00
Monika Kairaityte e799a0b0ea Fix x-podman.gidmap typo
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-06-14 17:31:55 +03:00
Povilas Kanapickas 6d8d3e94fe
Merge pull request #960 from mokibit/github-verbose-integration-tests
github: Add verbose option to integration tests
2024-06-08 20:15:13 +03:00
Monika Kairaityte 65d1fdeaa3 github: Add verbose option to integration tests
Currently it is not possible to see which test output corresponds to
which test exactly. Now before each new test its test name is printed.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-06-08 20:05:12 +03:00
Povilas Kanapickas d905a7c638
Merge pull request #949 from mokibit/multiline-env-file
Add support for multi-line environment files
2024-05-29 00:47:58 +03:00
Monika Kairaityte 2e8ed2f924 pytests: Add test for object required but path non existent
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-05-29 00:09:22 +03:00
Monika Kairaityte 040b73adab pytests: Add tests for several multi-line environment files
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-05-29 00:09:15 +03:00
Hedayat Vatankhah f3e9a96c96 Fixes #908: Add support for multi-line environment files
Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2024-05-28 23:43:15 +03:00
Povilas Kanapickas 04b107805a
Merge pull request #954 from mokibit/fix-codespelling-update
github/workflows: Fix automatic codespelling update
2024-05-28 23:40:59 +03:00
Monika Kairaityte 2c5d00d3e7 github/workflows: Add codespellignore file to address false positives
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2024-05-28 20:20:33 +03:00
Povilas Kanapickas cac90f69b8
Merge pull request #946 from charliemirabile/selinux_tests
Missing SELinux tests
2024-05-22 10:17:05 +03:00
charliemirabile b513f50f30 test: add missing unit tests for selinux in verbose mount
Support for setting the selinux flags on a bind mount specified using
the verbose syntax was merged as part of #911, but at that time the PR
lacked unit tests. This commit adds the missing tests

Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
2024-05-21 19:43:03 -04:00
Povilas Kanapickas 8f618b6fab
Merge pull request #763 from otto-liljalaakso-nt/additional_contexts
Support additional_contexts
2024-05-21 19:49:23 +03:00
Otto Liljalaakso cac836b0f5 Support additional_contexts
Signed-off-by: Otto Liljalaakso <otto.liljalaakso@novatron.fi>
2024-05-21 19:44:37 +03:00
Povilas Kanapickas 3bb305cef4
Merge pull request #945 from p12tic/split-gpu-test
test: Split test_gpu test
2024-05-21 12:25:11 +03:00
Povilas Kanapickas 09034a0c38 test: Split test_gpu test
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-05-21 12:04:32 +03:00
Povilas Kanapickas e668a339ce
Merge pull request #943 from HernandoR/fix/multi-sub-composes
Fix the test_include for multi subcomposes
2024-05-21 11:32:17 +03:00
Zhen Liu 0065082db9 refine the test_include for multi subcomposes
Signed-off-by: Zhen Liu <lzhen.dev@outlook.com>
2024-05-21 11:28:27 +03:00
Muayyad Alsadi 5d4de80ab7
Merge pull request #911 from charliemirabile/selinux
Add support for selinux in verbose bind mount specification
2024-05-19 11:13:45 +03:00
Muayyad Alsadi 23ad5c3ef7
Merge pull request #920 from mokeyish/gpu
Add supoort for enabling GPU access
2024-05-19 11:12:34 +03:00
Muayyad Alsadi 45efe461b0
Merge pull request #941 from HernandoR/patch-1
Update podman_compose.py
2024-05-19 11:10:39 +03:00
Zhen Liu 4f73f2b79e fix: add include test file, edit the assertion
Signed-off-by: Zhen Liu <lzhen.dev@outlook.com>
2024-05-18 21:23:43 +08:00
Zhen Liu 1d64f2cf8c Update podman_compose.py
fix #940

Signed-off-by: Zhen Liu <lzhen.dev@outlook.com>
2024-05-18 20:33:10 +08:00
Povilas Kanapickas 2ce6d1a1e7
Merge pull request #933 from hedayat/fix-build-error-log
Fix logging build error message
2024-05-13 16:24:15 +03:00
Hedayat Vatankhah 4e22faefd6 Fix logging build error message
Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2024-05-13 15:13:40 +03:00
Muayyad Alsadi 7a2da76ab8
Merge pull request #724 from hedayat/fix-merge-depends-on
Fixes #723: merge short & long syntax of depends_on dependencies
2024-05-08 17:57:44 +03:00
YISH 79865c2e13 Add support for enabling GPU access
Signed-off-by: YISH <mokeyish@hotmail.com>
2024-05-07 10:32:24 +08:00
Povilas Kanapickas 33d7d35a4d
Merge pull request #851 from fccagou/fix-ipam-driver-default
fix(ipam_driver): do not pass --ipam-driver option when value set to …
2024-05-06 17:31:59 +03:00
fccagou c23a8b2cbd Do not pass --ipam-driver option when value set to default
fixes #852.

Signed-off-by: fccagou <me@fccagou.fr>
2024-05-06 17:00:17 +03:00
Povilas Kanapickas 36a3d3c207
Merge pull request #925 from GerkinDev/feat/env-file-object
Fixes #897: support `env_file` as objects
2024-05-06 16:57:25 +03:00
Alexandre Germain b202a09501 Add support for `env_file` as objects
Fixes: https://github.com/containers/podman-compose/issues/897

Signed-off-by: Alexandre Germain <nihilivin@gmail.com>
2024-05-06 14:13:37 +03:00
Povilas Kanapickas 35cbc49160
Merge pull request #928 from schugabe/patch-1
add await for create_pods call
2024-05-06 14:00:29 +03:00
Johannes 5c4aa40032 add await for create_pods call
fixes log output podman_compose.py:2527: RuntimeWarning: coroutine 'create_pods' was never awaited

Signed-off-by: Johannes Kasberger <schugabe@gmx.at>
2024-05-06 11:02:45 +02:00
Povilas Kanapickas 0ee7c2630a
Merge pull request #641 from DaniruKun/devel
Add instructions on install from Homebrew
2024-05-04 18:03:43 +03:00
Daniils Petrovs cef1785cd5 Add instructions on install from Homebrew
Signed-off-by: Daniils Petrovs <thedanpetrov@gmail.com>
2024-05-04 17:50:06 +03:00
Povilas Kanapickas b4cfef12e9
Merge pull request #926 from p12tic/cleanup-tests
Cleanup tests
2024-05-04 17:32:00 +03:00
Povilas Kanapickas b761050b0b tests: Merge multiple compose merging tests into single test class
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-05-04 17:30:09 +03:00
Povilas Kanapickas e1d0ea7b4e tests: Move normalize_service tests to a separate test class
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-05-04 17:29:04 +03:00
Povilas Kanapickas 1430578568 tests: Simplify command and entrypoint normalization tests
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-05-04 17:28:59 +03:00
Povilas Kanapickas 8f41cd3cdb
Merge pull request #731 from g2p/patch-1
README: explain that netavark is an alternative to the dnsname plugin
2024-05-01 21:16:27 +03:00
Povilas Kanapickas a73dac2e39
Merge pull request #923 from winston-yallow/remove-sideeffect-from-systemd-registration
Don't create pods/container when registering systemd unit
2024-05-01 21:05:13 +03:00
Winston d31a8b124d
Don't create pods/container when registering systemd unit
Signed-off-by: Winston <44872771+winston-yallow@users.noreply.github.com>
2024-05-01 20:03:14 +02:00
Gabriel de Perthuis 5df4e786ee README: explain that netavark is an alternative to the dnsname plugin
This is a useful hint when the dnsname plugin is not packaged.

Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
2024-05-01 15:13:29 +02:00
Povilas Kanapickas 27e27e9fe9
Merge pull request #918 from p12tic/fix-in-pod
Fix handling of --in-pod argument
2024-04-28 21:33:50 +03:00
Povilas Kanapickas 70a0e2d003 Fix handling of --in-pod argument
Currently --in-pod handling is broken because the only way to set False
is by providing empty argument like "--in-pod=". As of Python 3.7 the
solution is to accept string and parse manually.

Co-authored-by: Randolph Sapp <res.sapp@gmail.com>
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-04-28 21:16:34 +03:00
Povilas Kanapickas 58641f0545
Merge pull request #716 from Tayeh/images_cmd
add `podman-compose images` command
2024-04-28 20:37:07 +03:00
Mohammed Tayeh eea8bac496 Add images command
Signed-off-by: Mohammed Tayeh <m.tayeh94@gmail.com>
2024-04-28 19:04:23 +03:00
Povilas Kanapickas 09a8a3edf9
Merge pull request #917 from p12tic/x-podman-keys
Migrate x-podman dictionary on container root to x-podman.* fields
2024-04-28 18:29:33 +03:00
Povilas Kanapickas a6c4263738 Add tests for x-podman.uidmaps and x-podman.gidmaps
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-04-28 18:25:04 +03:00
Povilas Kanapickas 9599cc039e Migrate x-podman dictionary to x-podman.* fields in container root
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-04-28 18:24:37 +03:00
Povilas Kanapickas 0a6c057486
Merge pull request #737 from ftyghome/feat_rootfs
Support podman's external rootfs management
2024-04-28 18:04:37 +03:00
GnSight 2b4ecee082 Add docs for podman specific compose file extensions
Signed-off-by: GnSight <ftyg@live.com>
2024-04-28 17:55:39 +03:00
GnSight 77f2e8e5b0 Support podman's external rootfs management
Signed-off-by: GnSight <ftyg@live.com>
2024-04-28 17:55:39 +03:00
Povilas Kanapickas 12d46ca836
Merge pull request #916 from beledouxdenis/main-run-implement-publish
implement --publish in docker-compose run
2024-04-28 17:33:56 +03:00
Denis Ledoux 72a94d5185 implement --publish in docker-compose run
Signed-off-by: Denis Ledoux <dle@odoo.com>
2024-04-28 00:54:35 +02:00
Povilas Kanapickas 2681566580 Release 1.1.0 2024-04-19 12:37:30 +03:00
Povilas Kanapickas 62ce087c6e
Merge pull request #914 from p12tic/release-notes
Add release notes for v1.1.0
2024-04-17 20:26:52 +03:00
Povilas Kanapickas c97f003732 Add release notes for v1.1.0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-04-17 20:23:48 +03:00
Povilas Kanapickas c88558b4ec
Merge pull request #913 from p12tic/network-mac-address-vendor-prefix
Use x- prefix for x-podman.mac_address
2024-04-17 20:21:56 +03:00
Povilas Kanapickas 131010bc9d Use x- prefix for x-podman.mac_address
Docker compose documents x- prefix as standard vendor prefix.

https://github.com/compose-spec/compose-spec/pull/18

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-04-17 20:16:03 +03:00
Povilas Kanapickas 1da2f85a90
Merge pull request #906 from camspiers/fixes/ulimit-build-args
Fix, use "service.build.ulimits" when it is present instead of "service.ulimits"
2024-04-17 19:48:55 +03:00
Cam Spiers cdcedeb6b2 Use "service.build.ulimits" when present instead of "service.ulimits"
Signed-off-by: Cam Spiers <camspiers@gmail.com>
2024-04-17 19:45:34 +03:00
charliemirabile 3e1f7d554b add tests for selinux with verbose bind mount
based on seccomp test. Without the selinux option, visiting localhost:8080
will give a 404 error because httpd cannot access the file, but with selinux: z
the context for the file will be appropriately updated so httpd can access it

Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
2024-04-10 15:29:03 -04:00
charliemirabile d7cf0966d3 add support for selinux in verbose mount
This corresponds to specifying the `z` or `Z` option in the third
portion of a terse mount specification (i.e. src:trg:z)

Signed-off-by: charliemirabile <46761267+charliemirabile@users.noreply.github.com>
2024-04-10 15:29:03 -04:00
Povilas Kanapickas e893d06313
Merge pull request #867 from baszoetekouw/fix-networks
Fix multiple networks with separately specified ip and mac
2024-04-08 23:21:38 +03:00
Hedayat Vatankhah 1f35c00694
Add unit test for depends_on normalization as a dict
Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2024-04-08 23:31:41 +03:30
Muayyad Alsadi 9a5b43907f
Merge pull request #905 from acotty/main
FIX issue https://github.com/containers/podman-compose/issues/704 - Windows fix sock not working.
2024-04-07 12:43:43 +03:00
AndrweCottrell 6c09ce710e FIX issue https://github.com/containers/podman-compose/issues/704 - Windows fix sock not working. 2024-04-07 16:28:45 +10:00
Bas Zoetekouw 953534a71a Support and document all podman-specific network_modes
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 6feff244db slirp4netns can be used without options
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 9fd4cf43c1 Add unit tests for network_mode
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 65849c95e2 add comment about per-network aliases
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 9baea704d7 use preferred format of podman command line options
Specifically:
  - use "--network=foo" instead of "--network foo"
  - specify "--network-alias" multiple times instead of concatenating values

Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw bdff78dcba Ignore files generated by tests
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 45ca1f994f Support podman-specific per-network mac_address specifiation
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 91fbea3d89 Add unit tests for get_net_args()
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw 2743d690d2 Fix support for multiple networks with explicitly specified ipv4/ipv6 addresses
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Bas Zoetekouw dd34a90068 Add testcase for failing network config
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-28 16:09:43 +02:00
Povilas Kanapickas 6103df78fb
Merge pull request #777 from wiehe/build-secrets
Pass file secrets to "podman build" via parameter "--secret"
2024-03-28 00:40:12 +02:00
Povilas Kanapickas 07128f6b37
Merge pull request #779 from jbaptperez/lint-fixes-and-enhancements
Lint fixes and enhancements
2024-03-28 00:36:50 +02:00
Povilas Kanapickas f0bae1e2d9 Don't resolve links to compose file
docker-compose uses the path to the compose file even if it's symlink to
get the context directory.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-25 08:18:52 +02:00
Jean-Baptiste Perez 81d81fb303 Formats CONTRIBUTING.md
Signed-off-by: Jean-Baptiste Perez <jbaptperez@gmail.com>
2024-03-17 19:31:47 +01:00
Jean-Baptiste Perez b263dc1a7d Fixes typos and enhances CONTRIBUTING.md
Signed-off-by: Jean-Baptiste Perez <jbaptperez@gmail.com>
2024-03-17 19:31:47 +01:00
Jean-Baptiste Perez 078ee7b649 Updates Signed-off-by link in CONTRIBUTING.md
The initial link was related to GPG signature in commits (--gpg-sign or
-S git-commit option) as the required signature is actually a
"Signed-off-by" trailer at the end of the commit message (--signoff or
-s git-commit option).

Signed-off-by: Jean-Baptiste Perez <jbaptperez@gmail.com>
2024-03-17 19:31:47 +01:00
Jean-Baptiste Perez a6e3ae7b31 Fixes invalid name of test package in setup.py
Signed-off-by: Jean-Baptiste Perez <jbaptperez@gmail.com>
2024-03-17 19:31:47 +01:00
wiehe 1e9cf1dff0
Pass file secrets to "podman build" via parameter "--secret"
to make them available for "RUN --mount=type=secret" statements inside the
Dockerfile.

Keep using --volume to pass file secrets to "podman run".

Signed-off-by: wiehe <28457227+wiehe@users.noreply.github.com>
2024-03-12 17:23:40 +01:00
Povilas Kanapickas d704622522
Merge pull request #890 from containers/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2024-03-12 15:27:34 +02:00
dependabot[bot] bbfff78e25
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 21:44:23 +00:00
Povilas Kanapickas abb0cb1649
Merge pull request #888 from aripollak/fix-test-class-names
Rename test classes to match filenames
2024-03-10 00:21:20 +02:00
Povilas Kanapickas d53df307f8
Merge pull request #889 from aripollak/add-coverage-to-job-summary
Add coverage to Github Action summary
2024-03-10 00:20:50 +02:00
Ari Pollak c351f99da5 Add coverage to Github Action summary
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 17:10:14 -05:00
Ari Pollak 829cde0de9 Rename test classes to match filenames
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 16:34:06 -05:00
Povilas Kanapickas f18c8092cc
Merge pull request #887 from baszoetekouw/fix-oldpython
Fix support for older python versions
2024-03-09 23:29:32 +02:00
Povilas Kanapickas 43059dc16f
Merge pull request #783 from ChuJiani/devel
Fix #782: add support for `http-proxy` option of podman
2024-03-09 23:27:22 +02:00
Bas Zoetekouw da63048775
Don't spellcheck requirementfiles
As some python module names are not proper english words

Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:36 +01:00
Povilas Kanapickas 7987a7185e
Merge pull request #861 from aripollak/remove-implemented-from-missing
Remove implemented commands from Missing Commands
2024-03-09 23:26:36 +02:00
Bas Zoetekouw 5e55df890c
fix python < 3.9 compatibility
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:36 +01:00
Bas Zoetekouw fde7995cb8
Fix python < 3.11 compatibility
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:36 +01:00
Bas Zoetekouw c592596a5e
Split out the different tests into separate CI steps
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:36 +01:00
Bas Zoetekouw 688ee9a104
Fix pylint issues
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:35 +01:00
Bas Zoetekouw c3a152e68f
Enable pylint, because it catches stuff that ruff misses
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:35 +01:00
Bas Zoetekouw bd60bc9f21
Run tests on all supported python versions
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:35 +01:00
Bas Zoetekouw 9d8b0b8632
add editorconfig
Signed-off-by: Bas Zoetekouw <bas.zoetekouw@surf.nl>
2024-03-09 22:26:32 +01:00
Povilas Kanapickas ee013316c0
Merge pull request #860 from aripollak/fix-env-vars-with-equals
Allow run/exec -e with equals sign in value
2024-03-09 23:25:56 +02:00
Ari Pollak f2f5483a74 Extract compose_run args parsing and add unit tests
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 16:18:13 -05:00
Ari Pollak c4fa8f7a16 Split exec args parsing into new function and add unit tests for it
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 16:02:47 -05:00
Ari Pollak 4c270b9116 Allow run/exec -e with equals sign in value
Fixes: #798
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 14:35:08 -05:00
Ari Pollak c5f7f550f9 Remove implemented commands from Missing Commands
Signed-off-by: Ari Pollak <ajp@aripollak.com>
2024-03-09 14:32:29 -05:00
ChuJiani c98cbaaaf0 Fix #782: add support for http_proxy
Signed-off-by: ChuJiani <archet@chujiani.top>
2024-03-09 17:10:09 +00:00
Povilas Kanapickas f2f2f15a3b
Merge pull request #765 from timocov/devel
Added handling `pid` option
2024-03-09 18:30:48 +02:00
Evgeniy Timokhov 91d316ff1f Added handling `pid` option
Fixes #554

Signed-off-by: Evgeniy Timokhov <timocov@gmail.com>
2024-03-09 16:10:37 +00:00
Povilas Kanapickas 121b5f6ea1
Merge pull request #749 from maxi0604/more-network-options
Add support for enable_ipv6
2024-03-09 13:03:27 +02:00
Maximilian R 969edb88d0 Add support for enable_ipv6
Signed-off-by: Maximilian R <maxi.rostock@outlook.de>
2024-03-09 13:01:41 +02:00
Maximilian R bba1f33d51 Factor out arg creation for "network create". Add unit tests.
Signed-off-by: Maximilian R <public@complexvector.space>
2024-03-09 13:00:09 +02:00
Povilas Kanapickas 970e4ac4ab
Merge pull request #764 from lemmi/sysctls-dict
Handle sysctls maps
2024-03-09 12:47:10 +02:00
lemmi a9c335bf82 Handle sysctls maps
- Add support to handle sysctls maps.
- Directly raise an error if sysctls is neither an array nor map instead
  of letting podman fail with an unhelpful message.

Support for sysctls arrays was added in #261.

Fixes #754: sysctls only works with arrays, not maps

Signed-off-by: lemmi <lemmi@nerd2nerd.org>
2024-03-09 12:44:55 +02:00
lemmi e67c52f2c4 test_container_to_args: handle async tests
Signed-off-by: lemmi <lemmi@nerd2nerd.org>
2024-03-09 12:44:55 +02:00
Povilas Kanapickas e0fc9a7546
Merge pull request #696 from dkull/devel
Fix stop/restart args stacking
2024-03-09 12:42:54 +02:00
Tanel Liiv 2cdfb3e6d4 Fix stop/restart args stacking
Signed-off-by: Tanel Liiv <tanel.liiv@reconeyez.com>
Signed-off-by: Tanel Liiv <liivtanel@gmail.com>
2024-03-09 12:39:53 +02:00
Povilas Kanapickas 60137eb7f9
Merge pull request #741 from maurerle/quiet-output
Output: use logging, remove verbose output by default
2024-03-09 12:35:00 +02:00
Povilas Kanapickas a7a993faef
Merge pull request #886 from p12tic/github-pr-template
github: Add PR template
2024-03-09 12:27:17 +02:00
Povilas Kanapickas 8ec5e0372a github: Add PR template
Adding a link to related part of compose spec is much easier for the
contributors, because they're already working on the feature. This saves
reviewer time.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-09 12:18:19 +02:00
Florian Maurer da520e299b
switch to % string lazy formatting
* fix black and pylint issues

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
2024-03-09 10:40:24 +01:00
James O'Beirne 1e9e2ee776
Output: use logging, remove garbage output by default
Fixes #489.

Introduces a --verbose flag if you want to see all the noise that
was previously printed by default.

Signed-off-by: James O'Beirne <james.obeirne@pm.me>
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
2024-03-09 10:36:20 +01:00
Povilas Kanapickas dcb6cdb55a
Merge pull request #858 from breca/asyncio_compat
Replaces asyncio timeout with bespoke timeout function
2024-03-09 11:05:17 +02:00
Brett Calliss 0f693ee584 Replaces asyncio timeout with bespoke timeout function
Signed-off-by: Brett Calliss <brett@obligatory.email>
2024-03-09 19:02:32 +11:00
Povilas Kanapickas d468f85fd1
Merge pull request #755 from yarikoptic/enh-codespell
Add codespell config (to ignore loved "poped") and github workflow to prevent future typos
2024-03-09 01:47:25 +02:00
Yaroslav Halchenko cf90ab2858 Run codespell throughout fixing typos automagically
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-03-08 18:41:03 -05:00
Yaroslav Halchenko d2fa80196f ignore poped (not sure why not to make it popped)
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-03-08 18:41:03 -05:00
Yaroslav Halchenko 247774822c Add pre-commit definition for codespell
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-03-08 18:41:03 -05:00
Yaroslav Halchenko 6e65a73ab9 Add rudimentary codespell config
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-03-08 18:41:03 -05:00
Yaroslav Halchenko f95ca7aca7 Add github action to codespell devel on push and PRs
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
2024-03-08 18:41:03 -05:00
Povilas Kanapickas cdf5961bf2
Merge pull request #758 from containers/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2024-03-09 01:09:28 +02:00
dependabot[bot] 0c0e77c246
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-08 22:51:44 +00:00
Povilas Kanapickas e6fc585702
Merge pull request #884 from p12tic/lint-fixes
Fix unsorted imports
2024-03-08 23:59:06 +02:00
Povilas Kanapickas bb2338e447 Fix unsorted imports
This is a logical merge conflict that has been caused by several PRs
landing in parallel.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:54:48 +02:00
Povilas Kanapickas a8db898ac6
Merge pull request #883 from p12tic/lint-fixes
Enable ruff check and fix lint errors
2024-03-08 23:51:25 +02:00
Povilas Kanapickas 1ba1c364b9
Merge pull request #819 from p12tic/service-runtime
Add support for runtime service configuration key
2024-03-08 23:51:17 +02:00
Povilas Kanapickas 15ae2140d4 Add support for runtime service configuration key
https://docs.docker.com/compose/compose-file/05-services/#runtime

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:48:55 +02:00
Povilas Kanapickas ed39523342 github: Enable ruff check
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:47:13 +02:00
Povilas Kanapickas 4e43606df3 Shorten too long lines
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:24 +02:00
Povilas Kanapickas 91052cb2d9 Fix ambiguous variable name
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:23 +02:00
Povilas Kanapickas a6e0092627 Remove unused variable
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:22 +02:00
Povilas Kanapickas 59a1fa3942 Use 'not in' for membership test
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:21 +02:00
Povilas Kanapickas 36139fb282 Remove unused f-string
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:20 +02:00
Povilas Kanapickas b0da6f82d3 Fix import formatting
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 23:46:19 +02:00
Povilas Kanapickas b1e4324d41
Merge pull request #882 from p12tic/readme-fix-badge-status
README: fix status badges
2024-03-08 16:26:23 +02:00
Povilas Kanapickas 94df95acea README: Fix link to tests badge
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 16:09:15 +02:00
Povilas Kanapickas 3a5a283cf6 README: Remove link to pylint test badge
This is an internal metric that the users don't need to care about at
all.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 16:09:11 +02:00
Povilas Kanapickas 16a90e2bce
Merge pull request #873 from p12tic/github-run-container
github: Run actions on python:3.11-bookworm
2024-03-08 15:58:18 +02:00
Povilas Kanapickas 7c81044860 github: Run actions on python:3.11-bookworm
This ensures a stable environment for tests even when ubuntu-latest
changes. Also, the dependency on setup-python action has been
removed. That action supports only Ubuntu and limited architectures.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 15:56:30 +02:00
Povilas Kanapickas 5b571942e0
Merge pull request #880 from p12tic/fix-test-names
github: Fix test names
2024-03-08 15:56:01 +02:00
Povilas Kanapickas de8f545f07
Merge pull request #881 from p12tic/test-fix-teardown
tests: Properly tear down containers in extends_w_file_subdir test
2024-03-08 15:55:54 +02:00
Povilas Kanapickas 1a24cde608 tests: Properly tear down containers in extends_w_file_subdir test
podman rmi does not guarantee that the container itself is shut down.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 15:52:40 +02:00
Povilas Kanapickas a90da4dfaf github: Fix test names
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 15:51:24 +02:00
Povilas Kanapickas 6841619b9c
Merge pull request #879 from p12tic/tests-debug-output
tests: Add verbose debug option via env variable
2024-03-08 15:50:58 +02:00
Povilas Kanapickas 27c8cebbdc tests: Add verbose debug option via env variable
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 15:34:00 +02:00
Povilas Kanapickas c84b4c33fc
Merge pull request #878 from p12tic/tests-decoded-output
tests: Print decoded subprocess output in case of failure
2024-03-08 15:15:24 +02:00
Povilas Kanapickas 0614687840 tests: Print decoded subprocess output in case of failure
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 15:11:25 +02:00
Povilas Kanapickas a494f20e15
Merge pull request #877 from p12tic/tests-faster
tests: Optimize speed by using dumb-init to handle SIGTERM signal
2024-03-08 14:49:25 +02:00
Povilas Kanapickas 6af7a2d691 tests: Optimize speed by using dumb-init to handle SIGTERM signal
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 14:45:53 +02:00
Povilas Kanapickas 872664b727
Merge pull request #876 from p12tic/tests-print-subprocess-errors
tests: Print output in case subprocess returns unexpected code
2024-03-08 14:41:23 +02:00
Povilas Kanapickas f4dc5f3b93 tests: Print output in case subprocess returns unexpected code
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 13:14:02 +02:00
Povilas Kanapickas ac5034065d
Merge pull request #875 from p12tic/spdx-identifiers
Add SPDX license identifiers to each source file
2024-03-08 12:35:02 +02:00
Povilas Kanapickas b34f699adb Add SPDX license identifiers to each source file
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 12:19:51 +02:00
Povilas Kanapickas 3d68d2432d
Merge pull request #874 from p12tic/github-tests-on-all-branches
github: Run tests on all branches
2024-03-08 12:09:57 +02:00
Povilas Kanapickas 2c6c1be197 github: Run tests on all branches
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 12:02:06 +02:00
Povilas Kanapickas f81cbe39b5
Merge pull request #872 from containers/dependabot/github_actions/actions/setup-python-5
Bump actions/setup-python from 4 to 5
2024-03-08 11:43:49 +02:00
dependabot[bot] 91737ee0a6
Bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-08 09:41:46 +00:00
Povilas Kanapickas 9d1407ba90
Merge pull request #871 from p12tic/unittest
Migrate tests to unittest
2024-03-08 11:39:20 +02:00
Povilas Kanapickas b65d4a3916 github: Fix ruff job setup
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 11:36:57 +02:00
Povilas Kanapickas 23fe9e7e1d Migrate tests to unittest
unittest is much more straightforward without any magic. In a small
project like podman-compose being easy to understand is more important
than features.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 11:33:17 +02:00
Povilas Kanapickas 7539257ee8 requirements: Install . for tests
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-08 11:00:33 +02:00
Povilas Kanapickas 9e29891aa7
Merge pull request #870 from p12tic/ruff
Use ruff for formatting
2024-03-07 18:28:52 +02:00
Povilas Kanapickas a967cab02b Format codebase with ruff
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-07 18:28:06 +02:00
Povilas Kanapickas a5c354d60b Replace flake8, black, pylint with ruff
For now pylint checks are disabled.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-07 18:28:05 +02:00
Povilas Kanapickas e4e5b7d461 Make test requirements reproducible
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2024-03-07 18:28:04 +02:00
Brett C e0edd5dac1 Fix package installation
Signed-off-by: Brett Calliss <brett@obligatory.email>
2024-02-25 01:25:28 +03:00
Muayyad Alsadi 831caa6276 remove recursion 2024-02-06 00:23:14 +03:00
Ben Plessinger 9ac33392a0 Fix issue #831
Signed-off-by: Ben Plessinger <Benjamin.Plessinger@roswellpark.org>
2024-02-06 00:20:11 +03:00
Falmarri c5be5bae90 Fixup tests
Signed-off-by: Falmarri <463948+Falmarri@users.noreply.github.com>
2024-02-04 10:11:57 +03:00
Falmarri c6a1c4c432 Add tests to make sure all async paths are covered
Not at 100% yet. But upped code coverage significantly and covered major
async calls.

Signed-off-by: Falmarri <463948+Falmarri@users.noreply.github.com>
2024-02-04 10:11:57 +03:00
Falmarri 3c9628b462 Fix a couple issues and update docs
Signed-off-by: Falmarri <463948+Falmarri@users.noreply.github.com>
2024-02-04 10:11:57 +03:00
Falmarri 38b13a34ea Use asyncio for subprocess calls
Removes the threads from compose_up and manages it using async. Also
uses async processing to format the log messages instead of piping
through sed. This should work on windows without having sed installed

Adds --parallel to support pull and build in parallel, same as docker
compose

Signed-off-by: Falmarri <463948+Falmarri@users.noreply.github.com>
2024-02-04 10:11:57 +03:00
ambiamber bce40c2db3 Change "an key-value" to "a key-value" 2023-08-08 18:05:58 +03:00
Kian-Meng Ang 78f8cad7c4 Fix typos
Found via `codespell -L poped`
2023-08-08 18:05:25 +03:00
Mohammed Tayeh 7942a540cd fix styling errors
Signed-off-by: Mohammed Tayeh <m.tayeh94@gmail.com>
2023-08-08 18:05:02 +03:00
Mohammed Tayeh cb9cf6002f add stats command
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2023-08-08 18:05:02 +03:00
Evedel 06587c1dca rm redundant tests
Signed-off-by: Evedel <svbiriukov@gmail.com>
2023-08-02 14:19:15 +03:00
Evedel bc9168b039 add no-normalize flag
Signed-off-by: Evedel <svbiriukov@gmail.com>
2023-08-02 14:19:15 +03:00
Sergei Biriukov 57c527c2c9 add edits from review
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-08-02 14:19:15 +03:00
Sergei Biriukov d1f5ac9edc convert build context path to absolute during final normalisation
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-08-02 14:19:15 +03:00
Natanael Arndt 0164c1db56 Simplify the fix using `or`.
Signed-off-by: Natanael Arndt <arndtn@gmail.com>
2023-07-26 17:32:14 +03:00
Natanael Arndt e5cdce4e7d default to an empty dict for the from service if the service is None
Signed-off-by: Natanael Arndt <arndtn@gmail.com>
2023-07-26 17:32:14 +03:00
Natanael Arndt 280f1770bf Add a test to extend using an empty service (placeholder)
Signed-off-by: Natanael Arndt <arndtn@gmail.com>
2023-07-26 17:32:14 +03:00
Muayyad alsadi f75d12af21 broken in py 3.7 2023-07-18 13:23:55 +03:00
Hedayat Vatankhah 5454c3ad0f Add 'links' aliases to container aliases
Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2023-07-18 13:14:57 +03:00
Hedayat Vatankhah 901adf47d0 Use defined environment variables in the image build process
Build images with service environment variables defined so that they can be
used in the build process

Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2023-07-18 13:13:33 +03:00
Mahmoud Abduljawad bf07e91163 Implement `include` from `compose-spec`
Signed-off-by: Mahmoud Abduljawad <mahmoud@masaar.com>
2023-07-18 13:05:46 +03:00
Hedayat Vatankhah c31b4e2816
Fixes #723: merge short & long syntax of depends_on dependencies
Signed-off-by: Hedayat Vatankhah <hedayat.fwd@gmail.com>
2023-07-08 04:10:43 +03:30
Muayyad alsadi 3890eacf57 Merge branch 'Evedel-allow-config-to-merge-strings-and-dicts-in-build' into devel 2023-05-29 11:47:41 +03:00
Sergei Biriukov cfd24cc2e8 Merge branch 'devel' into allow-config-to-merge-strings-and-dicts-in-build
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 18:14:44 +10:00
Sergei Biriukov 79bfad103c move logic from rec_merge to normalize_service
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 10:42:44 +03:00
Sergei Biriukov d1509468c3 allow empty list to be a command/entrypoint
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 10:42:44 +03:00
Sergei Biriukov 9011e9faa1 add tests, dry up code, use shlex.split instead of str.split
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 10:42:44 +03:00
Sergei Biriukov 517aeba330 Allow config to merge strings and lists in command and entrypoint
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 10:42:44 +03:00
Sergei Biriukov 85d5d5dcc9 move logic from rec_merge to normalize_service
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-05-06 15:17:54 +10:00
Cleber Rosa 1ffd24dcf9 Python version support: sync verified and advertised versions
There are differences with regards to the versions of Python that are
verified (somehow) through Pylint, and the ones that are advertised.

Given that there's no pinning of Pylint versions, it shouldn't be
possible to use it on Python versions such as 3.5 and 3.6 (latest
Pylint doesn't support those).  With that, let's cover all the
currently supported Python versions.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
2023-05-06 00:28:13 +03:00
Sergei Biriukov 8c66b1cda7 add test case for when build is a complex dictionary
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-04-30 15:37:52 +10:00
Sergei Biriukov a0005db474 add code implementing build value merge
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-04-29 13:52:19 +10:00
Sergei Biriukov 221cf14501 add tests for build value merge
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-04-29 13:17:43 +10:00
Sergei Biriukov a61945b516 fix format
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-04-21 20:47:53 +03:00
Sergei Biriukov 6b6330c587 add build subcommand and --build arg to compose_run
Signed-off-by: Sergei Biriukov <svbiriukov@gmail.com>
2023-04-21 20:47:53 +03:00
BugFest 5d279c4948 Build-fail test example
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-12 22:25:33 +03:00
BugFest 5a3bdbf89b Exit code managed at PodmanCompose.run()
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-12 22:25:33 +03:00
BugFest 1eb166445b Linting fixes
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-12 22:25:33 +03:00
BugFest 82182b7bc6 Finish execution in compose_build only on command=build calls
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-12 22:25:33 +03:00
BugFest 3f4618866b Update project-1.env 2023-04-10 14:14:14 +03:00
BugFest 91bc6ebdb4 Keep chdir after loading env file
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 14:14:14 +03:00
BugFest 59a59c1a3a Fixes #636: env-file shall be resolved relative to the CWD
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 14:14:14 +03:00
BugFest 620f5d7473 pre-commit black config: run in check only mode
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 14:13:00 +03:00
BugFest 6f902faed0 Fix linting issues
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 14:12:32 +03:00
Muayyad Alsadi ccdf01e9b0 Revert "Use SELinux mount flag for secrets"
This reverts commit 874192568f.
2023-04-10 12:26:53 +03:00
Muayyad Alsadi e6b1eabe4c Revert "Use more lenient SELinux mount flag for secrets"
This reverts commit 75de39c239.
2023-04-10 12:26:53 +03:00
Henry Reed 75de39c239 Use more lenient SELinux mount flag for secrets
Signed-off-by: Henry Reed <60915078+henryreed@users.noreply.github.com>
2023-04-10 12:25:53 +03:00
Henry Reed 874192568f Use SELinux mount flag for secrets
Signed-off-by: Henry Reed <github.69ofd@simplelogin.com>
2023-04-10 12:25:53 +03:00
Bhavin Gandhi 0b853f29f4 Ignore access mode when merging volumes short syntax
The target path inside the container is treated as a key. Ref:
https://github.com/compose-spec/compose-spec/blob/master/spec.md#merging-service-definitions

Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
2023-04-10 12:25:05 +03:00
waechtjn 847f01a6c6 Add a docker-compose test file for uidmaps/gidmaps
Add a simple docker-compose.yml test to use the x-podman extension with
uidmaps and gitmaps
2023-04-10 12:22:25 +03:00
waechtjn e511e6420f FIXES #228: Add support for uidmap and gidmap
Implement an x-podman extension on the level of the individual services
to handle `--uidmap` and `--gidmap`
2023-04-10 12:22:25 +03:00
KuhnChris a9723ec1cf Added a way to start containers with multiple ips and nets
Signed-off-by: KuhnChris <kuhnchris@kuhnchris.eu>
2023-04-10 12:16:54 +03:00
Kuan-Yi Li 1cb608d8a7 allow project name to be fetched from dotenv
Look for project name in `self.environ` which includes both `os.environ`
and dotenv variables so that the project name can also be defined in an
environment file.

Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
2023-04-10 12:13:23 +03:00
Dixon Whitmire 252f1d57a5 updating black formatting for podman-compose.py
Signed-off-by: Dixon Whitmire <dixonwh@gmail.com>
2023-04-10 12:12:18 +03:00
Dixon Whitmire 13856d2e9c updating black formatting
Signed-off-by: Dixon Whitmire <dixonwh@gmail.com>
2023-04-10 12:12:18 +03:00
Dixon Whitmire 8d8df0bc28 Adding basic support for --profile argument
Signed-off-by: Dixon Whitmire <dixonwh@gmail.com>
2023-04-10 12:12:18 +03:00
Richard de Vos bc5f0123d9 add option to start podman in existing network namespace 2023-04-10 12:11:02 +03:00
Roman Blanco 9a08f85ffd FIXES #586: preserve exit code for podman-compose build
Signed-off-by: Roman Blanco <rblanco@redhat.com>
2023-04-10 12:10:16 +03:00
Benedikt Braunger 8625d7a4e8 add ipam-driver support
Signed-off-by: Benedikt Braunger <bb@emlix.com>
2023-04-10 12:02:47 +03:00
BugFest 016c97fd1e Fixes #663 - Fixes linting/pylint errors
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 11:53:47 +03:00
BugFest 2df11674c4 Fixes #661 - Fixes linting/flake8 errors
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 11:53:47 +03:00
BugFest 5eff38e743 Fixes #659: fix permissions when installing OS packages for linting/black
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-10 11:28:07 +03:00
Muayyad alsadi 7f5ce26b1b start version 1.0.7 and default with pod enabled by default 2023-04-09 14:08:54 +03:00
Muayyad alsadi f6dbce3618 version 1.0.6 2023-04-09 14:02:10 +03:00
Muayyad alsadi dfb64d884d fix pylint 2023-04-09 13:10:33 +03:00
Muayyad alsadi 990f774659 fix pylint 2023-04-09 12:47:15 +03:00
Muayyad alsadi 5e518c7ca7 #648: check if sed exists to color logs 2023-04-09 12:07:43 +03:00
Muayyad alsadi 9046f7eee0 #634: follow up 2023-04-09 12:00:45 +03:00
Benedikt Braunger ef55067834 add support for network priorities
Signed-off-by: Benedikt Braunger <bb@emlix.com>
2023-04-09 11:44:21 +03:00
Michel Jung ed2a6c0917 Support network_mode: none
Fixes #566
2023-04-09 11:36:30 +03:00
Sander Hoentjen b4c0792995 Add --remove-orphans on down command
Signed-off-by: Sander Hoentjen <shoentjen@antagonist.nl>
2023-04-09 11:35:46 +03:00
Sander Hoentjen e84451f4ea Allow environment parameters without value
Signed-off-by: Sander Hoentjen <shoentjen@antagonist.nl>
2023-04-09 11:34:25 +03:00
Excedrin 456370bd46 Support build secrets
Signed-off-by: Excedrin <290525+Excedrin@users.noreply.github.com>
2023-04-09 11:33:45 +03:00
molasses11 efe3714266 Add support for the `group_add` property of a service. 2023-04-09 11:33:16 +03:00
BugFest c55a2f4c26 Fixes #657: Support act and developer-friendly environment
Signed-off-by: BugFest <bugfest.dev@pm.me>
2023-04-09 11:31:12 +03:00
Muayyad alsadi b8a7593026 #154: timeout 2023-03-29 11:30:24 +03:00
Muayyad alsadi bd29ddb3e9 #154: no -t for start 2023-03-29 01:31:42 +03:00
Muayyad alsadi 38219eb85c FIXES #154: handle stop_grace_period 2023-03-28 17:33:02 +03:00
Dixon Whitmire 08ffcf6126 updating test_podman_compose_extends_w_file_subdir to use the correct image name
Signed-off-by: Dixon Whitmire <dixonwh@gmail.com>
2022-10-28 00:13:56 +02:00
dependabot[bot] 801faea30b Bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 00:00:10 +03:00
dependabot[bot] 06da9667f3 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 23:59:50 +03:00
John Losito de3f607758 Check for github actions updates weekly
Signed-off-by: John Losito <lositojohnj@gmail.com>
2022-10-17 18:15:27 +03:00
Aleksandr Mezin db1861d33f pull: accept service names as positional arguments
Fixes #547

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2022-09-01 23:07:56 +03:00
Simon Cornish 9d5b255927 Use top-level name property as project name if user doesn't set one explicitly
Signed-off-by: Simon Cornish <7t9jna402@sneakemail.com>
2022-08-18 10:00:28 +03:00
Muayyad alsadi 2d05c5c339 FIXES #534: add systemd unit label 2022-07-29 21:13:44 +03:00
Muayyad alsadi 3c460160e0 FIXES #534: add systemd unit label 2022-07-29 21:13:07 +03:00
Wilke Schwiedop 5b9cfe5d17 implement services.*.build.tags
https://github.com/compose-spec/compose-spec/blob/master/build.md#tags
2022-07-28 02:25:49 +03:00
Carmine Zaccagnino 8d1a4d7274 Implemented basic Bash shell completion
Signed-off-by: Carmine Zaccagnino <carmine@carminezacc.com>
2022-07-20 00:33:22 +03:00
inganault 859f03cbe6 Add healthcheck.disable support
Signed-off-by: inganault <p.po.oo.on.n@gmail.com>
2022-07-14 23:33:16 +03:00
Muayyad alsadi ae6be272b5 reformat 2022-07-14 00:59:10 +03:00
Mohammed Tayeh ccdb98c0e4 implement podman kill command
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2022-07-14 00:55:33 +03:00
Muayyad alsadi 909d05e718 reformat 2022-07-13 20:45:16 +03:00
Mohammed Tayeh 0cf98c7893 reimplement the of pause and unpause commands
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2022-07-13 20:31:46 +03:00
Mohammed Tayeh 843b876885 fix typo
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2022-07-13 20:31:46 +03:00
Mohammed Tayeh 1188463734 fix Typo podman-composer in version command
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2022-07-13 20:31:46 +03:00
Mohammed Tayeh 10580db329 Add pause,unpause commands support
Signed-off-by: Mohammed Tayeh <info@tayeh.me>
2022-07-13 20:31:46 +03:00
Muayyad alsadi f7d335dc6a #516: allow empty network 2022-07-04 18:21:31 +03:00
Muayyad alsadi 4a73ae86bc FIXES #511: ipv6 2022-06-29 12:03:54 +03:00
Muayyad alsadi f674ab8cfb #512: only use --net when bridge 2022-06-29 11:55:39 +03:00
Muayyad alsadi 265e0ca32a #512: only use --net when bridge 2022-06-29 10:46:47 +03:00
Muayyad alsadi 92662f3409 FIXES #511: ipv6 2022-06-28 15:58:19 +03:00
Muayyad alsadi 42c0078e6b mac_address with dash 2022-06-22 14:24:34 +03:00
Muayyad alsadi da5ee723c3 reformat 2022-06-21 21:54:44 +03:00
Muayyad alsadi 06fc0715fe reformat 2022-06-21 21:51:09 +03:00
Muayyad alsadi 9eda56caf9 FIXES #507: respecte mac_address 2022-06-21 21:48:45 +03:00
Stefan Marinov 13c8981c6d Fix help message for systemd subcommand
- Fix wording in docstring about initial setup of systemd service.
- Trim extra indentation at start of multiline docstrings.

Signed-off-by: Stefan Marinov <smarnv@dnl.sk>
2022-05-15 17:50:27 +03:00
Muayyad alsadi ee7029fbde reformat 2022-05-10 02:32:08 +03:00
Muayyad alsadi 75033a4ed7 add python demo example 2022-05-10 02:28:17 +03:00
Muayyad alsadi c175fd1b10 reformat 2022-05-10 01:30:03 +03:00
Muayyad alsadi d479001454 reference awesome-compose 2022-05-10 01:27:52 +03:00
Muayyad alsadi a2defdd06a example wordpress 2022-05-10 01:24:06 +03:00
Muayyad alsadi c55cd67bd2 #307: default to /etc/ 2022-05-10 01:13:34 +03:00
Daniel Roythorne eed38ce76c Fixed accidental deletion of project functionality. 2022-05-10 01:11:32 +03:00
Daniel Roythorne 86ffad86c7 Added port subcommand. 2022-05-10 01:11:32 +03:00
Gagootron 118d39b5bb Fix linter errors 2022-05-10 01:10:29 +03:00
Gagootron 814bd2a31a Support driver_opts for networks 2022-05-10 01:10:29 +03:00
ohxodi 606b9d94c8 Simplify var assignment 2022-04-29 17:11:58 +03:00
ohxodi 0057a4bb31 Fix default external name in dict case 2022-04-29 17:11:58 +03:00
ohxodi 8ecb74916d Update external volume name management 2022-04-29 17:11:58 +03:00
ohxodi d983056982 Update external volume name management 2022-04-29 17:11:58 +03:00
ohxodi ed302ca518 Fix external volume name when no name provided 2022-04-29 17:11:58 +03:00
ohxodi 0b5c844431 Add runtime error if no external volume exists 2022-04-29 17:11:58 +03:00
Muayyad alsadi 9c29c8914f FIXES #486: replace realpath with abspath 2022-04-27 13:01:24 +03:00
Bastian Venthur 89d2062579 Fixed some spelling and grammar issues
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2022-04-25 10:49:39 +03:00
Muz f42b568fc2 Correct the help text for --pod-args
Signed-off-by: Muz <git@mustaqila.li>
2022-04-10 22:21:35 +03:00
Muz Ali a1d3ba4ea2 Lint fixes for --services flag handling in config
Signed-off-by: Muz Ali <muz.ali@shopify.com>
2022-04-07 08:25:03 +03:00
Shane Smith 6be661f6da Support platform property
As per https://github.com/compose-spec/compose-spec/blob/master/spec.md#platform

Example:

```
services:
  mysql:
    image: mysql:5.7
    platform: linux/x86_64
```

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-04-07 08:24:46 +03:00
Muz fc3598faf2 Allow --services in config
Signed-off-by: Muz <git@mustaqila.li>
2022-04-04 11:20:41 +03:00
Muayyad alsadi fbff315e18 FIXES #464: accept -v in run 2022-03-29 21:17:02 +03:00
Muayyad alsadi fc34703dd4 format 2022-03-28 14:07:36 +03:00
Muayyad alsadi c7ada820de format 2022-03-28 13:54:55 +03:00
Muayyad alsadi 5e286f6356 format 2022-03-28 13:52:21 +03:00
Muayyad alsadi 3dd8b05d74 format 2022-03-28 13:47:28 +03:00
Muayyad alsadi 3ecb4b5dd5 FIXES #462: fix extends merge 2022-03-28 13:40:02 +03:00
Muayyad alsadi d05cad4c65 FIXES #462: fix extends merge 2022-03-28 13:32:22 +03:00
Muayyad alsadi ebb3dfe634 #452: better missing network message 2022-03-20 17:16:59 +03:00
Muayyad alsadi 7b99b38f0e nethost test 2022-03-19 00:17:22 +03:00
Muayyad alsadi 4ef8afc63e hit counter with redis cluster example 2022-03-19 00:12:48 +03:00
Muayyad alsadi a1aed09a58 GCR hello app 2022-03-18 23:14:26 +03:00
Muayyad alsadi 2cacf9cfb5 add echo example 2022-03-18 23:00:21 +03:00
Muayyad alsadi 4064c84521 add azure vote example 2022-03-18 22:43:18 +03:00
Muayyad alsadi 0dde95ac1d update gitignore 2022-03-18 18:34:01 +03:00
Muayyad alsadi 1be41b46a5 do not merge command array 2022-03-18 18:29:27 +03:00
Muayyad alsadi 105c27c8dc example nodejs project 2022-03-18 18:05:57 +03:00
Muayyad alsadi f820594257 use exec for wait 2022-03-18 15:50:24 +03:00
Muayyad alsadi 8a72321720 FIXES #409: detect changes and recreate 2022-03-16 15:27:30 +03:00
Muayyad alsadi 529391963d FIXES #409: detect changes and recreate 2022-03-16 15:25:57 +03:00
Muayyad alsadi 48a19f13fc print more help with systemd 2022-03-15 23:01:22 +03:00
Muayyad alsadi a9faabb1b0 print more help with systemd 2022-03-15 22:50:03 +03:00
Muayyad alsadi 3fb2b98ecc print more help with systemd 2022-03-15 22:47:54 +03:00
Muayyad alsadi b35b7e448a add systemd -a list 2022-03-14 14:17:49 +03:00
Muayyad alsadi 1a72e1e087 add systemd -a list 2022-03-14 14:05:20 +03:00
Muayyad alsadi b620311aaf FIXES #449: accept int port 2022-03-13 23:36:25 +03:00
Muayyad alsadi bf8004b04d systemd unit file 2022-03-13 11:20:59 +03:00
Muayyad alsadi cadf046306 fix pylint 2022-03-13 10:18:03 +03:00
Muayyad alsadi 8d8149cfe5 fix pylint 2022-03-13 10:12:36 +03:00
Muayyad alsadi 3dd981727b fix pylint 2022-03-13 10:08:48 +03:00
Muayyad alsadi 0b469e0590 format 2022-03-12 23:17:26 +03:00
Muayyad alsadi 9e3020a9df FIXES #307: systemd command 2022-03-12 23:08:24 +03:00
Muayyad alsadi fc9ed19b2b wait command 2022-03-12 21:16:16 +03:00
Muayyad alsadi 2d6bb52e36 FIXES #442: allow --no-pod or custom --pod-args 2022-03-08 21:22:43 +03:00
Muayyad alsadi 7942a091c3 FIXES #442: allow --no-pod or custom --pod-args 2022-03-08 21:13:14 +03:00
Muayyad alsadi 701311aa7a FIXES #447: support --env-file 2022-03-08 12:01:02 +03:00
Muayyad alsadi d7049150d0 FIXES #447: support --env-file 2022-03-08 10:57:44 +03:00
Muayyad alsadi 3b7bf81051 remove unused test 2022-03-08 10:47:16 +03:00
Tom Bu a735aa5b96 Fix inverted condition in merging arguments
Signed-off-by: Tom Bu <tombu@tombu.info>
2022-03-02 06:12:26 +03:00
Piotr Husiatyński b78509527b Fix linter issues
Make _cmd_desc a public attribute, so that it can be used outside of the
class methods.

Signed-off-by: Piotr Husiatyński <phusiatynski@gmail.com>
2022-03-01 17:16:04 +03:00
Piotr Husiatyński 762318093c Force black formatting
Black removes the burden of manual code formatting and is by now
considered the standard Python formatting tool.

https://black.readthedocs.io/en/stable/

Format all Python code with black.

GitHub linting action is updated to ensure all files are formatted with
Black.

Signed-off-by: Piotr Husiatyński <phusiatynski@gmail.com>
2022-03-01 17:16:04 +03:00
Muayyad alsadi af10345483 FIXES #440: absolute secret 2022-02-28 01:19:39 +03:00
Muayyad alsadi 2d1bcddf09 update readme 2022-02-26 03:13:38 +03:00
Muayyad alsadi 4f025679cf add unit tests 2022-02-26 03:10:35 +03:00
Muayyad alsadi 064521255b add badge 2022-02-26 02:58:26 +03:00
Muayyad alsadi b7c5609603 pylint 2022-02-26 02:51:06 +03:00
Muayyad alsadi 44508352e8 pylint 2022-02-26 02:49:34 +03:00
Muayyad alsadi 5c33e4efbb pylint 2022-02-26 01:41:07 +03:00
Muayyad alsadi cbd6f6b1b6 pylint cleanups 2022-02-26 00:48:42 +03:00
Muayyad alsadi de1e59d1d5 fix some pylint 2022-02-25 23:59:15 +03:00
Muayyad alsadi 2f0ca9e41d add pytest ci 2022-02-25 21:50:52 +03:00
Muayyad alsadi 59c9a69689 add pylint 2022-02-25 21:42:32 +03:00
Muayyad Alsadi b7eac1e898
pylint 2022-02-25 21:39:10 +03:00
Muayyad Alsadi 0d47e470fc
activate test 2022-02-25 21:30:15 +03:00
Piotr Husiatyński c2d7b26f2e #434: handle unknown service 2022-02-25 21:13:10 +03:00
Muayyad alsadi 1e895c0873 calc proper hash 2022-02-25 18:56:36 +03:00
Muayyad alsadi 132a22b524 #130: handle nested extend and normalize build context 2022-02-25 18:32:19 +03:00
kjunker 0bde01de07 remove unused imports
Signed-off-by: kjunker <junker.kurt@googlemail.com>
2022-02-22 13:26:44 +02:00
kjunker 91a579b81e Adding Test that the changes can build Image from build context of extended compose-file
Signed-off-by: kjunker <junker.kurt@googlemail.com>
2022-02-22 13:26:44 +02:00
kjunker 56b88639ad Fixing subdirectory from extends where extended service will build a Service from Dockerfile in an own subdirectory
Signed-off-by: kjunker <junker.kurt@googlemail.com>
2022-02-22 13:26:44 +02:00
Muayyad alsadi 5c3ec5f49a FIXES #431: support dns 2022-02-20 22:11:15 +02:00
Muayyad alsadi 779198b003 #379: no infra container 2022-02-17 17:19:25 +02:00
Muayyad alsadi 40cb6a760e log version 2022-02-17 13:36:44 +02:00
Muayyad alsadi 4fd9d86e17 #379: nothing shared in the pod to allow hostname 2022-02-17 13:28:31 +02:00
Devansh Sharma 2a2c3a09c1 Fix timeout value data type
Signed-off-by: Devansh Sharma <devansh.sharma@gmail.com>
2022-02-17 10:16:39 +02:00
Muayyad alsadi 80e852717d #379: create a pod 2022-02-15 01:55:28 +02:00
Muayyad alsadi d6e21dc752 FIXES #425: pass --requires 2022-02-15 01:33:00 +02:00
Muayyad alsadi b9b2f83d04 FIXES #415: allow network_mode=slirp4netns 2022-02-12 17:39:42 +02:00
Muayyad alsadi 9af65ea112 adjust comment 2022-02-12 17:35:04 +02:00
Muayyad alsadi 3e6e268034 test for logs 2022-02-12 13:54:30 +02:00
Cody Hutchins af6a3069ce fix syntax error without a new line
Signed-off-by: Cody Hutchins <codyhutchins@seed-innovations.com>
2022-02-12 13:47:45 +02:00
Cody Hutchins 68f745fe62 referenced unmerged pr #192 to bring colors into container logging
Signed-off-by: Cody Hutchins <codyhutchins@seed-innovations.com>
2022-02-12 13:47:45 +02:00
Muayyad alsadi 90dcfdbf44 FIXES #420: document -t 2022-02-12 13:42:00 +02:00
Geoffroy Doucet ed8635a9a3 FIXES #422: Remove debug print
Signed-off-by: Geoffroy Doucet <geoffroy.doucet@kloodz.com>
2022-02-12 13:35:58 +02:00
Adrian Torres 1d972ef174 Propagate all bind-type mount options
Before this commit, adding multiple options to a bind-type mount
(e.g. /foo/bar:/baz:Z,U) would result in a podman command in which
only the last option would be used (e.g. U).

This is because when parsing the mount string, a loop would go over
each mount option and assign it to mount_opt_dict, this meant that
this dict was overridden for each option, thus only the last option
in the mount string would be kept and passed onto podman.

This commit solves this by appending to a temporary list and then
converting it to a comma-separated string and assigning it to the
mount_opt_dict.

Fixes #412

Signed-off-by: Adrian Torres <atorresj@redhat.com>
2022-02-12 13:27:49 +02:00
Bernd Schoolmann 536925ca78 FIXES #413: parse network_mode: container:container_name correctly
Signed-off-by: Bernd Schoolmann <mail@quexten.com>
2022-01-30 14:55:21 +02:00
Muayyad alsadi 09c6cbe503 FIXES #408: preserve exit code 2022-01-22 00:24:17 +02:00
Muayyad alsadi 154a51245f FIXES #386: make sure volumes are present in top level 2022-01-22 00:15:05 +02:00
Muayyad alsadi 523d215b48 #407: allow network_mode=service:mysrv 2022-01-18 20:40:29 +02:00
Muayyad Alsadi 25494b5f6e
Update README.md 2022-01-18 17:57:37 +02:00
tengattack 19662c02a1 Fix healthcheck test type on replicas 2022-01-15 20:22:05 +02:00
Muayyad alsadi 4943e52344 #395: make podman respect PODMAN_* in .env 2022-01-12 22:06:47 +02:00
Muayyad alsadi 4aa08cd016 FIXES #399: pass specific ip 2022-01-12 21:48:42 +02:00
Muayyad alsadi 15e0ab9261 FIXES #397: support host network mode 2022-01-12 15:44:47 +02:00
Muayyad alsadi f66861f89a #249: read COMPOSE_PROJECT_NAME env 2022-01-12 15:37:07 +02:00
Luiz Carvalho af53b65068 Simplify volume identification
The filtering provided by "volume ls" did not work as expected
in previous versions of podman:
https://github.com/containers/podman/pull/8345

Verified that this now works properly on podman 3.4.4

Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
2022-01-06 17:39:52 +02:00
Muayyad Alsadi 890c584881
Update README.md 2022-01-04 16:18:20 +02:00
Mohamed Akram 0bd493f1ba Allow empty default/error value in substitution 2021-12-31 18:40:26 +02:00
Muayyad alsadi 481c6d0a41 #394: config: multiple yaml 2021-12-31 01:54:32 +02:00
Hao Luo 31df70b8d2 updated per maintainer review 2021-12-31 01:39:03 +02:00
Hao Luo df400518a7 removes version from CONTRIBUTING 2021-12-31 01:39:03 +02:00
Hao Luo 21a716cfd3 added log back in 2021-12-31 01:39:03 +02:00
Hao Luo f00ac92640 added config command 2021-12-31 01:39:03 +02:00
Hao Luo 0433410702 added args for version 2021-12-31 01:39:03 +02:00
Muayyad alsadi 0f9fe2bf9f FiXES #393: missing arg when build as part of run 2021-12-31 01:17:26 +02:00
Muayyad alsadi a1be5ce6b3 add fallback to get 2021-12-31 00:06:48 +02:00
Mohamed Akram 56a4988481 Add support for volume driver and options 2021-12-31 00:04:58 +02:00
Mohamed Akram 377b5525c9 Fix substitution for empty variables 2021-12-31 00:00:10 +02:00
Muayyad alsadi c50599c0e7 FIXES #388: do not force build in run 2021-12-28 21:03:21 +02:00
Muayyad alsadi 4557279930 #88: multiple aliases 2021-12-25 21:06:29 +02:00
Muayyad alsadi 7ad377557d FIXES #380: output to stderr 2021-12-24 18:55:30 +02:00
Viacheslav Dubrovskyi 30051c2f5b Update README.md. Add link to podman dns plugin source 2021-12-24 14:05:46 +02:00
Muayyad alsadi 9e8e25c159 #378: down -v 2021-12-23 01:17:34 +02:00
Muayyad alsadi 2c60516f77 fix hostname in test 2021-12-23 00:34:01 +02:00
379 changed files with 15784 additions and 1456 deletions

1
.codespellignore Normal file
View File

@ -0,0 +1 @@
assertIn

4
.codespellrc Normal file
View File

@ -0,0 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg,requirements.txt,test-requirements.txt
# poped - loved variable name
ignore-words-list = poped

2
.coveragerc Normal file
View File

@ -0,0 +1,2 @@
[run]
parallel=True

19
.editorconfig Normal file
View File

@ -0,0 +1,19 @@
root = true
[*]
indent_style = space
indent_size = tab
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.py]
indent_style = space

View File

@ -13,8 +13,6 @@ A clear and concise description of what the bug is.
Please make sure it's not a bug in podman (in that case report it to podman)
or your understanding of docker-compose or how rootless containers work (for example, it's normal for rootless container not to be able to listen for port less than 1024 like 80)
please try to reproduce the bug in latest devel branch
**To Reproduce**
Steps to reproduce the behavior:
1. what is the content of the current working directory (ex. `docker-compose.yml`, `.env`, `Dockerfile`, ...etc.)
@ -35,7 +33,7 @@ What is the behavior you actually got and that should not happen.
```
$ podman-compose version
using podman version: 3.4.0
podman-composer version 0.1.7dev
podman-compose version 0.1.7dev
podman --version
podman version 3.4.0

10
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,10 @@
## Contributor Checklist:
If this PR adds a new feature that improves compatibility with docker-compose, please add a link
to the exact part of compose spec that the PR touches.
For any user-visible change please add a release note to newsfragments directory, e.g.
newsfragments/my_feature.feature. See newsfragments/README.md for more details.
All changes require additional unit tests.

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

22
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,22 @@
---
name: Codespell
on:
push:
pull_request:
permissions:
contents: read
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
ignore_words_file: .codespellignore

27
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build binary
run: |
mkdir -p release/
docker build -t podman-compose-bin -v "$PWD/release:/result" .
mv "$PWD/release/podman-compose" "$PWD/release/podman-compose-linux-x86"
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: ./release/podman-compose-linux-x86
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

32
.github/workflows/static-checks.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Static checks
on:
- push
- pull_request
jobs:
static-checks:
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.11-bookworm
# cgroupns needed to address the following error:
# write /sys/fs/cgroup/cgroup.subtree_control: operation not supported
options: --privileged --cgroupns=host
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
set -e
pip install -r test-requirements.txt
- name: Analysing the code using ruff
run: |
set -e
ruff format --check
ruff check
- name: Analysing the code using mypy
run: |
set -e
mypy .
- name: Analysing the code with pylint
run: |
pylint podman_compose.py

40
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
runs-on: ubuntu-latest
container:
image: "docker.io/library/python:${{ matrix.python-version }}-bookworm"
# cgroupns needed to address the following error:
# write /sys/fs/cgroup/cgroup.subtree_control: operation not supported
options: --privileged --cgroupns=host
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
set -e
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y podman
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Run integration tests
run: |
python -m unittest discover -v tests/integration
env:
TESTS_DEBUG: 1
- name: Run unit tests
run: |
coverage run --source podman_compose -m unittest discover tests/unit
- name: Report coverage
run: |
coverage combine
coverage report --format=markdown | tee -a $GITHUB_STEP_SUMMARY

5
.gitignore vendored
View File

@ -47,6 +47,8 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
test-compose.yaml
test-compose-?.yaml
# Translations
*.mo
@ -103,3 +105,6 @@ venv.bak/
# mypy
.mypy_cache/
.vscode

34
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,34 @@
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: ruff
types: [python]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
types: [python]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=.pylintrc", # Link to your config file
]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
- repo: https://github.com/gklein/check_signoff
rev: v1.0.5
hooks:
- id: check-signoff

View File

@ -1,13 +1,18 @@
[MESSAGES CONTROL]
disable=W0614,C0410,C0321,C0111,I0011,C0103
# C0111 missing-docstring: missing-class-docstring, missing-function-docstring, missing-method-docstring, missing-module-docstrin
# consider-using-with: we need it for color formatter pipe
disable=too-many-lines,too-many-branches,too-many-locals,too-many-statements,too-many-arguments,too-many-instance-attributes,fixme,multiple-statements,missing-docstring,line-too-long,consider-using-f-string,consider-using-with,unnecessary-lambda-assignment,broad-exception-caught
# allow _ for ignored variables
# allow generic names like a,b,c and i,j,k,l,m,n and x,y,z
# allow k,v for key/value
# allow e for exceptions, it for iterator
# allow e for exceptions, it for iterator, ix for index
# allow ip for ip address
# allow w,h for width, height
# allow op for operation/operator/opcode
# allow t, t0, t1, t2, and t3 for time
# allow dt for delta time
# allow db for database
# allow ls for list
good-names=_,a,b,c,dt,db,e,f,fn,fd,i,j,k,v,kv,kw,l,m,n,ls,t,t0,t1,t2,t3,w,h,x,y,z,it,op
# allow p for pipe
# allow ex for examples, exists ..etc
good-names=_,a,b,c,dt,db,e,f,fn,fd,i,j,k,v,kv,kw,l,m,n,ls,t,t0,t1,t2,t3,w,h,x,y,z,it,ix,ip,op,p,ex

View File

@ -1,74 +1,135 @@
# Contributing to podman-compose
## Who can contribute?
- Users that found a bug,
- Users that want to propose new functionalities or enhancements,
- Users that want to help other users to troubleshoot their environments,
- Developers that want to fix bugs,
- Developers that want to implement new functionalities or enhancements.
## Development environment setup
Note: Some steps are OPTIONAL but all are RECOMMENDED.
1. Fork the project repository and clone it:
```shell
$ git clone https://github.com/USERNAME/podman-compose.git
$ cd podman-compose
```
2. (OPTIONAL) Create a Python virtual environment. Example using
[virtualenv wrapper](https://virtualenvwrapper.readthedocs.io/en/latest/):
```shell
$ mkvirtualenv podman-compose
```
3. Install the project runtime and development requirements:
```shell
$ pip install '.[devel]'
```
4. (OPTIONAL) Install `pre-commit` git hook scripts
(https://pre-commit.com/#3-install-the-git-hook-scripts):
```shell
$ pre-commit install
```
5. Create a new branch, develop and add tests when possible.
6. Run linting and testing before committing code. Ensure all the hooks are passing.
```shell
$ pre-commit run --all-files
```
7. Run code coverage:
```shell
$ coverage run --source podman_compose -m unittest discover tests/unit
$ python3 -m unittest discover tests/integration
$ coverage combine
$ coverage report
$ coverage html
```
8. Commit your code to your fork's branch.
- Make sure you include a `Signed-off-by` message in your commits.
Read [this guide](https://github.com/containers/common/blob/main/CONTRIBUTING.md#sign-your-prs)
to learn how to sign your commits.
- In the commit message, reference the Issue ID that your code fixes and a brief description of
the changes.
Example: `Fixes #516: Allow empty network`
9. Open a pull request to `containers/podman-compose` and wait for a maintainer to review your work.
## Adding new commands
To add a command you need to add a function that is decorated
with `@cmd_run` passing the compose instance, command name and
description. the wrapped function should accept two arguments
the compose instance and the command-specific arguments (resulted
from python's `argparse` package) inside that command you can
run PodMan like this `compose.podman.run(['inspect', 'something'])`
and inside that function you can access `compose.pods`
and `compose.containers` ...etc.
Here is an example
To add a command, you need to add a function that is decorated with `@cmd_run`.
```
The decorated function must be declared `async` and should accept two arguments: The compose
instance and the command-specific arguments (resulted from the Python's `argparse` package).
In this function, you can run Podman (e.g. `await compose.podman.run(['inspect', 'something'])`),
access `compose.pods`, `compose.containers` etc.
Here is an example:
```python
@cmd_run(podman_compose, 'build', 'build images defined in the stack')
def compose_build(compose, args):
compose.podman.run(['build', 'something'])
async def compose_build(compose, args):
await compose.podman.run(['build', 'something'])
```
## Command arguments parsing
Add a function that accept `parser` which is an instance from `argparse`.
In side that function you can call `parser.add_argument()`.
The function decorated with `@cmd_parse` accepting the compose instance,
and command names (as a list or as a string).
You can do this multiple times.
To add arguments to be parsed by a command, you need to add a function that is decorated with
`@cmd_parse` which accepts the compose instance and the command's name (as a string list or as a
single string).
Here is an example
The decorated function should accept a single argument: An instance of `argparse`.
```
In this function, you can call `parser.add_argument()` to add a new argument to the command.
Note you can add such a function multiple times.
Here is an example:
```python
@cmd_parse(podman_compose, 'build')
def compose_build_parse(parser):
parser.add_argument("--pull",
help="attempt to pull a newer version of the image", action='store_true')
parser.add_argument("--pull-always",
help="attempt to pull a newer version of the image, Raise an error even if the image is present locally.", action='store_true')
help="Attempt to pull a newer version of the image, "
"raise an error even if the image is present locally.",
action='store_true')
```
NOTE: `@cmd_parse` should be after `@cmd_run`
NOTE: `@cmd_parse` should be after `@cmd_run`.
## Calling a command from inside another
## Calling a command from another one
If you need to call `podman-compose down` from inside `podman-compose up`
do something like:
If you need to call `podman-compose down` from `podman-compose up`, do something like:
```
```python
@cmd_run(podman_compose, 'up', 'up desc')
def compose_up(compose, args):
compose.commands['down'](compose, args)
async def compose_up(compose, args):
await compose.commands['down'](compose, args)
# or
compose.commands['down'](argparse.Namespace(foo=123))
await compose.commands['down'](argparse.Namespace(foo=123))
```
## Missing Commands (help needed)
```
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
events Receive real time events from containers
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
top Display the running processes
unpause Unpause services
version Show the Docker-Compose version information
```

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
# Use a base image with necessary build tools
FROM python:3.11-slim AS builder
# Install required packages for building
RUN apt-get update && apt-get install -y \
gcc \
musl-dev \
build-essential \
python3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy the application code
COPY . .
# Install PyInstaller
RUN pip install pyinstaller
RUN pip install -r requirements.txt
# Create a binary with PyInstaller
RUN pyinstaller --onefile --clean podman_compose.py
# Create /result dir in case it is not mounted
RUN mkdir -p /result
# Export binary
RUN cp /app/dist/podman_compose /result/podman-compose

113
README.md
View File

@ -1,19 +1,25 @@
# Podman Compose
## [![Tests](https://github.com/containers/podman-compose/actions/workflows/test.yml/badge.svg)](https://github.com/containers/podman-compose/actions/workflows/test.yml)
An implementation of [Compose Spec](https://compose-spec.io/) with [Podman](https://podman.io/) backend.
This project focus on:
This project focuses on:
* rootless
* daemon-less process model, we directly execute podman, no running daemon.
This project only depend on:
This project only depends on:
* `podman`
* [podman dnsname plugin](https://github.com/containers/dnsname): It is usually found in
the `podman-plugins` or `podman-dnsname` distro packages, those packages are not pulled
by default and you need to install them. This allows containers to be able to resolve
each other if they are on the same CNI network. This is not necessary when podman is using
netavark as a network backend.
* Python3
* [PyYAML](https://pyyaml.org/)
* [python-dotenv](https://pypi.org/project/python-dotenv/)
And it's formed as a single python file script that you can drop into your PATH and run.
And it's formed as a single Python file script that you can drop into your PATH and run.
## References:
@ -38,13 +44,19 @@ OpenShift/Kubernetes distribution like [OKD](https://www.okd.io/).
If you have legacy version of `podman` (before 3.1.0) you might need to stick with legacy `podman-compose` `0.1.x` branch.
The legacy branch 0.1.x uses mappings and workarounds to compensate for rootless limitations.
Modern podman versions (>=3.4) do not have those limitations and thus you can use latest and stable 1.x branch.
Modern podman versions (>=3.4) do not have those limitations, and thus you can use latest and stable 1.x branch.
If you are upgrading from `podman-compose` version `0.1.x` then we no longer have global option `-t` to set mapping type
like `hostnet`. If you desire that behavior, pass it the standard way like `network_mode: host` in the YAML.
## Installation
Install latest stable version from PyPI:
### Pip
```
Install the latest stable version from PyPI:
```bash
pip3 install podman-compose
```
@ -52,59 +64,68 @@ pass `--user` to install inside regular user home without being root.
Or latest development version from GitHub:
```
pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz
```bash
pip3 install https://github.com/containers/podman-compose/archive/main.tar.gz
```
or
### Package repositories
podman-compose is available from the following package repositories:
Debian:
```bash
sudo apt install podman-compose
```
curl -o /usr/local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py
Fedora (starting from f31) repositories:
```bash
sudo dnf install podman-compose
```
Homebrew:
```bash
brew install podman-compose
```
### Generate binary using docker/podman locally
This script will download the repo, generate the binary using [this Dockerfile](https://github.com/containers/podman-compose/blob/main/Dockerfile), and place the binary in the directory where you called this script.
```bash
sh -c "$(curl -sSL https://raw.githubusercontent.com/containers/podman-compose/main/scripts/download_and_build_podman-compose.sh)"
```
### Manual
```bash
curl -o /usr/local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/main/podman_compose.py
chmod +x /usr/local/bin/podman-compose
```
or inside your home
```
curl -o ~/.local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py
```bash
curl -o ~/.local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/main/podman_compose.py
chmod +x ~/.local/bin/podman-compose
```
or install from Fedora (starting from f31) repositories:
```
sudo dnf install podman-compose
```
## Basic Usage
We have included fully functional sample stacks inside `examples/` directory.
A quick example would be
```
cd examples/busybox
podman-compose --help
podman-compose up --help
podman-compose up
```
A more rich example can be found in [examples/awx3](examples/awx3)
which have
- A Postgres Database
- RabbitMQ server
- MemCached server
- a django web server
- a django tasks
When testing the `AWX3` example, if you got errors just wait for db migrations to end.
There is also AWX 17.1.0
## Tests
Inside `tests/` directory we have many useless docker-compose stacks
that are meant to test as much cases as we can to make sure we are compatible
podman-compose is tested via unit and integration tests.
Unit tests can be run via the following:
```shell
python3 -m unittest discover tests/unit
```
Integration tests can be run via the following:
```shell
python3 -m unittest discover tests/integration
```
# Contributing guide
If you are a user or a developer and want to contribute please check the [CONTRIBUTING](CONTRIBUTING.md) section

47
RELEASING.md Normal file
View File

@ -0,0 +1,47 @@
Creating a release
==================
This file contains instructions for maintainers on how to release new versions of podman-compose.
Step 1: Initialize variables for subsequent steps
-------------------------------------------------
```
export VERSION=1.2.3
```
Step 2: Release notes PR
------------------------
Open a new branch (e.g. `release`) and run the following:
```
./scripts/make_release_notes.sh $VERSION
```
This collects the release notes using the `towncrier` tool and then commits the result.
This step is done as a PR so that CI can check for spelling errors and similar issues.
Certain file names are not properly supported by the `towncrier` tool and it ignores them.
Check `newsfragments` directory for any forgotten release notes
Step 3: Merge the release notes PR
----------------------------------
Step 4: Perform actual release
------------------------------
Pull the merge commit created on the `main` branch during the step 2.
Then run:
```
./scripts/make_release.sh $VERSION
```
This will create release commit, tag and push everything.
Step 5: Create a release on Github
----------------------------------
The release notes must be added manually by drafting a release on the GitHub UI at
https://github.com/containers/podman-compose/releases.

View File

@ -0,0 +1,411 @@
# Naming convention:
# * _camelCase for function names
# * snake_case for variable names
# all functions will return 0 if they successfully complete the argument
# (or establish there is no need or no way to complete), and something
# other than 0 if that's not the case
# complete arguments to global options
_completeGlobalOptArgs() {
# arguments to options that take paths as arguments: complete paths
for el in ${path_arg_global_opts}; do
if [[ ${prev} == ${el} ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
return 0
fi
done
# arguments to options that take generic arguments: don't complete
for el in ${generic_arg_global_opts}; do
if [[ ${prev} == ${el} ]]; then
return 0
fi
done
return 1
}
# complete root subcommands and options
_completeRoot() {
# if we're completing an option
if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${global_opts}" -- ${cur}) )
return 0
fi
# complete root commands
COMPREPLY=( $(compgen -W "${root_commands}" -- ${cur}) )
return 0
}
# complete names of Compose services
_completeServiceNames() {
# ideally we should complete service names,
# but parsing the compose spec file in the
# completion script is quite complex
return 0
}
# complete commands to run inside containers
_completeCommand() {
# we would need to complete commands to run inside
# a container
return 0
}
# complete the arguments for `podman-compose up` and return 0
_completeUpArgs() {
up_opts="${help_opts} -d --detach --no-color --quiet-pull --no-deps --force-recreate --always-recreate-deps --no-recreate --no-build --no-start --build --abort-on-container-exit -t --timeout -V --renew-anon-volumes --remove-orphans --scale --exit-code-from --pull --pull-always --build-arg --no-cache"
if [[ ${prev} == "--scale" || ${prev} == "-t" || ${prev} == "--timeout" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${up_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose exec` and return 0
_completeExecArgs() {
exec_opts="${help_opts} -d --detach --privileged -u --user -T --index -e --env -w --workdir"
if [[ ${prev} == "-u" || ${prev} == "--user" || ${prev} == "--index" || ${prev} == "-e" || ${prev} == "--env" || ${prev} == "-w" || ${prev} == "--workdir" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${exec_opts}" -- ${cur}) )
return 0
elif [[ ${comp_cword_adj} -eq 2 ]]; then
# complete service name
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
elif [[ ${comp_cword_adj} -eq 3 ]]; then
_completeCommand
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose down` and return 0
_completeDownArgs() {
down_opts="${help_opts} -v --volumes -t --timeout --remove-orphans"
if [[ ${prev} == "-t" || ${prev} == "--timeout" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${down_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose build` and return 0
_completeBuildArgs() {
build_opts="${help_opts} --pull --pull-always --build-arg --no-cache"
if [[ ${prev} == "--build-arg" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${build_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose logs` and return 0
_completeLogsArgs() {
logs_opts="${help_opts} -f --follow -l --latest -n --names --since -t --timestamps --tail --until"
if [[ ${prev} == "--since" || ${prev} == "--tail" || ${prev} == "--until" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${logs_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose ps` and return 0
_completePsArgs() {
ps_opts="${help_opts} -q --quiet"
if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${ps_opts}" -- ${cur}) )
return 0
else
return 0
fi
}
# complete the arguments for `podman-compose pull` and return 0
_completePullArgs() {
pull_opts="${help_opts} --force-local"
if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${pull_opts}" -- ${cur}) )
return 0
else
return 0
fi
}
# complete the arguments for `podman-compose push` and return 0
_completePushArgs() {
push_opts="${help_opts} --ignore-push-failures"
if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${push_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose restart` and return 0
_completeRestartArgs() {
restart_opts="${help_opts} -t --timeout"
if [[ ${prev} == "-t" || ${prev} == "--timeout" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${restart_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose stop` and return 0
_completeStopArgs() {
stop_opts="${help_opts} -t --timeout"
if [[ ${prev} == "-t" || ${prev} == "--timeout" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${stop_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose start` and return 0
_completeStartArgs() {
start_opts="${help_opts}"
if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${start_opts}" -- ${cur}) )
return 0
else
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
return 0
fi
}
# complete the arguments for `podman-compose run` and return 0
_completeRunArgs() {
run_opts="${help_opts} -d --detach --privileged -u --user -T --index -e --env -w --workdir"
if [[ ${prev} == "-u" || ${prev} == "--user" || ${prev} == "--index" || ${prev} == "-e" || ${prev} == "--env" || ${prev} == "-w" || ${prev} == "--workdir" ]]; then
return 0
elif [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${run_opts}" -- ${cur}) )
return 0
elif [[ ${comp_cword_adj} -eq 2 ]]; then
# complete service name
_completeServiceNames
if [[ $? -eq 0 ]]; then
return 0
fi
elif [[ ${comp_cword_adj} -eq 3 ]]; then
_completeCommand
if [[ $? -eq 0 ]]; then
return 0
fi
fi
}
_podmanCompose() {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
root_commands="help version pull push build up down ps run exec start stop restart logs"
# options to output help text (used as global and subcommand options)
help_opts="-h --help"
# global options that don't take additional arguments
basic_global_opts="${help_opts} -v --no-ansi --no-cleanup --dry-run"
# global options that take paths as arguments
path_arg_global_opts="-f --file --podman-path"
path_arg_global_opts_array=($arg_global_opts)
# global options that take arguments that are not files
generic_arg_global_opts="-p --project-name --podman-path --podman-args --podman-pull-args --podman-push-args --podman-build-args --podman-inspect-args --podman-run-args --podman-start-args --podman-stop-args --podman-rm-args --podman-volume-args"
generic_arg_global_opts_array=($generic_arg_global_opts)
# all global options that take arguments
arg_global_opts="${path_arg_global_opts} ${generic_arg_global_opts}"
arg_global_opts_array=($arg_global_opts)
# all global options
global_opts="${basic_global_opts} ${arg_global_opts}"
chosen_root_command=""
_completeGlobalOptArgs
if [[ $? -eq 0 ]]; then
return 0
fi
# computing comp_cword_adj, which thruthfully tells us how deep in the subcommands tree we are
# additionally, set the chosen_root_command if possible
comp_cword_adj=${COMP_CWORD}
if [[ ${COMP_CWORD} -ge 2 ]]; then
skip_next="no"
for el in ${COMP_WORDS[@]}; do
# if the user has asked for help text there's no need to complete further
if [[ ${el} == "-h" || ${el} == "--help" ]]; then
return 0
fi
if [[ ${skip_next} == "yes" ]]; then
let "comp_cword_adj--"
skip_next="no"
continue
fi
if [[ ${el} == -* && ${el} != ${cur} ]]; then
let "comp_cword_adj--"
for opt in ${arg_global_opts_array[@]}; do
if [[ ${el} == ${opt} ]]; then
skip_next="yes"
fi
done
elif [[ ${el} != ${cur} && ${el} != ${COMP_WORDS[0]} && ${chosen_root_command} == "" ]]; then
chosen_root_command=${el}
fi
done
fi
if [[ ${comp_cword_adj} -eq 1 ]]; then
_completeRoot
# Given that we check the value of comp_cword_adj outside
# of it, at the moment _completeRoot should always return
# 0, this is just here in case changes are made. The same
# will apply to similar functions below
if [[ $? -eq 0 ]]; then
return 0
fi
fi
case $chosen_root_command in
up)
_completeUpArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
down)
_completeDownArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
exec)
_completeExecArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
build)
_completeBuildArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
logs)
_completeLogsArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
ps)
_completePsArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
pull)
_completePullArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
push)
_completePushArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
restart)
_completeRestartArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
start)
_completeStartArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
stop)
_completeStopArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
run)
_completeRunArgs
if [[ $? -eq 0 ]]; then
return 0
fi
;;
esac
}
complete -F _podmanCompose podman-compose

33
docs/Changelog-1.1.0.md Normal file
View File

@ -0,0 +1,33 @@
Version v1.1.0 (2024-04-17)
===========================
Bug fixes
---------
- Fixed support for values with equals sign in `-e` argument of `run` and `exec` commands.
- Fixed duplicate arguments being emitted in `stop` and `restart` commands.
- Removed extraneous debug output. `--verbose` flag has been added to preserve verbose output.
- Links aliases are now added to service aliases.
- Fixed image build process to use defined environmental variables.
- Empty list is now allowed to be `COMMAND` and `ENTRYPOINT`.
- Environment files are now resolved relative to current working directory.
- Exit code of container build is now preserved as return code of `build` command.
New features
------------
- Added support for `uidmap`, `gidmap`, `http_proxy` and `runtime` service configuration keys.
- Added support for `enable_ipv6` network configuration key.
- Added `--parallel` option to support parallel pulling and building of images.
- Implemented support for maps in `sysctls` container configuration key.
- Implemented `stats` command.
- Added `--no-normalize` flag to `config` command.
- Added support for `include` global configuration key.
- Added support for `build` command.
- Added support to start containers with multiple networks.
- Added support for `profile` argument.
- Added support for starting podman in existing network namespace.
- Added IPAM driver support.
- Added support for file secrets being passed to `podman build` via `--secret` argument.
- Added support for multiple networks with separately specified IP and MAC address.
- Added support for `service.build.ulimits` when building image.

40
docs/Changelog-1.2.0.md Normal file
View File

@ -0,0 +1,40 @@
Version v1.2.0 (2024-06-26)
===========================
Bug fixes
---------
- Fixed handling of `--in-pod` argument. Previously it was hard to provide false value to it.
- podman-compose no longer creates pods when registering systemd unit.
- Fixed warning `RuntimeWarning: coroutine 'create_pods' was never awaited`
- Fixed error when setting up IPAM network with default driver.
- Fixed support for having list and dictionary `depends_on` sections in related compose files.
- Fixed logging of failed build message.
- Fixed support for multiple entries in `include` section.
- Fixed environment variable precedence order.
Changes
-------
- `x-podman` dictionary in container root has been migrated to `x-podman.*` fields in container root.
New features
------------
- Added support for `--publish` in `podman-compose run`.
- Added support for Podman external root filesystem management (`--rootfs` option).
- Added support for `podman-compose images` command.
- Added support for `env_file` being configured via dictionaries.
- Added support for enabling GPU access.
- Added support for selinux in verbose mount specification.
- Added support for `additional_contexts` section.
- Added support for multi-line environment files.
- Added support for passing contents of `podman-compose.yml` via stdin.
- Added support for specifying the value for `--in-pod` setting in `podman-compose.yml` file.
- Added support for environmental secrets.
Documentation
-------------
- Added instructions on how to install podman-compose on Homebrew.
- Added explanation that netavark is an alternative to dnsname plugin

38
docs/Changelog-1.3.0.md Normal file
View File

@ -0,0 +1,38 @@
Version 1.3.0 (2025-01-07)
==========================
Bug fixes
---------
- Fixed support for de-facto alternative `Dockerfile` names (e.g. `Containerfile`)
- Fixed a bug that caused attempts to create already existing pods multiple times.
- Fixed compatibility with docker-compose in how symlinks to docker-compose.yml are handled.
- Fixed freeze caused by too long log lines without a newline.
- Fixed support for `network_mode: none`.
- Improved error detection by rejecting service definitions that contain both `network_mode` and
`networks` keys, which is not allowed.
Features
--------
- Added support for build labels.
- Added support for "platform" property in the build command.
- Added support for "ssh" property in the build command.
- Added support for cache_from and cache_to fields in build section.
- Added support for honoring the condition in the depends_on section of the service, if stated.
- Added `x-podman.no_hosts` setting to pass `--no-hosts` to podman run
- Added support for compatibility with docker compose for default network behavior when no network
defined in service. This is controlled via `default_net_behavior_compat` feature flag.
- Added a way to get compatibility of default network names with docker compose.
This is selected by setting `default_net_name_compat: true` on `x-podman` global dictionary.
- Added support for the `device_cgroup_rules` property in services.
- Added support for removing networks in `podman-compose down`.
- Added support for network scoped service aliases.
- Added support for network level `mac_address` attribute.
- Added ability to substitute variables with the environment of the service.
Misc
----
- Declared compatibility with Python 3.13.

39
docs/Changelog-1.4.0.md Normal file
View File

@ -0,0 +1,39 @@
Version 1.4.0 (2025-05-10)
==========================
Bug fixes
---------
- Fixed handling of relative includes and extends in compose files
- Fixed error when merging arguments in list and dictionary syntax
- Fixed issue where short-lived containers could execute twice when using `up` in detached mode
- Fixed `up` command hanging on Podman versions earlier than 4.6.0
- Fixed issue where `service_healthy` conditions weren't enforced during `up` command
- Fixed support for the `--scale` flag
- Fixed bug causing dependent containers to start despite `--no-deps` flag
- Fixed port command behavior for dynamic host ports
- Fixed interpolation of `COMPOSE_PROJECT_NAME` when set from top-level `name` in compose file
- Fixed project name evaluation order to match compose spec
- Fixed build context when using git URLs
- Fixed `KeyError` when `down` is called with non-existent service
- Skip `down` during `up` when no active containers exist
- Fixed non-zero exit code on failure when using `up -d`
- Fixed SIGINT handling during `up` command for graceful shutdown
- Fixed `NotImplementedError` when interrupted on Windows
Features
--------
- Added `--quiet` flag to `config` command to suppress output
- Added support for `pids_limit` and `deploy.resources.limits.pids`
- Added `--abort-on-container-failure` option
- Added `--rmi` argument to `down` command for image removal
- Added support for `x-podman.disable-dns` to disable DNS plugin on defined networks
- Added support for `x-podman.dns` to set DNS nameservers for defined networks
- Improved file descriptor handling - no longer closes externally created descriptors.
This allows descriptors created e.g. via systemd socket activation to be passed to
containers.
- Added support for `cpuset` configuration
- Added support for `reset` and `override` tags when merging compose files
- Added support for `x-podman.interface_name` to set network interface names
- Added support for `x-podman.pod_args` to override default `--pod-args`

7
docs/Changelog-1.4.1.md Normal file
View File

@ -0,0 +1,7 @@
Version 1.4.1 (2025-06-05)
==========================
Bug fixes
---------
- Fixed relative host path resolution for volume bind mount source

260
docs/Extensions.md Normal file
View File

@ -0,0 +1,260 @@
# Podman specific extensions to the docker-compose format
Podman-compose supports the following extension to the docker-compose format. These extensions
are generally specified under fields with "x-podman" prefix in the compose file.
## Container management
The following extension keys are available under container configuration:
* `x-podman.uidmaps` - Run the container in a new user namespace using the supplied UID mapping.
* `x-podman.gidmaps` - Run the container in a new user namespace using the supplied GID mapping.
* `x-podman.rootfs` - Run the container without requiring any image management; the rootfs of the
container is assumed to be managed externally.
* `x-podman.no_hosts` - Run the container without creating /etc/hosts file
For example, the following docker-compose.yml allows running a podman container with externally managed rootfs.
```yml
version: "3"
services:
my_service:
command: ["/bin/busybox"]
x-podman.rootfs: "/path/to/rootfs"
```
For explanations of these extensions, please refer to the [Podman Documentation](https://docs.podman.io/).
## Secrets
The following extension keys are available under `secret` configuration:
x-podman.relabel - Configure SELinux relabeling
For example, the following configures custom-secret to use mount with private and unshared content.
Only the current container can use a private volume.
```yml
secrets:
custom-secret:
x-podman.relabel: Z
```
For explanations of these extensions, please refer to the [podman-run --volume documentation](https://docs.podman.io/en/latest/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options)).
## Network management
The following extension keys are available under network configuration:
* `x-podman.disable-dns` - Disable the DNS plugin for the network when set to 'true'.
* `x-podman.dns` - Set nameservers for the network using supplied addresses (cannot be used with x-podman.disable-dns`).
For example, the following docker-compose.yml allows all containers on the same network to use the
specified nameservers:
```yml
version: "3"
network:
my_network:
x-podman.dns:
- "10.1.2.3"
- "10.1.2.4"
```
For explanations of these extensions, please refer to the
[Podman network create command Documentation](https://docs.podman.io/en/latest/markdown/podman-network-create.1.html).
## Per-network MAC-addresses
Generic docker-compose files support specification of the MAC address on the container level. If the
container has multiple network interfaces, the specified MAC address is applied to the first
specified network.
Podman-compose in addition supports the specification of MAC addresses on a per-network basis. This
is done by adding a `x-podman.mac_address` key to the network configuration in the container. The
value of the `x-podman.mac_address` key is the MAC address to be used for the network interface.
Note that the [compose spec](https://github.com/compose-spec/compose-spec/blob/main/05-services.md#mac_address)
now supports `mac_address` on the network level, so we recommend using
the standard `mac_address` key for setting the MAC address. The
`x-podman.mac_address` is still supported for backwards compatibility.
Specifying a MAC address for the container and for individual networks at the same time is not
supported.
Example:
```yaml
---
version: "3"
networks:
net0:
driver: "bridge"
ipam:
config:
- subnet: "192.168.0.0/24"
net1:
driver: "bridge"
ipam:
config:
- subnet: "192.168.1.0/24"
services:
webserver:
image: "busybox"
command: ["/bin/busybox", "httpd", "-f", "-h", "/etc", "-p", "8001"]
networks:
net0:
ipv4_address: "192.168.0.10"
x-podman.mac_address: "02:aa:aa:aa:aa:aa"
net1:
ipv4_address: "192.168.1.10"
mac_address: "02:bb:bb:bb:bb:bb" # mac_address is supported
```
## Per-network interface name
Using `x-podman.interface_name` within a containers network config you can specify the interface name inside the container.
## Podman-specific network modes
Generic docker-compose supports the following values for `network-mode` for a container:
- `bridge`
- `host`
- `none`
- `service`
- `container`
In addition, podman-compose supports the following podman-specific values for `network-mode`:
- `slirp4netns[:<options>,...]`
- `ns:<options>`
- `pasta[:<options>,...]`
- `private`
The options to the network modes are passed to the `--network` option of the `podman create` command
as-is.
## Docker Compose Compatibility
podman-compose aims to be compatible with docker-compose, but there are some differences in
behavior and features. The following sections describe how to enable compatibility with docker-compose
and how to handle some of the differences.
Compatibility settings can either be set explicitly as described below, or by setting the `docker_compose_compat` meta
settings to `true` under the global `x-podman` key:
```yaml
x-podman:
docker_compose_compat: true
```
This will enable all compatibility settings described below, and is equivalent to setting each of them to `true`.
This setting can also be changed by setting the `PODMAN_COMPOSE_DOCKER_COMPOSE_COMPAT` environment variable.
## Compatibility of name separators between docker-compose and podman-compose
Currently, podman-compose is using underscores (`_` character) as a separator in names of
containers, images, etc., while docker-compose has switched to hyphens (`-` character). This setting
allows to switch podman-compose to use hyphens as well.
To enable compatibility between docker-compose and podman-compose, specify
`name_separator_compat: true` under global `x-podman` key:
```
x-podman:
name_separator_compat: true
```
By default `name_separator_compat` is `false`. This will change to `true` at some point and the
setting will be removed.
This setting can also be changed by setting `PODMAN_COMPOSE_NAME_SEPARATOR_COMPAT` environment
variable.
## Compatibility of default network names between docker-compose and podman-compose
Current versions of podman-compose may produce different default external network names than
docker-compose under certain conditions. Specifically, docker-compose removes dashes (`-` character)
from project name.
To enable compatibility between docker-compose and podman-compose, specify
`default_net_name_compat: true` under global `x-podman` key:
```
x-podman:
default_net_name_compat: true
```
By default `default_net_name_compat` is `false`. This will change to `true` at some point and the
setting will be removed.
This setting can also be changed by setting `PODMAN_COMPOSE_DEFAULT_NET_NAME_COMPAT` environment
variable.
## Compatibility of default network behavior between docker-compose and podman-compose
When there is no network defined (neither network-mode nor networks) in service,
The behavior of default network in docker-compose and podman-compose are different.
| Top-level networks | podman-compose | docker-compose |
| ------------------------------ | -------------------------- | -------------- |
| No networks | default | default |
| One network named net0 | net0 | default |
| Two networks named net0, net1 | podman(`--network=bridge`) | default |
| Contains network named default | default | default |
To enable compatibility between docker-compose and podman-compose, specify
`default_net_behavior_compat: true` under global `x-podman` key:
```yaml
x-podman:
default_net_behavior_compat: true
```
This setting can also be changed by setting `PODMAN_COMPOSE_DEFAULT_NET_BEHAVIOR_COMPAT` environment
variable.
## Custom pods management
Podman-compose can have containers in pods. This can be controlled by extension key x-podman in_pod.
It allows providing custom value for --in-pod and is especially relevant when --userns has to be set.
For example, the following docker-compose.yml allows using userns_mode by overriding the default
value of --in-pod (unless it was specifically provided by "--in-pod=True" in command line interface).
```yml
version: "3"
services:
cont:
image: nopush/podman-compose-test
userns_mode: keep-id:uid=1000
command: ["dumb-init", "/bin/busybox", "httpd", "-f", "-p", "8080"]
x-podman:
in_pod: false
```
This setting can also be changed by setting `PODMAN_COMPOSE_IN_POD` environment
variable.
It is also possible to override the default arguments for pod creation that are
used when --pod-args is not passed on the command line:
```yml
version: "3"
services:
cont:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "httpd", "-f", "-p", "8080"]
x-podman:
pod_args: ["--infra=false", "--share=", "--cpus=1"]
```
When not set in docker-compose.yml or on the command line, the pod args default
to `["--infra=false", "--share="]`.
This setting can also be changed by setting `PODMAN_COMPOSE_POD_ARGS` environment
variable.

View File

@ -1,7 +1,7 @@
---
- name: Manage AWX Container Images
block:
- name: Export Docker awx image if it isnt local and there isnt a registry defined
- name: Export Docker awx image if it isn't local and there isn't a registry defined
docker_image:
name: "{{ awx_image }}"
tag: "{{ awx_version }}"

View File

@ -0,0 +1,17 @@
# Azure Vote Example
This example have two containers:
* backend: `redis` used as storage
* frontend: having supervisord, nginx, uwsgi/python
```
echo "HOST_PORT=8080" > .env
podman-compose up
```
after typing the commands above open your browser on the host port you picked above like
[http://localhost:8080/](http://localhost:8080/)

View File

@ -0,0 +1,16 @@
---
# from https://github.com/Azure-Samples/azure-voting-app-redis/blob/master/docker-compose.yaml
version: '3'
services:
azure-vote-back:
image: mcr.microsoft.com/oss/bitnami/redis:6.0.8
container_name: azure-vote-back
environment:
ALLOW_EMPTY_PASSWORD: "yes"
azure-vote-front:
image: mcr.microsoft.com/azuredocs/azure-vote-front:v1
environment:
REDIS: azure-vote-back
ports:
- "${HOST_PORT:-8080}:80"

View File

@ -0,0 +1,9 @@
---
version: '3'
services:
dummy:
build:
context: .
dockerfile_inline: |
FROM alpine
RUN echo "hello world"

31
examples/echo/README.md Normal file
View File

@ -0,0 +1,31 @@
# Echo Service example
```
podman-compose up
```
Test the service with `curl like this`
```
$ curl -X POST -d "foobar" http://localhost:8080/; echo
CLIENT VALUES:
client_address=10.89.31.2
command=POST
real path=/
query=nil
request_version=1.1
request_uri=http://localhost:8080/
SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001
HEADERS RECEIVED:
accept=*/*
content-length=6
content-type=application/x-www-form-urlencoded
host=localhost:8080
user-agent=curl/7.76.1
BODY:
foobar
```

View File

@ -0,0 +1,8 @@
---
version: '3'
services:
web:
image: k8s.gcr.io/echoserver:1.4
ports:
- "${HOST_PORT:-8080}:8080"

View File

@ -0,0 +1,12 @@
# GCR Hello App Redis
A 6-node redis cluster using [Bitnami](https://github.com/bitnami/bitnami-docker-redis-cluster)
with a [simple hit counter](https://github.com/GoogleCloudPlatform/kubernetes-engine-samples/tree/main/hello-app-redis) that persists on that redis cluster
```
podman-compose up
```
then open your browser on [http://localhost:8080/](http://localhost:8080/)

View File

@ -0,0 +1,67 @@
---
version: '3'
volumes:
redis-node1-data:
redis-node2-data:
redis-node3-data:
redis-node4-data:
redis-node5-data:
redis-data:
services:
web:
image: gcr.io/google-samples/hello-app-redis:1.0
depends_on:
- redis-cluster
ports:
- "${HOST_PORT:-8080}:8080"
redis-node1:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-node1-data:/bitnami/redis/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
redis-node2:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-node2-data:/bitnami/redis/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
redis-node3:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-node3-data:/bitnami/redis/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
redis-node4:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-node4-data:/bitnami/redis/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
redis-node5:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-node5-data:/bitnami/redis/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
redis-cluster:
image: docker.io/bitnami/redis-cluster:6.2
volumes:
- redis-data:/bitnami/redis/data
depends_on:
- redis-node1
- redis-node2
- redis-node3
- redis-node4
- redis-node5
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node1 redis-node2 redis-node3 redis-node4 redis-node5 redis-cluster
- REDIS_CLUSTER_CREATOR=yes

View File

@ -0,0 +1,10 @@
# GCR Hello App
A small ~2MB image, type
```
podman-compose up
```
then open your browser on [http://localhost:8080/](http://localhost:8080/)

View File

@ -0,0 +1,8 @@
---
version: '3'
services:
web:
image: gcr.io/google-samples/hello-app:1.0
ports:
- "${HOST_PORT:-8080}:8080"

View File

@ -0,0 +1,12 @@
FROM python:3.9-alpine
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "-m", "app.web" ]
EXPOSE 8080

View File

@ -0,0 +1,8 @@
# Simple Python Demo
## A Redis counter
```
podman-compose up -d
curl localhost:8080/
curl localhost:8080/hello.json
```

View File

@ -0,0 +1,39 @@
# pylint: disable=import-error
# pylint: disable=unused-import
import asyncio # noqa: F401
import os
import aioredis # type: ignore[import-not-found]
from aiohttp import web # type: ignore[import-not-found]
REDIS_HOST = os.environ.get("REDIS_HOST", "localhost")
REDIS_PORT = int(os.environ.get("REDIS_PORT", "6379"))
REDIS_DB = int(os.environ.get("REDIS_DB", "0"))
redis = aioredis.from_url(f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}")
app = web.Application()
routes = web.RouteTableDef()
@routes.get("/")
async def hello(request: web.Request) -> web.Response: # pylint: disable=unused-argument
counter = await redis.incr("mycounter")
return web.Response(text=f"counter={counter}")
@routes.get("/hello.json")
async def hello_json(request: web.Request) -> web.Response: # pylint: disable=unused-argument
counter = await redis.incr("mycounter")
data = {"counter": counter}
return web.json_response(data)
app.add_routes(routes)
def main() -> None:
web.run_app(app, port=8080)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,21 @@
---
version: '3'
volumes:
redis:
services:
redis:
read_only: true
image: docker.io/redis:alpine
command: ["redis-server", "--appendonly", "yes", "--notify-keyspace-events", "Ex"]
volumes:
- redis:/data
web:
read_only: true
build:
context: .
image: hello-py-aioweb
ports:
- 8080:8080
environment:
REDIS_HOST: redis

View File

@ -0,0 +1,3 @@
aiohttp
aioredis
# aioredis[hiredis]

View File

@ -0,0 +1,71 @@
{
"env": {
"node": true,
"es6": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".mjs", ".ts", ".cjs"]
}
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"allowImportExportEverywhere": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:promise/recommended",
"google",
"plugin:security/recommended"
],
"plugins": ["promise", "security", "import"],
"overrides": [
{
"files": "public/**/*.min.js",
"env": {
"browser": true,
"node": false,
"es6": false
},
"parserOptions": {
"sourceType": "script"
},
"extends": ["plugin:compat/recommended"],
"plugins": [],
"rules": {
"no-var": ["off"]
}
}
],
"rules": {
"security/detect-non-literal-fs-filename":["off"],
"security/detect-object-injection":["off"],
"camelcase": ["off"],
"no-console": ["off"],
"require-jsdoc": ["off"],
"one-var": ["off"],
"guard-for-in": ["off"],
"max-len": [
"warn",
{
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"code": 200
}
],
"indent": ["warn", 4],
"no-unused-vars": ["warn"],
"no-extra-semi": ["warn"],
"linebreak-style": ["error", "unix"],
"quotes": ["warn", "double"],
"semi": ["error", "always"]
}
}

5
examples/nodeproj/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
local.env
.env
*.pid
node_modules

1
examples/nodeproj/.home/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*

View File

@ -0,0 +1,16 @@
# How to run example
```
cp example.local.env local.env
cp example.env .env
cat local.env
cat .env
echo "UID=$UID" >> .env
cat .env
podman-compose build
podman-compose run --rm --no-deps init
podman-compose up
```

View File

@ -0,0 +1,12 @@
FROM registry.fedoraproject.org/fedora-minimal:35
ARG NODE_VER=16
# microdnf -y module enable nodejs:${NODE_VER}
RUN \
echo -e "[nodejs]\nname=nodejs\nstream=${NODE_VER}\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \
microdnf -y install shadow-utils nodejs zopfli findutils busybox && \
microdnf clean all
RUN adduser -d /app app && mkdir -p /app/code/.home && chown app:app -R /app/code && chmod 711 /app /app/code/.home && usermod -d /app/code/.home app
ENV XDG_CONFIG_HOME=/app/code/.home
ENV HOME=/app/code/.home
WORKDIR /app/code

View File

@ -0,0 +1,48 @@
version: '3'
volumes:
redis:
services:
redis:
read_only: true
image: docker.io/redis:alpine
command: ["redis-server", "--appendonly", "yes", "--notify-keyspace-events", "Ex"]
volumes:
- redis:/data
tmpfs:
- /tmp
- /var/run
- /run
init:
read_only: true
#userns_mode: keep-id
user: ${UID:-1000}
build:
context: ./containers/${NODE_IMG:-node16-runtime}
image: ${NODE_IMG:-node16-runtime}
env_file:
- local.env
volumes:
- .:/app/code
command: ["/bin/sh", "-c", "mkdir -p ~/; [ -d ./node_modules ] && echo '** node_modules exists' || npm install"]
tmpfs:
- /tmp
- /run
task:
extends:
service: init
command: ["npm", "run", "cli", "--", "task"]
links:
- redis
depends_on:
- redis
web:
extends:
service: init
command: ["npm", "run", "cli", "--", "web"]
ports:
- ${WEB_LISTEN_PORT:-3000}:3000
depends_on:
- redis
links:
- mongo

View File

@ -0,0 +1,3 @@
WEB_LISTEN_PORT=3000
# pass UID= your IDE user

View File

@ -0,0 +1,2 @@
REDIS_HOST=redis

View File

@ -0,0 +1,6 @@
#! /usr/bin/env node
"use strict";
import {start} from "./lib";
start();

View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2020",
"module": "es2020",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"files": [
"index.js"
],
"include": [
"lib/**/*.js"
]
}

View File

@ -0,0 +1,31 @@
"use strict";
import {proj} from "../proj";
async function loop() {
const poped = await proj.predis.blpop("queue", 5);
const task_desc_s = poped[1];
let task_desc;
try {
task_desc = JSON.parse(task_desc_s);
} catch (e) {
console.exception(e);
}
console.info("got task "+task_desc.func);
const func = task_desc.func;
const args = task_desc.args;
if (typeof(proj.tasks[func])!="function") {
console.log(`task ${func} not found`);
process.exit(-1)
}
try {
await ((this.tasks[func])(...args));
} catch (e) {
console.exception(e);
}
}
export async function start() {
while(true) {
loop();
}
}

View File

@ -0,0 +1,21 @@
"use strict";
import {proj} from "../proj";
import http from "http";
import express from "express";
export async function start() {
const app = express();
const server = http.createServer(app);
// Routing
app.use(express.static(proj.config.basedir + "/public"));
app.get("/healthz", function(req, res) {
res.send("ok@"+Date.now());
});
server.listen(proj.config.LISTEN_PORT, proj.config.LISTEN_HOST, function() {
console.warn(`listening at port ${proj.config.LISTEN_PORT}`);
});
}

View File

@ -0,0 +1,24 @@
{
"name": "nodeproj",
"version": "0.0.1",
"description": "nodejs example project",
"exports": {
".": "./index.js",
"./lib": "./lib"
},
"main": "index.js",
"type": "module",
"scripts": {
"cli": "nodemon -w lib -w index.js --es-module-specifier-resolution=node ./index.js"
},
"dependencies": {
"express": "~4.16.4",
"redis": "^3.1.2"
},
"private": true,
"author": "",
"license": "proprietary",
"devDependencies": {
"nodemon": "^2.0.14"
}
}

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Vote</title>
<link rel="stylesheet" href="https://unpkg.com/browse/normalize.css@8.0.1/normalize.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
<script type="text/javascript" src="main.css"></script>
<script type="text/javascript">
//<![CDATA[
console.log("loaded");
//]]>
</script>
</html>

View File

@ -0,0 +1,11 @@
services:
test:
image: nvidia/cuda:12.3.1-base-ubuntu20.04
command: nvidia-smi
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]

View File

@ -0,0 +1,24 @@
---
volumes:
db_data:
services:
wordpress:
image: docker.io/library/wordpress:latest
ports:
- 8080:80
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=password
- WORDPRESS_DB_NAME=wordpress
db:
image: docker.io/library/mariadb:10.6.4-focal
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=password

13
newsfragments/README.txt Normal file
View File

@ -0,0 +1,13 @@
This is the directory for news fragments used by towncrier: https://github.com/hawkowl/towncrier
You create a news fragment in this directory when you make a change, and the file gets removed from
this directory when the news is published.
towncrier has a few standard types of news fragments, signified by the file extension. These are:
.feature: Signifying a new feature.
.bugfix: Signifying a bug fix.
.doc: Signifying a documentation improvement.
.removal: Signifying a deprecation or removal of public API.
.change: Signifying a change of behavior
.misc: Miscellaneous change

View File

@ -0,0 +1 @@
- Add unregister command to remove systemd service registration (`podman-compose systemd -a unregister`)

View File

@ -0,0 +1 @@
- Change behaviour of `--in-pod` to handle custom pod names instead of only disabling pod feature

View File

@ -0,0 +1 @@
- Add new docker_compose_compat x-podman meta setting to enable all Docker Compose compatibility settings

View File

@ -0,0 +1 @@
Fixed build ssh path to a local SSH key, to be relative to the directory of compose file.

View File

@ -0,0 +1 @@
Fixed support for CMD healthchecks to run using the given command directly and not using `/bin/sh -c`.

View File

@ -0,0 +1 @@
Fixed regression of dockerfile definition if working directory name ends with ".git".

View File

@ -0,0 +1 @@
Added `io.podman.compose.service` label to created containers. It contains the same value as com.docker.compose.service.

View File

@ -0,0 +1 @@
- Add new name_separator_compat x-podman setting to change name separator to hyphen, same as Docker Compose

View File

@ -0,0 +1 @@
- Add relabel option to secret to make possible to read the secret file by the contained process.

View File

@ -0,0 +1 @@
- Add support for setting x-podman values using PODMAN_COMPOSE_* environment variables.

File diff suppressed because it is too large Load Diff

73
pyproject.toml Normal file
View File

@ -0,0 +1,73 @@
[tool.ruff]
line-length = 100
target-version = "py38"
[tool.ruff.lint]
select = ["W", "E", "F", "I"]
ignore = [
]
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.format]
preview = true # needed for quote-style
quote-style = "preserve"
[tool.towncrier]
package = "podman_compose"
package_dir = "master"
directory = "newsfragments"
filename = "docs/Changelog-new.md"
template = "scripts/Changelog-template.jinja"
title_format = "Version {version} ({project_date})"
[[tool.towncrier.section]]
path = ""
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Removals"
showcontent = true
[[tool.towncrier.type]]
directory = "misc"
name = "Misc"
showcontent = true
[tool.mypy]
python_version = "3.9"
namespace_packages = true
explicit_package_bases = true
pretty = true
warn_redundant_casts = true
disallow_untyped_calls = false
disallow_untyped_defs = true
no_implicit_optional = true
mypy_path = "$MYPY_CONFIG_FILE_DIR"
exclude = "build"
[[tool.mypy.overrides]]
module = [
"parameterized.*",
]
ignore_missing_imports = true

View File

@ -0,0 +1,33 @@
{% for section, _ in sections|dictsort(by='key') %}
{% set underline = "-" %}
{% if section %}
{{section}}
{{ underline * section|length }}{% set underline = "~" %}
{% endif %}
{% if sections[section] %}
{% for category, val in definitions|dictsort if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}
{% for text, values in sections[section][category]|dictsort(by='value') %}
- {{ text }}
{% endfor %}
{% if sections[section][category]|length == 0 %}
No significant changes.
{% else %}
{% endif %}
{% endfor %}
{% else %}
No significant changes.
{% endif %}
{% endfor %}
(venv) p12@exec-desktop:~/cod

View File

@ -0,0 +1,16 @@
#!/bin/sh
# Delete repository dir
rm -rf podman-compose-src
# Clone repository
git clone https://github.com/containers/podman-compose podman-compose-src
# Generate binary
sh podman-compose-src/scripts/generate_binary_using_dockerfile.sh
# Move binary outside repo's dir
mv podman-compose-src/podman-compose .
# Delete repository dir
rm -rf podman-compose-src

View File

@ -0,0 +1,57 @@
#!/bin/sh
# Find an available container tool (docker or podman)
find_container_tool() {
if command -v docker > /dev/null 2>&1; then
echo "sudo docker"
elif command -v podman > /dev/null 2>&1; then
echo "podman"
else
echo "Error: Neither docker nor podman is available." >&2
exit 1
fi
}
# Determine which container tool to use
CONTAINER_TOOL=$(find_container_tool)
# Locate the directory containing dockerfile (root)
PROJECT_ROOT_DIR="$(cd "$(dirname "$0")" && pwd)/.."
# Check SELinux status and set appropriate mount option
check_selinux() {
if command -v getenforce > /dev/null 2>&1; then
SELINUX_STATUS=$(getenforce)
if [ "$SELINUX_STATUS" = "Enforcing" ] || [ "$SELINUX_STATUS" = "Permissive" ]; then
echo ":z"
else
echo ""
fi
elif [ -f /sys/fs/selinux/enforce ]; then
if [ "$(cat /sys/fs/selinux/enforce)" = "1" ]; then
echo ":z"
else
echo ""
fi
else
echo ""
fi
}
# Get the SELinux option for volume mounts if SELinux is enforcing or permissive
SELINUX=$(check_selinux)
# Build binary
$CONTAINER_TOOL image rm build-podman-compose
if expr "$CONTAINER_TOOL" : '.*docker.*' >/dev/null; then
$CONTAINER_TOOL build -t build-podman-compose "$PROJECT_ROOT_DIR"
$CONTAINER_TOOL run --name build-podman-compose build-podman-compose
$CONTAINER_TOOL cp build-podman-compose:/result/podman-compose "$PROJECT_ROOT_DIR/podman-compose"
$CONTAINER_TOOL container stop build-podman-compose
$CONTAINER_TOOL container rm -f build-podman-compose
else
$CONTAINER_TOOL build -v "$PROJECT_ROOT_DIR:/result$SELINUX" -t build-podman-compose "$PROJECT_ROOT_DIR"
fi
$CONTAINER_TOOL image rm python:3.11-slim
$CONTAINER_TOOL image rm build-podman-compose

View File

@ -1,6 +1,18 @@
#!/usr/bin/env bash
./scripts/uninstall.sh
./scripts/clean_up.sh
python3 setup.py register
python3 setup.py sdist bdist_wheel
twine upload dist/*
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: make_release.sh VERSION"
exit 1
fi
VERSION=$1
sed "s/__version__ = .*/__version__ = \"$VERSION\"/g" -i podman_compose.py
git add podman_compose.py
git commit -m "Release $VERSION"
git tag "v$VERSION" -m "v$VERSION" -s
git push ssh://github.com/containers/podman-compose main "v$VERSION"

14
scripts/make_release_notes.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: make_release_notes.sh VERSION"
exit 1
fi
VERSION=$1
towncrier build --version "$VERSION" --yes
git mv "docs/Changelog-new.md" "docs/Changelog-$VERSION.md"
git add "newsfragments/"
git commit -m "Release notes for $VERSION"

6
scripts/make_release_upload.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
./scripts/uninstall.sh
./scripts/clean_up.sh
python3 setup.py register
python3 setup.py sdist bdist_wheel
twine upload dist/*

View File

@ -3,3 +3,9 @@ universal = 1
[metadata]
version = attr: podman_compose.__version__
[flake8]
# The GitHub editor is 127 chars wide
max-line-length=127
# These are not being followed yet
ignore=E222,E231,E272,E713,W503

View File

@ -1,49 +1,49 @@
# SPDX-License-Identifier: GPL-2.0
import os
from setuptools import setup
try:
readme = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
except:
readme = ''
README = open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8").read()
except: # noqa: E722 # pylint: disable=bare-except
README = ""
setup(
name='podman-compose',
name="podman-compose",
description="A script to run docker-compose.yml using podman",
long_description=readme,
long_description_content_type='text/markdown',
long_description=README,
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
],
keywords='podman, podman-compose',
author='Muayyad Alsadi',
author_email='alsadi@gmail.com',
url='https://github.com/containers/podman-compose',
py_modules=['podman_compose'],
entry_points={
'console_scripts': [
'podman-compose = podman_compose:main'
]
},
keywords="podman, podman-compose",
author="Muayyad Alsadi",
author_email="alsadi@gmail.com",
url="https://github.com/containers/podman-compose",
py_modules=["podman_compose"],
entry_points={"console_scripts": ["podman-compose = podman_compose:main"]},
include_package_data=True,
license='GPL-2.0-only',
license="GPL-2.0-only",
install_requires=[
'pyyaml',
'python-dotenv',
"pyyaml",
"python-dotenv",
],
extras_require={"devel": ["ruff", "pre-commit", "coverage", "parameterized"]},
# test_suite='tests',
# tests_require=[
# 'coverage',
# 'pytest-cov',
# 'pytest',
# 'tox',
# ]
)

View File

@ -1,8 +1,41 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-e .
coverage==7.4.3
cryptography==44.0.3
parameterized==0.9.0
pytest==8.0.2
tox==4.13.0
mypy==1.15.0
ruff==0.11.11
pylint==3.1.0
types-PyYAML==6.0.12.20250402
types-requests==2.32.0.20250328
types-setuptools==80.7.0.20250516
coverage
pytest-cov
pytest
tox
# The packages below are transitive dependencies of the packages above and are included here
# to make testing reproducible.
# To refresh, create a new virtualenv and do:
# pip install -r requirements.txt -r test-requirements.txt
# pip freeze > test-requirements.txt
# and edit test-requirements.txt to add this comment
astroid==3.1.0
cachetools==5.3.3
chardet==5.2.0
colorama==0.4.6
dill==0.3.8
distlib==0.3.8
filelock==3.13.1
iniconfig==2.0.0
isort==5.13.2
mccabe==0.7.0
mypy_extensions==1.1.0
packaging==23.2
platformdirs==4.2.0
pluggy==1.4.0
pyproject-api==1.6.1
python-dotenv==1.0.1
PyYAML==6.0.1
requests
tomlkit==0.12.4
typing_extensions==4.13.2
virtualenv==20.26.6

View File

@ -1,25 +0,0 @@
# Test podman-compose with build
```
podman-compose build
podman-compose up -d
curl http://localhost:8080/index.txt
curl http://localhost:8000/index.txt
podman inspect my-busybox-httpd2
podman-compose down
```
expected output would be something like
```
2019-09-03T15:16:38+0000
ALT buildno=2 port 8000 2019-09-03T15:16:38+0000
{
...
}
```
as you can see we were able to override buildno to be 2 instead of 1,
and httpd_port to 8000.
NOTE: build labels are not passed to `podman build`

View File

@ -1,4 +0,0 @@
```
podman-compose run --rm sleep /bin/sh -c 'wget -O - http://localhost:8000/hosts'
```

View File

@ -1,24 +0,0 @@
version: "3.7"
services:
web:
image: busybox
command: ["/bin/busybox", "httpd", "-f", "-h", "/etc/", "-p", "8000"]
tmpfs:
- /run
- /tmp
sleep:
image: busybox
command: ["/bin/busybox", "sh", "-c", "sleep 3600"]
depends_on: "web"
tmpfs:
- /run
- /tmp
sleep2:
image: busybox
command: ["/bin/busybox", "sh", "-c", "sleep 3600"]
depends_on:
- sleep
tmpfs:
- /run
- /tmp

View File

@ -1,5 +0,0 @@
running the following command should give myval2
```
podman_compose run -l monkey -e ZZVAR1=myval2 env-test
```

View File

@ -1,9 +0,0 @@
version: '3'
services:
env-test:
image: busybox
command: sh -c "export | grep ZZ"
environment:
- ZZVAR1=myval1

View File

@ -1,15 +0,0 @@
We have service named sh1 that exits with code 1 and sh2 that exists with code 2
```
podman-compose up --exit-code-from=sh1
echo $?
```
the above should give 1.
```
podman-compose up --exit-code-from=sh2
echo $?
```
the above should give 2.

View File

@ -1,21 +0,0 @@
version: "3"
services:
too_long:
image: busybox
command: ["/bin/busybox", "sh", "-c", "sleep 3600; exit 0"]
tmpfs:
- /run
- /tmp
sh1:
image: busybox
command: ["/bin/busybox", "sh", "-c", "sleep 5; exit 1"]
tmpfs:
- /run
- /tmp
sh2:
image: busybox
command: ["/bin/busybox", "sh", "-c", "sleep 5; exit 2"]
tmpfs:
- /run
- /tmp

View File

@ -0,0 +1,12 @@
import os
import subprocess
def create_base_test_image() -> None:
subprocess.check_call(
['podman', 'build', '-t', 'nopush/podman-compose-test', '.'],
cwd=os.path.join(os.path.dirname(__file__), "base_image"),
)
create_base_test_image()

View File

@ -0,0 +1,11 @@
version: "3"
services:
sh1:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 1; exit 1"]
sh2:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 2; exit 0"]
sh3:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 3; exit 0"]

View File

@ -0,0 +1,11 @@
version: "3"
services:
sh1:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 1; exit 0"]
sh2:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 2; exit 0"]
sh3:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 3; exit 0"]

View File

@ -0,0 +1,11 @@
version: "3"
services:
sh1:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 1; exit 0"]
sh2:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 2; exit 1"]
sh3:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 3; exit 0"]

View File

@ -0,0 +1,11 @@
version: "3"
services:
sh1:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 1; exit 1"]
sh2:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 1; exit 0"]
sh3:
image: nopush/podman-compose-test
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 2; exit 0"]

View File

@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0
import os
import unittest
from parameterized import parameterized
from tests.integration.test_utils import RunSubprocessMixin
from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path(failure_order: str) -> str:
return os.path.join(test_path(), "abort", f"docker-compose-fail-{failure_order}.yaml")
class TestComposeAbort(unittest.TestCase, RunSubprocessMixin):
@parameterized.expand([
("exit", "first", 0),
("failure", "first", 1),
("exit", "second", 0),
("failure", "second", 1),
("exit", "simultaneous", 0),
("failure", "simultaneous", 1),
("exit", "none", 0),
("failure", "none", 0),
])
def test_abort(self, abort_type: str, failure_order: str, expected_exit_code: int) -> None:
try:
self.run_subprocess_assert_returncode(
[
podman_compose_path(),
"-f",
compose_yaml_path(failure_order),
"up",
f"--abort-on-container-{abort_type}",
],
expected_exit_code,
)
finally:
self.run_subprocess_assert_returncode([
podman_compose_path(),
"-f",
compose_yaml_path(failure_order),
"down",
])

View File

@ -0,0 +1,14 @@
# Test podman-compose with build.additional_contexts
```
podman-compose build
podman-compose up
podman-compose down
```
expected output would be
```
[dict] | Data for dict
[list] | Data for list
```

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
Data for dict

View File

@ -0,0 +1 @@
Data for list

View File

@ -0,0 +1,3 @@
FROM busybox
COPY --from=data data.txt /data/data.txt
CMD ["busybox", "cat", "/data/data.txt"]

View File

@ -0,0 +1,12 @@
version: "3.7"
services:
dict:
build:
context: .
additional_contexts:
data: ../data_for_dict
list:
build:
context: .
additional_contexts:
- data=../data_for_list

View File

@ -0,0 +1,44 @@
# SPDX-License-Identifier: GPL-2.0
"""Test how additional contexts are passed to podman."""
import os
import subprocess
import unittest
from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path() -> str:
""" "Returns the path to the compose file used for this test module"""
return os.path.join(test_path(), "additional_contexts", "project")
class TestComposeBuildAdditionalContexts(unittest.TestCase):
def test_build_additional_context(self) -> None:
"""podman build should receive additional contexts as --build-context
See additional_context/project/docker-compose.yaml for context paths
"""
cmd = (
"coverage",
"run",
podman_compose_path(),
"--dry-run",
"--verbose",
"-f",
os.path.join(compose_yaml_path(), "docker-compose.yml"),
"build",
)
p = subprocess.run(
cmd,
stdout=subprocess.PIPE,
check=False,
stderr=subprocess.STDOUT,
text=True,
)
self.assertEqual(p.returncode, 0)
self.assertIn("--build-context=data=../data_for_dict", p.stdout)
self.assertIn("--build-context=data=../data_for_list", p.stdout)

Some files were not shown because too many files have changed in this diff Show More