79450572

Date: 2025-02-19 07:48:53
Score: 0.5
Natty:
Report link

If you finally use your ENV variable in a bash script you may try Command Substitution principal

.env file:

ARRAY_BODY_EXPR="cat dog mouse frog"

In Dockerfile:

SHELL ["/bin/bash", "-c"]
RUN myArray=( $(echo ${ARRAY_BODY_EXPR}) );\
  for str in ${myArray[@]}; do \
    # do something with str
  done
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: martinBoy