How can I set environment variables in a GitLab CI docker runner?Root set environment variableshow to...

If the Dominion rule using their Jem'Hadar troops, why is their life expectancy so low?

Should a narrator ever describe things based on a character's view instead of facts?

Make a Bowl of Alphabet Soup

Why can't I get pgrep output right to variable on bash script?

Using an older 200A breaker panel on a 60A feeder circuit from house?

Weird lines in Microsoft Word

Writing in a Christian voice

Travelling in US for more than 90 days

What (if any) is the reason to buy in small local stores?

Extract substring according to regexp with sed or grep

Checking @@ROWCOUNT failing

How to split IPA spelling into syllables

Did I make a mistake by ccing email to boss to others?

Would this string work as string?

Output visual diagram of picture

What is it called when someone votes for an option that's not their first choice?

Why would five hundred and five same as one?

What is the meaning of "You've never met a graph you didn't like?"

Reason why a kingside attack is not justified

Mortal danger in mid-grade literature

Has the laser at Magurele, Romania reached a tenth of the Sun's power?

How to test the sharpness of a knife?

Is divisi notation needed for brass or woodwind in an orchestra?

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?



How can I set environment variables in a GitLab CI docker runner?


Root set environment variableshow to properly set environment variablesHow to set environment variables in /etc/environment?gitlab-runner has not yet connected errorHow to configure gitlab-runnergitlab-runner not using local imagegitlab runner errors occasionallyUnable to Register Gitlab Runner (Certificate Failed)Change Gitlab CI Runner user in subprocess













2















We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).



I have added the appropriate lines into /etc/bash.bashrc in our docker image.



When manually running the image with:



docker run --rm -ti bboss/python:3 /bin/bash


and then executing



export


I can see the variables.



However, when I define a GitLab CI task based on that image and add a section like:



test-job:
script:
- export


I don't see any variables.



It seems like the entries in /etc/bash.bashrc are not taken into consideration.



How can I make that work?










share|improve this question














bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    2















    We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).



    I have added the appropriate lines into /etc/bash.bashrc in our docker image.



    When manually running the image with:



    docker run --rm -ti bboss/python:3 /bin/bash


    and then executing



    export


    I can see the variables.



    However, when I define a GitLab CI task based on that image and add a section like:



    test-job:
    script:
    - export


    I don't see any variables.



    It seems like the entries in /etc/bash.bashrc are not taken into consideration.



    How can I make that work?










    share|improve this question














    bumped to the homepage by Community 5 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2








      We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).



      I have added the appropriate lines into /etc/bash.bashrc in our docker image.



      When manually running the image with:



      docker run --rm -ti bboss/python:3 /bin/bash


      and then executing



      export


      I can see the variables.



      However, when I define a GitLab CI task based on that image and add a section like:



      test-job:
      script:
      - export


      I don't see any variables.



      It seems like the entries in /etc/bash.bashrc are not taken into consideration.



      How can I make that work?










      share|improve this question














      We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).



      I have added the appropriate lines into /etc/bash.bashrc in our docker image.



      When manually running the image with:



      docker run --rm -ti bboss/python:3 /bin/bash


      and then executing



      export


      I can see the variables.



      However, when I define a GitLab CI task based on that image and add a section like:



      test-job:
      script:
      - export


      I don't see any variables.



      It seems like the entries in /etc/bash.bashrc are not taken into consideration.



      How can I make that work?







      bash environment-variables gitlab






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 22 '17 at 14:20









      exhumaexhuma

      5321420




      5321420





      bumped to the homepage by Community 5 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 5 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          try



          test-job:
          script:
          - env





          share|improve this answer



















          • 2





            Thank you for your contribution? Can you provide an explanation?

            – bertieb
            Apr 17 '18 at 22:30











          • Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

            – mmccabe
            Apr 18 '18 at 5:32











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279394%2fhow-can-i-set-environment-variables-in-a-gitlab-ci-docker-runner%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          try



          test-job:
          script:
          - env





          share|improve this answer



















          • 2





            Thank you for your contribution? Can you provide an explanation?

            – bertieb
            Apr 17 '18 at 22:30











          • Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

            – mmccabe
            Apr 18 '18 at 5:32
















          0














          try



          test-job:
          script:
          - env





          share|improve this answer



















          • 2





            Thank you for your contribution? Can you provide an explanation?

            – bertieb
            Apr 17 '18 at 22:30











          • Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

            – mmccabe
            Apr 18 '18 at 5:32














          0












          0








          0







          try



          test-job:
          script:
          - env





          share|improve this answer













          try



          test-job:
          script:
          - env






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 17 '18 at 21:50









          mmccabemmccabe

          1011




          1011








          • 2





            Thank you for your contribution? Can you provide an explanation?

            – bertieb
            Apr 17 '18 at 22:30











          • Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

            – mmccabe
            Apr 18 '18 at 5:32














          • 2





            Thank you for your contribution? Can you provide an explanation?

            – bertieb
            Apr 17 '18 at 22:30











          • Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

            – mmccabe
            Apr 18 '18 at 5:32








          2




          2





          Thank you for your contribution? Can you provide an explanation?

          – bertieb
          Apr 17 '18 at 22:30





          Thank you for your contribution? Can you provide an explanation?

          – bertieb
          Apr 17 '18 at 22:30













          Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

          – mmccabe
          Apr 18 '18 at 5:32





          Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.

          – mmccabe
          Apr 18 '18 at 5:32


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279394%2fhow-can-i-set-environment-variables-in-a-gitlab-ci-docker-runner%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...