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
322 stars 10 forks source link

unknown attribute "cap_drop", extensions must start with 'x-' #34

Closed hakong closed 6 months ago

hakong commented 6 months ago

Example snippet from docker-compose file:

services:
  xyz:
    image: docker.io/xyz/xyz:latest
    restart: always
    environment:
      - DATABASE_USER=xyz
      - DATABASE_PASS=xxxx #insert your secure database password!
      - DATABASE_NAME=xyz
      - DATABASE_HOST=database
    ports:
      - 4000:4000
    volumes:
      - ./import:/opt/app/import
    cap_drop:
      - all

Result:

[xyz@container-1 ~]$ podlet -i compose docker-compose.yml
Error:
   0: File `docker-compose.yml` is not a valid compose file
   1: services.xyz: unknown attribute "cap_drop", extensions must start with 'x-' (see https://docs.docker.com/compose/compose-file/#extension) at line 5 column 5

Location:
   src/cli/compose.rs:63

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html says

[Container] options DropCapability=CAP

podman run equivalent --cap-drop=CAP

k9withabone commented 6 months ago

Thanks for submitting an issue! This has actually already been fixed in the podman-v4.6.0 branch with commit fbb2c0ce43369661a141cdca658a0fbcd567c966, which will be released soon.