From f505e499a28bd7be65fac853ef2197954cb92c5b Mon Sep 17 00:00:00 2001 From: Muayyad Alsadi Date: Mon, 9 Sep 2019 00:48:25 +0300 Subject: [PATCH] a test showing yaml anchor magic --- podman_compose.py | 2 ++ tests/yamlmagic/docker-compose.yml | 34 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/yamlmagic/docker-compose.yml diff --git a/podman_compose.py b/podman_compose.py index c44f43a..394c317 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -386,6 +386,8 @@ def mount_desc_to_args(compose, mount_desc, srv_name, cnt_name): proj_name = compose.project_name shared_vols = compose.shared_vols if is_str(mount_desc): mount_desc=parse_short_mount(mount_desc, basedir) + # not needed + # podman support: podman run --rm -ti --mount type=volume,source=myvol,destination=/delme busybox mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, proj_name, srv_name)) mount_type = mount_desc.get("type") source = mount_desc.get("source") diff --git a/tests/yamlmagic/docker-compose.yml b/tests/yamlmagic/docker-compose.yml new file mode 100644 index 0000000..50eaa94 --- /dev/null +++ b/tests/yamlmagic/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3.6' + +x-deploy-base: &deploy-base + restart_policy: + delay: 2s + +x-common: &common + network: host + deploy: + <<: *deploy-base + networks: + hostnet: {} + +networks: + hostnet: + external: true + name: host + +volumes: + node-red_data: + +services: + node-red: + <<: *common + image: busybox + command: busybox httpd -h /data -f -p 8080 + deploy: + <<: *deploy-base + resources: + limits: + cpus: '0.5' + memory: 32M + volumes: + - node-red_data:/data