Send variables into docker container to use in a script Send variables into docker container to use in a script docker docker

Send variables into docker container to use in a script


The answer to this question was:

ci/pdf/jenkins-changes.sh LOG="$(cat ".log")"export LOG

Then pass it as an argument, instead of a variable:

pdf:    image: thisimage/this    build:    context: ../    dockerfile: ./docker/Dockerfile.name    args:        git_branch: ${GIT_BRANCH}    env_file:    - variables.env    environment:    - LOG=${LOG}    volumes:    - do-build:/src/do-build

And then, in the dockerfile call it and define it.

ARG log

This should leave it global for any script to use it.