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

  • Can't access to lite-server in docker container
  • How to enable SSL in docker with nginx hosted in Ubuntu
  • How to host two Docker containers exposing port 80 on the same server
  • Docker logs not showing colors (express + nodejs image)
  • cannot use curl to load docker image from a tarball using docker api
  • Is it possible to execute CMD at the middle of docker file?
  • envsubst < testenv > testapp

    It replaces with an empty string





    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
    # 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"]

  • Kubernetes add ca certificate to pods' trust root
  • How to set an environment variable in a running docker container
  • How can I get a docker container to load text from /etc/motd
  • '/bin/sh -c bash $METEORD_DIR/' returned a non-zero code: 1
  • How to build an Image using Docker API?
  • How to execute a shell command before the ENTRYPOINT via the dockerfile
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.