Mephi00 / v-rising-wine-docker-image

MIT License
53 stars 32 forks source link

Correct YAML quotation usage causes problems #17

Open vorpalhex opened 2 years ago

vorpalhex commented 2 years ago

It looks like use of quotes in the docker env variables - while allowable normally - is causing problems.

Eg:

 environment:
      - TZ=America/Chicago
      - V_RISING_NAME="SomeServer"
      - V_RISING_SAVE_NAME="SomeSave"

Will cause the game itself to throw a JSON parsing error. I'm guessing the startup scripts aren't correcting taking out the quotes.

Mephi00 commented 2 years ago

I will look into adding that to the entrypoint script. The tools I used don't support quotes in environment variables.

xEtarusx commented 2 years ago

@vorpalhex Maybe try one of two alternatives:

environment:
  - ENV1=abc
  - "ENV2=abc"
vorpalhex commented 2 years ago

@xEtarusx The official docker documentation disagrees:

https://docs.docker.com/compose/environment-variables/

https://docs.docker.com/compose/compose-file/compose-file-v3/#environment

A key may be single quoted or double quoted, a value may be single quoted or double quoted, or the entire line may be single quoted or double quoted.

xEtarusx commented 2 years ago

@vorpalhex I don't see any quoted environment values on the pages you linked. I think you can use double/single quoted values without the dash and with a colon instead of a equal-sign.

I might have missed that third option in my previous answer:

environment:
  - ENV1=abc
  - "ENV2=abc"
  ENV3: "test"
vorpalhex commented 2 years ago

@xEtarusx You can test this in 30 seconds for yourself. This is standard POSIX env behavior. Remember than an env string is a key/value string, and both the key and the value can have variables (or be told to not go through shell interpolation).

I have literally used this notation since Docker Compose was alpha.

Annoyingly docker-compose did break this behavior for a few versions in .env files but later corrected it.