GitLab registry with S3 storage

Configure CEPH

touch /tmp/placeholder
s3cmd mb s3://gitlab
s3cmd put /tmp/placeholder s3://gitlab
s3cmd ls s3://gitlab
s3cmd du s3://gitlab

Configure GitLab

# /etc/gitlab/gitlab.rb
...
registry_external_url 'https://registry.example.com'
registry_nginx['enable'] = true
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/registry.example.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/registry.example.com.key"
#registry['log_level'] = "debug"
#registry['storage_delete_enabled'] = true
...
registry['storage'] = {
  's3' => {
     'accesskey' => 'YOUR_ACCESS_KEY',
     'secretkey' => 'YOUR_SECRET_KEY',
     'bucket'    => 'gitlab',
     'region'    => 'us-west-1',
     'regionendpoint' => 'https://s3.example.com'
  },
  'redirect' => {
    'disable' => true
  }
}
 
cleanup registry (test):
sudo gitlab-ctl registry-garbage-collect

Links
https://gitlab.com/gitlab-org/gitlab-ce/issues/19356
https://docs.gitlab.com/ce/administration/container_registry.html
https://docs.docker.com/registry/configuration/#storage
https://icicimov.github.io/blog/server/GitLab-server-with-LDAP-and-S3-backend/