Docker environment variables

hosted
(Kaj Noppen) #1

Hi,

When playing around with docker deploy, I find that passing environment variables works a little different then expected.

When creating ‘Project Variables’ these are not injected in to the containers environment variables. It seems these are only injected when using ‘Explicit Variable Mapping’ in the Docker deploy step. This is not a bit issue as such, but I am unable to select ‘Project variables’ from the drop down in the ‘Explicit Variable mapping’, which seems I will need to insert all the variables in every deploy step.

Am I missing something to get this working correctly?

Thanks!

(Matt Richardson) #3

Hi @Kaj_Noppen, thanks for getting in touch!

You are correct - we do not automatically map all project variables to environment variables - It is designed so you need to be explicit about which variables you want to pass. Also, the characters you can use in an Octopus variable name differ from the characters that you can use in an environment variable name.

It appears you’ve uncovered a bug though - the drop down should definitely be showing project variables. I’ve logged an issue to get this resolved.

In the meantime, you can still refer to the variable - just use the syntax #{variablename} and you’ll be fine.

Hope that helps!

Regards,
Matt

(Kaj Noppen) #4

Hi Matt,

I just tried this and it does indeed word. It was just confusing as a new user :wink: .

Thanks!
-Kaj

(Matt Richardson) #5

Thanks for letting me know, Kaj. Hopefully we’ll get that bug fixed soon to make it easier for everyone.

Regards,
Matt