unknown flag: --format while deploying a stack and periphery volumes question related to .env files been written to docker volume by default #163

Closed
opened 2025-10-31 15:03:41 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @stamonty on GitHub (Dec 21, 2024).

First of all I would like to thank you for the great software!
I was able to to successfully migrate a couple of stacks from Portainer to Komodo exept Immich.

On compose build step I got unknown flag: --format:
immich error

Haven't seen config --format json while deploying other stacks.
I assume second --env-file was mistakenly added.

Also I've tried to reuse Komodo demo immich stack configuration. Got exactly the same error.
Peripheral agent is deployed as docker container.

BTW, environment written to "/etc/komodo/stacks/immich/.env"
No actual file was created. Is it expected behavior? Same goes for other stacks, though deployment went successful.

Docmost stack deployment for comparison
docmost

Just let me know if I could help to track the issue by providing any additional information needed.

Originally created by @stamonty on GitHub (Dec 21, 2024). First of all I would like to thank you for the great software! I was able to to successfully migrate a couple of stacks from Portainer to Komodo exept Immich. On compose build step I got `unknown flag: --format`: ![immich error](https://github.com/user-attachments/assets/d3a098e7-b91f-47c0-8042-802cf38d16e5) Haven't seen `config --format json` while deploying other stacks. I assume second `--env-file` was mistakenly added. Also I've tried to reuse Komodo demo immich stack configuration. Got exactly the same error. Peripheral agent is deployed as docker container. BTW, `environment written to "/etc/komodo/stacks/immich/.env"` No actual file was created. Is it expected behavior? Same goes for other stacks, though deployment went successful. Docmost stack deployment for comparison ![docmost](https://github.com/user-attachments/assets/e5b04640-8823-41e0-b2ea-0a4cd9f37f24) Just let me know if I could help to track the issue by providing any additional information needed.
GiteaMirror added the seen 👀 label 2025-10-31 15:03:41 -05:00
Author
Owner

@mbecker20 commented on GitHub (Dec 21, 2024):

It looks like and additional env file is not being passed. the command has:

--env-file .env --env-file config --format json.

Maybe you added an additional env file, but left it blank? If this isn't it, please share you resource TOML.

@mbecker20 commented on GitHub (Dec 21, 2024): It looks like and additional env file is not being passed. the command has: `--env-file .env --env-file config --format json`. Maybe you added an additional env file, but left it blank? If this isn't it, please share you resource TOML.
Author
Owner

@stamonty commented on GitHub (Dec 21, 2024):

Many thanks!

Maybe you added an additional env file, but left it blank

It is exactly what've happened!
Assume it would be better not to save an empty envs or at least ignore them while deploying.
Issue was so trivial but I was completely sure that an empty state wasn't saved that didn't bother to double checked.

@stamonty commented on GitHub (Dec 21, 2024): Many thanks! >Maybe you added an additional env file, but left it blank It is exactly what've happened! Assume it would be better not to save an empty envs or at least ignore them while deploying. Issue was so trivial but I was completely sure that an empty state wasn't saved that didn't bother to double checked.
Author
Owner

@stamonty commented on GitHub (Dec 21, 2024):

BTW, environment written to "/etc/komodo/stacks/immich/.env"
No actual .env file was created. Is it expected behavior? Same goes for other stacks, though deployment went successful and env vars have been passed to containers.

Also, if possible, could you please elaborate on that.

@stamonty commented on GitHub (Dec 21, 2024): > BTW, environment written to "/etc/komodo/stacks/immich/.env" No actual .env file was created. Is it expected behavior? Same goes for other stacks, though deployment went successful and env vars have been passed to containers. Also, if possible, could you please elaborate on that.
Author
Owner

@mbecker20 commented on GitHub (Dec 21, 2024):

Can you check ls -a and see if you see it? Its possible you just don't see it because usually paths starting with . are hidden.

@mbecker20 commented on GitHub (Dec 21, 2024): Can you check `ls -a` and see if you see it? Its possible you just don't see it because usually paths starting with `.` are hidden.
Author
Owner

@stamonty commented on GitHub (Dec 21, 2024):

Sure, here it goes:

/etc/komodo/stacks/immich$ ls -a
.  ..  library  postgres

No env for immich stack

:/etc/komodo/stacks$ ls -a
.  ..  immich

Same for Docmost (even directory was not created)
Docker engine runs with root privileges (https://docs.docker.com/engine/install/ubuntu/ - standard install)

@stamonty commented on GitHub (Dec 21, 2024): Sure, here it goes: ``` /etc/komodo/stacks/immich$ ls -a . .. library postgres ``` No env for immich stack ``` :/etc/komodo/stacks$ ls -a . .. immich ``` Same for Docmost (even directory was not created) Docker engine runs with root privileges (https://docs.docker.com/engine/install/ubuntu/ - standard install)
Author
Owner

@mbecker20 commented on GitHub (Dec 21, 2024):

Its strange to not see the compose file in there either. I am assuming you mount /etc/komodo/stacks:/etc/komodo/stacks to Periphery container? This should be correct.

Could you share:

  1. Your Periphery compose service / docker run command (how you launch Periphery)
  2. Your resource TOML (navigate to the stack and use the TOML button)
@mbecker20 commented on GitHub (Dec 21, 2024): Its strange to not see the compose file in there either. I am assuming you mount `/etc/komodo/stacks:/etc/komodo/stacks` to Periphery container? This should be correct. Could you share: 1. Your Periphery compose service / docker run command (how you launch Periphery) 2. Your resource TOML (navigate to the stack and use the TOML button)
Author
Owner

@stamonty commented on GitHub (Dec 21, 2024):

How Periphery agent starts:
docker compose -p komodo -f komodo.yaml --env-file komodo.env up -d

Both files are located outside /etc

komodo.yaml

services:
  periphery:
    container_name: komodo_agent
    image: ghcr.io/mbecker20/periphery:latest
    # image: ghcr.io/mbecker20/periphery:latest-aarch64 # use for arm support
    labels:
      komodo.skip: # Prevent Komodo from stopping with StopAllContainers
    restart: unless-stopped
    logging:
      driver: local
    ports:
      - 8120:8120
    volumes:
      ## Mount external docker socket
      - /var/run/docker.sock:/var/run/docker.sock
      ## Allow Periphery to see processes outside of container
      - /proc:/proc
      ## use self signed certs in docker volume,
      ## or mount your own signed certs.
      - ssl-certs:/etc/komodo/ssl
      ## manage repos in a docker volume,
      ## or change it to an accessible host directory.
      - repos:/etc/komodo/repos
      ## manage stack files in a docker volume,
      ## or change it to an accessible host directory.
      - stacks:/etc/komodo/stacks
      ## Optionally mount a path to store compose files
      # - /path/to/compose:/host/compose
    env_file: komodo.env
    environment:
      ## Full list: `https://github.com/mbecker20/komodo/blob/main/config/periphery.config.toml`
      ## Configure the same passkey given to Komodo Core (KOMODO_PASSKEY)
      PERIPHERY_PASSKEYS: ${PERIPHERY_PASSKEYS} # Alt: PERIPHERY_PASSKEYS_FILE
      ## Adding IP here will ensure calling IP is in the list. (optional)
      PERIPHERY_ALLOWED_IPS:
      ## Enable HTTPS server
      PERIPHERY_SSL_ENABLED: true
      ## If the disk size is overreporting, can use one of these to
      ## whitelist / blacklist the disks to filter them, whichever is easier.
      ## Accepts comma separated list of paths.
      ## Usually whitelisting /etc/hostname gives correct size.
      PERIPHERY_INCLUDE_DISK_MOUNTS: /etc/hostname
      # PERIPHERY_EXCLUDE_DISK_MOUNTS: /snap,/etc/repos

volumes:
  ssl-certs:
  repos:
  stacks:

komodo.env
PERIPHERY_PASSKEYS=

PERIPHERY CONTAINER LOG

2024-12-21T20:15:05.801590729Z 2024-12-21T20:15:05.801534Z  INFO periphery: Komodo Periphery version: v1.16.12
2024-12-21T20:15:05.802620299Z 2024-12-21T20:15:05.801629Z  INFO periphery: PeripheryConfig { port: 8120, repo_dir: "/etc/komodo/repos", stack_dir: "/etc/komodo/stacks", stats_polling_rate: FiveSeconds, legacy_compose_cli: false, logging: LogConfig { level: Info, stdio: Standard, otlp_endpoint: "", opentelemetry_service_name: "Komodo" }, allowed_ips: [], passkeys: ["##############"], include_disk_mounts: ["/etc/hostname"], exclude_disk_mounts: [], secrets: {}, git_providers: [], docker_registries: [], ssl_enabled: true, ssl_key_file: "/etc/komodo/ssl/key.pem", ssl_cert_file: "/etc/komodo/ssl/cert.pem" }
2024-12-21T20:15:05.809239737Z 2024-12-21T20:15:05.804176Z  INFO periphery: 🔒 Periphery SSL Enabled
@stamonty commented on GitHub (Dec 21, 2024): How Periphery agent starts: `docker compose -p komodo -f komodo.yaml --env-file komodo.env up -d` Both files are located outside /etc komodo.yaml ``` services: periphery: container_name: komodo_agent image: ghcr.io/mbecker20/periphery:latest # image: ghcr.io/mbecker20/periphery:latest-aarch64 # use for arm support labels: komodo.skip: # Prevent Komodo from stopping with StopAllContainers restart: unless-stopped logging: driver: local ports: - 8120:8120 volumes: ## Mount external docker socket - /var/run/docker.sock:/var/run/docker.sock ## Allow Periphery to see processes outside of container - /proc:/proc ## use self signed certs in docker volume, ## or mount your own signed certs. - ssl-certs:/etc/komodo/ssl ## manage repos in a docker volume, ## or change it to an accessible host directory. - repos:/etc/komodo/repos ## manage stack files in a docker volume, ## or change it to an accessible host directory. - stacks:/etc/komodo/stacks ## Optionally mount a path to store compose files # - /path/to/compose:/host/compose env_file: komodo.env environment: ## Full list: `https://github.com/mbecker20/komodo/blob/main/config/periphery.config.toml` ## Configure the same passkey given to Komodo Core (KOMODO_PASSKEY) PERIPHERY_PASSKEYS: ${PERIPHERY_PASSKEYS} # Alt: PERIPHERY_PASSKEYS_FILE ## Adding IP here will ensure calling IP is in the list. (optional) PERIPHERY_ALLOWED_IPS: ## Enable HTTPS server PERIPHERY_SSL_ENABLED: true ## If the disk size is overreporting, can use one of these to ## whitelist / blacklist the disks to filter them, whichever is easier. ## Accepts comma separated list of paths. ## Usually whitelisting /etc/hostname gives correct size. PERIPHERY_INCLUDE_DISK_MOUNTS: /etc/hostname # PERIPHERY_EXCLUDE_DISK_MOUNTS: /snap,/etc/repos volumes: ssl-certs: repos: stacks: ``` komodo.env `PERIPHERY_PASSKEYS=` PERIPHERY CONTAINER LOG ``` 2024-12-21T20:15:05.801590729Z 2024-12-21T20:15:05.801534Z INFO periphery: Komodo Periphery version: v1.16.12 2024-12-21T20:15:05.802620299Z 2024-12-21T20:15:05.801629Z INFO periphery: PeripheryConfig { port: 8120, repo_dir: "/etc/komodo/repos", stack_dir: "/etc/komodo/stacks", stats_polling_rate: FiveSeconds, legacy_compose_cli: false, logging: LogConfig { level: Info, stdio: Standard, otlp_endpoint: "", opentelemetry_service_name: "Komodo" }, allowed_ips: [], passkeys: ["##############"], include_disk_mounts: ["/etc/hostname"], exclude_disk_mounts: [], secrets: {}, git_providers: [], docker_registries: [], ssl_enabled: true, ssl_key_file: "/etc/komodo/ssl/key.pem", ssl_cert_file: "/etc/komodo/ssl/cert.pem" } 2024-12-21T20:15:05.809239737Z 2024-12-21T20:15:05.804176Z INFO periphery: 🔒 Periphery SSL Enabled ```
Author
Owner

@stamonty commented on GitHub (Dec 21, 2024):

Docmost stack:

[[stack]]
name = "docmost"
[stack.config]
server = "MyServer"
project_name = "docmost"
file_contents = """
services:
  docmost:
    container_name: docmost_app
    image: docmost/docmost:latest
    depends_on:
      - db
      - redis
    environment:
      APP_URL: ${APP_URL}
      APP_SECRET: ${APP_SECRET}
      DATABASE_URL: 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public'
      REDIS_URL: ${REDIS_URL}
    ports:
      - ${PORT}:${PORT}
    restart: unless-stopped
    volumes:
      - docmost:/app/data/storage

  db:
    container_name: docmost_db
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/postgresql/data

  redis:
    container_name: docmost_redis
    image: redis:7.2-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data

volumes:
  docmost:
  db_data:
  redis_data:
"""
environment = """
APP_URL=https://#######:3000
PORT=3000
APP_SECRET=[[DOCMOST_APP_SECRET]]
JWT_TOKEN_EXPIRES_IN=30d
POSTGRES_DB=[[DOCMOST_DB]]
POSTGRES_USER=[[DOCMOST_DB_USER]]
POSTGRES_PASSWORD=[[DOCMOST_DB_PASSWORD]]
REDIS_URL=redis://redis:6379
STORAGE_DRIVER=local
AWS_S3_ACCESS_KEY_ID=
AWS_S3_SECRET_ACCESS_KEY=
AWS_S3_REGION=
AWS_S3_BUCKET=
AWS_S3_ENDPOINT=
AWS_S3_FORCE_PATH_STYLE=
FILE_UPLOAD_SIZE_LIMIT=
MAIL_DRIVER=smtp
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME=Docmost
SMTP_HOST=127.0.0.1
SMTP_PORT=587
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_SECURE=false
SMTP_IGNORETLS=false
POSTMARK_TOKEN=
DRAWIO_URL=
"""
@stamonty commented on GitHub (Dec 21, 2024): Docmost stack: ``` [[stack]] name = "docmost" [stack.config] server = "MyServer" project_name = "docmost" file_contents = """ services: docmost: container_name: docmost_app image: docmost/docmost:latest depends_on: - db - redis environment: APP_URL: ${APP_URL} APP_SECRET: ${APP_SECRET} DATABASE_URL: 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public' REDIS_URL: ${REDIS_URL} ports: - ${PORT}:${PORT} restart: unless-stopped volumes: - docmost:/app/data/storage db: container_name: docmost_db image: postgres:16-alpine environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} restart: unless-stopped volumes: - db_data:/var/lib/postgresql/data redis: container_name: docmost_redis image: redis:7.2-alpine restart: unless-stopped volumes: - redis_data:/data volumes: docmost: db_data: redis_data: """ environment = """ APP_URL=https://#######:3000 PORT=3000 APP_SECRET=[[DOCMOST_APP_SECRET]] JWT_TOKEN_EXPIRES_IN=30d POSTGRES_DB=[[DOCMOST_DB]] POSTGRES_USER=[[DOCMOST_DB_USER]] POSTGRES_PASSWORD=[[DOCMOST_DB_PASSWORD]] REDIS_URL=redis://redis:6379 STORAGE_DRIVER=local AWS_S3_ACCESS_KEY_ID= AWS_S3_SECRET_ACCESS_KEY= AWS_S3_REGION= AWS_S3_BUCKET= AWS_S3_ENDPOINT= AWS_S3_FORCE_PATH_STYLE= FILE_UPLOAD_SIZE_LIMIT= MAIL_DRIVER=smtp MAIL_FROM_ADDRESS=hello@example.com MAIL_FROM_NAME=Docmost SMTP_HOST=127.0.0.1 SMTP_PORT=587 SMTP_USERNAME= SMTP_PASSWORD= SMTP_SECURE=false SMTP_IGNORETLS=false POSTMARK_TOKEN= DRAWIO_URL= """ ```
Author
Owner

@mbecker20 commented on GitHub (Dec 21, 2024):

Remember Periphery is running in docker container, with file system seperation. See this part on the Periphery service:

      ## manage stack files in a docker volume,
      ## or change it to an accessible host directory.
      - stacks:/etc/komodo/stacks

So you are actually putting the files in Docker volume. The compose / .env are being written in there.

If you want to face less complication from this, you can consider running Periphery in systemd, as I do: https://github.com/mbecker20/komodo/discussions/220

If you must run Periphery in container, and are willing to take on the additional complications, make sure to read this post: https://github.com/mbecker20/komodo/discussions/180

@mbecker20 commented on GitHub (Dec 21, 2024): Remember Periphery is running in docker container, with file system seperation. See this part on the Periphery service: ``` ## manage stack files in a docker volume, ## or change it to an accessible host directory. - stacks:/etc/komodo/stacks ``` So you are actually putting the files in Docker volume. The compose / .env are being written in there. If you want to face less complication from this, you can consider running Periphery in systemd, as I do: https://github.com/mbecker20/komodo/discussions/220 If you *must* run Periphery in container, and are willing to take on the additional complications, make sure to read this post: https://github.com/mbecker20/komodo/discussions/180
Author
Owner

@stamonty commented on GitHub (Dec 22, 2024):

So you are actually putting the files in Docker volume

Exactly! My mistake, I've misread the config. Thanks for the links provided, very useful. No more questions for now, closing the issue.

@stamonty commented on GitHub (Dec 22, 2024): >So you are actually putting the files in Docker volume Exactly! My mistake, I've misread the config. Thanks for the links provided, very useful. No more questions for now, closing the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#163