eenvsubst not substitituing value for varable

I have an environment variable which is a form of json representation

export ENV={"outer":{"inner":{"key":"apiValue"}}}

When I substitute this value using envsubst

  • Why do I get an error when I want to run cv2.imshow within docker container
  • Sharing data across containers
  • ssh pseudo-tty causes PTY allocation request failed on channel 0
  • Compile .NET project in Docker using .csproj file
  • How to create docker environments for production and development that match
  • Copy files and create symlink from a shared volume on Docker on container start
  • envsubst < testenv > testapp
    

    It replaces with an empty string

    testenv

    JSON.parse($ENV).outer.inner.key
    

    testapp

    JSON.parse().outer.inner.key
    

    But if I set it to a simple value like export $ENV=syz this works as expected. Is this achievable?

    Here is a complete dockerfile

    FROM nodesource/jessie:0.12.7
    
    MAINTAINER 
    
    
    # Create app directory 
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    
    # cache package.json and node_modules to speed up builds
    ADD src src
    ADD package.json package.json
    ADD node_modules node_modules
    
    # Install packages for envsubst
    RUN apt-get update && apt-get upgrade -y --force-yes && rm -rf /var/lib/apt/lists/*;
    RUN apt-get update
    RUN apt-get install -y gettext-base
    
    # Substitute dependencies from environment variables
    RUN rm src/js/app.js
    RUN envsubst < src/js/envapp.js > src/js/app.js
    RUN npm install
    
    EXPOSE 8000
    CMD [ "npm", "start"]
    

  • How to quickly show policies of all docker containers
  • Consul: SD architecture. What is the right way to access microservices from a front-end side?
  • run “docker run” from crontab
  • How do I define a Reverse Proxy to a docker windows container
  • How to assign specific IP to container and make that accessible outside of VM host?
  • Grafana setup on docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.