Build/bundle in blowing away ENV variables in docker-compose.yml

Hi @ed-bear ,

I think I managed to do a workaround for your problem. Using the example made by @jeremias.tx :

# docker-compose.yml
version: '2.4'
services:
  hello-world:
    image: hello-world:latest
    environment:
    - A=${D_SIGN}${FOO}
    - B=${D_SIGN}${BAR}
# .env
D_SIGN='$'
FOO={FOO}
BAR={BAR}

The resulting bundle/docker-compose.yml after executing torizoncore-builder bundle docker-compose.yml is:

# bundle/docker-compose.yml
services:
  hello-world:
    environment:
      A: ${FOO}
      B: ${BAR}
    image: hello-world@sha256:53f1bbee2f52c39e41682ee1d388285290c5c8a76cc92b42687eecf38e0af3f0
version: '2.4'

You have to create a .env for your host machine like I did above, but it should do the trick. Just adapt it to your situation accordingly.

Try doing the above and see if it helps you.

Best regards,
Lucas Akira

1 Like