GitLab Documentation

Install your own container registry and cache server

Install your own container registry and cache server

When using the Runner in autoscale mode, it is advised to set up a personal container registry and a cache server.

Install a proxy container registry

  1. Login to a dedicated machine where the container registry proxy will be running
  2. Make sure that Docker Engine is installed on that machine
  3. Create a new container registry:

    docker run -d -p 6000:5000 \
        -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io \
        --restart always \
        --name registry registry:2
    

    You can modify the port number (6000) to expose the registry on a different port

  4. Check the IP address of the server:

    hostname --ip-address
    

    You should preferably choose the private networking IP address. The private networking is usually the fastest solution for internal communication between machines of a single provider (DigitalOcean, AWS, Azure, etc,) Usually the private networking is also not accounted to your monthly bandwidth limit.

  5. Docker registry will be accessible under MY_REGISTRY_IP:6000

You can now proceed and configure config.toml to use the new registry server.

Install your own cache server

If you don't want to use a SaaS S3 server, you can install your own S3-compatible caching server:

  1. Login to a dedicated machine where the cache server will be running
  2. Make sure that Docker Engine is installed on that machine
  3. Start minio, a simple S3-compatible server written in Go:

    docker run -it --restart always -p 9005:9000 \
            -v /.minio:/root/.minio -v /export:/export \
            --name minio \
            minio/minio:latest server /export
    

    You can modify the port 9005 to expose the cache server on different port

  4. Check the IP address of the server:

    hostname --ip-address
    
  5. Your cache server will be available at MY_CACHE_IP:9005

  6. Create a bucket that will be used by the Runner:

    sudo mkdir /export/runner
    

    runner is the name of the bucket in that case. If you choose a different bucket, then it will be different. All caches will be stored in the /export directory.

  7. Read the Access and Secret Key of minio and use it to configure the Runner:

    sudo cat /.minio/config.json
    

You can now proceed and configure config.toml to use the new cache server.

Was this helpful? Do you think that something is unclear? Use the comments area below and leave your feedback. For support and other enquiries, see getting help.