Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Seipel
gitlab-runner
Commits
cefda6df
Unverified
Commit
cefda6df
authored
8 years ago
by
Hannes Rosenögger
Committed by
Achilleas Pipinellis
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add proxy documentation
parent
51af6972
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/install/linux-proxy.md
+69
-0
69 additions, 0 deletions
docs/install/linux-proxy.md
with
69 additions
and
0 deletions
docs/install/linux-proxy.md
0 → 100644
+
69
−
0
View file @
cefda6df
### Running the runner behind a proxy
#### Assumtions
*
you've already installed docker and the gitlab runner.
*
you are using
`cntlm`
as a local proxy.
The last point has
**2**
major advantages compared to adding the proxy details everywhere directly.
*
one single source where you need to change your credentials
*
the credentials can not be accessed from the docker runners
#### Configuring cntlm
The config file for cntlm is
`/etc/cntlm.conf`
Enter your username, password, domain and proxy hosts there.
Also make sure to remove the leading # from this line:
`Gateway yes`
**This is important! If you don't do that, your docker containers won't be able to use your local CNTLM proxy!**
After you changed your config, restart CNTLM with:
`service cntlm restart`
#### Proxy for Docker image download
Refer to https://docs.docker.com/engine/admin/systemd/#http-proxy
1.
Create a systemd drop-in directory for the docker service:
`mkdir /etc/systemd/system/docker.service.d`
2.
Create a file called
`/etc/systemd/system/docker.service.d/http-proxy.conf`
that adds the
`HTTP_PROXY`
environment variable:
```
[Service]
Environment="HTTP_PROXY=http://localhost:3128/"
Environment="HTTPS_PROXY=http://localhost:3128/"
```
3.
Flush changes:
`systemctl daemon-reload`
4.
Verify that the configuration has been loaded:
`systemctl show --property=Environment docker`
You should see:
`Environment=HTTP_PROXY=http://localhost:3128/ HTTPS_PROXY=http://localhost:3128/`
5.
Restart Docker:
`systemctl restart docker`
#### Adding Proxy variables to the runner config, so it get's builds assigned from the gitlab behind the proxy
This is basically the same as adding the proxy to docker.
1.
Create a systemd drop-in directory for the gitlab-runner service:
`mkdir /etc/systemd/system/gitlab-runner.service.d`
2.
Create a file called
`/etc/systemd/system/gitlab-runner.service.d/http-proxy.conf`
that adds the
`HTTP_PROXY`
environment variable:
```
[Service]
Environment="HTTP_PROXY=http://localhost:3128/"
Environment="HTTPS_PROXY=http://localhost:3128/"
```
3.
Flush changes:
`systemctl daemon-reload`
4.
Verify that the configuration has been loaded:
`systemctl show --property=Environment gitlab-runner`
You should see:
`Environment=HTTP_PROXY=http://localhost:3128/ HTTPS_PROXY=http://localhost:3128/`
#### adding the proxy to the docker containers (for git clone and other stuff)
After you registered your runner, you might want to propagate your proxy settings to the docker containers.
To do that you need to edit the
`/etc/gitlab-runner/config.toml`
and add the following to the
`[[runners]]`
section:
```
pre_clone_script = "git config --global http.proxy $HTTP_PROXY; git config --global https.proxy $HTTPS_PROXY"
environment = ["HTTPS_PROXY=<your_host_ip_here>:3128", "HTTP_PROXY=<your_host_ip_here>:3128"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment