#2094·kompose

[BUG] kompose crashes on simple docker-compose.yml with name: top-level element

Author: godmarCreated Apr 3, 2026Updated Jul 2, 2026
Labelskind/buglifecycle/stale

Expected Behavior

I was testing kompose (installed via Ubuntu 24 snap); the program doesn't show any version information.

I'm using the example from the docker documentation:

$ cat docker-compose.yml 
name: myapp

services:
  foo:
    image: busybox
    command: echo "I'm running ${COMPOSE_PROJECT_NAME}"

which results in

$ kompose convert -f docker-compose.yml -o k8s
ERRO Could not parse config for project test : yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `myapp` into config.RawService 
FATA composeObject.Parse() failed, Failed to load compose file: yaml: unmarshal errors:
  line 1: cannot unmarshal !!str `myapp` into config.RawService 

Removing the name and the reference to COMPOSE_PROJECT_NAME results in:

ERRO Could not parse config for project test : Unsupported config option for services service: 'foo' 
FATA composeObject.Parse() failed, Failed to load compose file: Unsupported config option for services service: 'foo' 

Running the docker-compose through docker compose config also fails.

Actual Behavior

It should handle at least simple examples from the docker compose documentation correctly. ChatGPT recommended kompose, but so far it failed on all examples I tried.

Steps To Reproduce

No response

Kompose Version

1.21.0 (992df58d8)

Docker-Compose file

yaml
name: myapp

services:
  foo:
    image: busybox
    command: echo "I'm running ${COMPOSE_PROJECT_NAME}"

Anything else?