containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
318 stars 10 forks source link

Supports file merging docker compose files #59

Open bsv9 opened 5 months ago

bsv9 commented 5 months ago

Hi,

It would be nice to add functionality to merge docker compose files. https://docs.docker.com/compose/multiple-compose-files/merge/

Steps to reproduce

Create docker-compose.yaml

version: '3.4'
services:
  redis:
    image: docker.io/redis:7-alpine
    command:
    - sh
    - -c # this is to evaluate the $REDIS_PASSWORD from the env
    - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
    env_file: env/redis.env

Create docker-compose.override.yaml

version: '3.4'
services:
  redis:
    restart: always

Expected behavior

# redis.container
[Container]
EnvironmentFile=env/redis.env
Exec=sh -c 'redis-server --appendonly yes --requirepass $$REDIS_PASSWORD'
Image=docker.io/redis:7-alpine

[Service]
Restart=always
k9withabone commented 4 months ago

Blocked on #63 and k9withabone/compose_spec_rs#4.