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?

1

try

test-job:
    script:
        - env
2
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.