Enable S3 container registry storage
For this we need to migrate everything into S3. This is the action plan:
-
create an s3 bucket for this -
use s3sync to start syncing the data (~800G, will take a while) -
docker push a new image -
put registry in read-only -
do final s3sync -
switch registry to s3 and make read-only -
docker pull on old image -
docker pull a new image from 2. -
switch registry read-write -
docker push a new v2 image -
docker pull a new v2 image
Proposed configuration:
registry['storage'] = {
'filesystem' => {
'rootdirectory' => '/var/opt/gitlab/gitlab-rails/shared/registry'
},
'maintenance' => {
'readonly' => {
'enabled' => false
}
}
}
Useful links:
- Docker registry configuration: https://github.com/docker/distribution/blob/master/docs/configuration.md
- GitLab registry configuration: http://docs.gitlab.com/ce/administration/container_registry.html#container-registry-storage-driver
- S3 sync command: http://s3tools.org/s3cmd-sync
- cloudfront middleware to distribute globally: https://github.com/docker/distribution/blob/master/docs/storage-drivers/s3.md#cloudfront-as-middleware-with-s3-backend