title: How to pass along custom variable created in .gitlab-ci.yml to Docker?
body: <p>Within <code>.gitlab-ci.yml</code> I've created a new variable under <code>script:</code> by using <code>$CI_COMMIT_SHA</code> and modifying it. When I <code>echo</code> the variable it returns the proper value. However, I'm not having any success passing it along to Docker. What am I not doing right?</p>
  
  <p>Ultimately, I would like access this custom variable inside my container.</p>
  
  <pre><code>build:
    script:
      # converts commit SHA to UNIX time
      - export COMMIT_TIME_UNIX=$(git show -s --format=%ct $CI_COMMIT_SHA)
      - echo $COMMIT_TIME_UNIX
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZO5j2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZO5j2.png" alt="enter image description here"></a></p>