Docker Environment Variables passed to Container and using inside a *.conf file


Recommended Posts

Passing my variable like this:

bce135bea0bd4e3d9a64fd6016a7e8da.png

 

The variable is passed fine:

[root@939b57ae6d42 config]# echo ${DRIVER}
lis

 

Inside a *conf file:

# The following drivers are supported:
#   bayrad, CFontz, CFontzPacket, curses, CwLnx, ea65, EyeboxOne, g15, glcd,
#   glcdlib, glk, hd44780, icp_a106, imon, imonlcd,, IOWarrior, irman, joy,
#   lb216, lcdm001, lcterm, lirc, lis, MD8800,, mdm166a, ms6931, mtc_s16209x,
#   MtxOrb, mx5000, NoritakeVFD, picolcd,, pyramid, rawserial, sdeclcd,
#   sed1330, sed1520, serialPOS, serialVFD, shuttleVFD, sli,, stv5730, svga,
#   t6963, text, tyan, ula200, vlsys_m428, xosd
Driver=${DRIVER}

 

 

Instead of it being the variable I am getting ${DRIVER}

[root@939b57ae6d42 config]# /usr/bin/LCDd -c /config/LCDd.conf
Could not open driver module /usr/lib/lcdproc/${DRIVER}.so: /usr/lib/lcdproc/${DRIVER}.so: cannot open shared object file: No such file or directory
Driver [${DRIVER}] binding failed
Could not load driver ${DRIVER}
There is no output driver
Critical error while initializing, abort.

 

It has to be something really simple I am missing in the formatting.

Link to comment

Variables in a conf file are not normally processed in Linux, this is not a docker issue.

You could have the conf file edited with the current value of the variable during startup using sed if you really want to be able to set things up this way.

Link to comment

Variables in a conf file are not normally processed in Linux, this is not a docker issue.

You could have the conf file edited with the current value of the variable during startup using sed if you really want to be able to set things up this way.

Thanks I figured it was something like that.

 

 

 

Sent from my XT1563 using Tapatalk

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.