I have a docker-compose.yml file, which is version 2.3. (I had to change to 2 during first try with kompose). I tried to convert this yaml file into k8s yaml files with this cmd:
kompose convert -f docker-compose.yml -v
It failed with the error:
ERRO Could not parse config for project xxx : Cannot unmarshal '<nil>' to type <nil> into a string value
FATA composeObject.Parse() failed, Failed to load compose file: Cannot unmarshal '<nil>' to type <nil> into a string value
It's apparent that the errors are related to some missing-value fields in the docker-compose.yml file: e.g.,
build:
context: .
args:
http_proxy:
https_proxy:
no_proxy:
socks_proxy:
TF_ANNOTATION: "no"
I searched online and found a related github issue, which seems to have been fixed Issue388. (But no). So I'm wondering how to handle the key-only fields during conversion.
My kompose is shipped with the docker desktop on Mac. Kompose version: 1.19.0 Docker:
Changing the version from 2 to 3 in docker-compose.yml works for the conversion.