Hey everyone! I have a bit of a silly question about setting environment variables. I know that you can use either mapping syntax or list syntax to do this. For example, setting an environment variable like this:
environment:
ORIGIN: 'https://whatever.org'
is equivalent to this:
environment:
- ORIGIN = https://whatever.org
But I'm curious, is this true for most instances? Specifically, can I use both syntaxes for PUID and GUID? I've only ever used the list syntax, and I'd really prefer to stick with just one style.
2 Answers
You can check the official Docker documentation for environment variables. But just to answer your question directly, both mapping and list syntax work for setting environment variables like PUID and GUID. Just be cautious with how you format them!
To clarify, one syntax is more like a dictionary format (the first one you mentioned) while the other is an array style (list). You can represent items with a dash for the list, and the dictionary format uses key: value pairs. This means you can have keys pointing to values that could eventually lead to other mappings too. As for PUID and GUID, yes, you can definitely use both syntaxes for them!
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String