# Use private registry in GitLab CI job

**URL:** <https://discourse.julialang.org/t/use-private-registry-in-gitlab-ci-job/36179>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 19, 2020, 9:56am UTC](https://discourse.julialang.org/t/use-private-registry-in-gitlab-ci-job/36179 "2020-03-19T09:56:43Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![ianfiske](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Post date:** [March 19, 2020, 2:50pm UTC](https://discourse.julialang.org/t/use-private-registry-in-gitlab-ci-job/36179/16 "2020-03-19T14:50:09Z")

</div>

> [@ohmsweetohm1](#):
>
> All repo paths in the registry are defined via an SSH link.

I suggest you use https tokens. Use git’s `insteadOf` feature to auto-convert all ssh and non-cred urls to the correct credded url. To do this, have your `before_script` section do something like

```julia
    git config --global url."https://$JULIASYSTEMUSER:$JULIAREGTOKEN@gitlab.mycompany.com/".insteadOf "git@gitlab.mycompany.com:"
    git config --global url."https://$JULIASYSTEMUSER:$JULIAREGTOKEN@gitlab.mycompany.com/".insteadOf "https://gitlab.mycompany.com/" --add

```

This works nice because it doesn’t matter how the url’s are listed in the registry.

---

_[View the full topic](https://discourse.julialang.org/t/use-private-registry-in-gitlab-ci-job/36179)._
