Hello, i have problem with deleting image tag from gitlab that use external registry (installed on different server).
Here’s my docker-compose.yml for gitlab
services:
app:
image: gitlab/gitlab-ee:${VERSION}-ee.0
container_name: ${CONTAINER_NAME}
restart: always
ports:
- "${GITLAB_SHELL_SSH_PORT}:22"
- "80:80"
- "443:443"
volumes:
- ./gitlab-data/data:/var/opt/gitlab
- ./gitlab-data/logs:/var/log/gitlab
- ./gitlab-data/config:/etc/gitlab
- ./gitlab-data/backups:/var/opt/gitlab/backups
shm_size: "512m"
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://192.168.0.1'
gitlab_rails['time_zone'] = '${TIMEZONE}'
gitlab_rails['gitlab_shell_ssh_port'] = ${GITLAB_SHELL_SSH_PORT}
gitlab_rails['initial_root_password'] = '${ROOT_PASSWORD}'
registry['enable'] = false
registry_external_url '${EXTERNAL_REGISTRY}'
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_api_url'] = "${EXTERNAL_REGISTRY}"
postgresql['enable'] = false
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '${DB_DATABASE}'
gitlab_rails['db_port'] = ${DB_PORT}
gitlab_rails['db_username'] = '${DB_USERNAME}'
gitlab_rails['db_password'] = '${DB_PASSWORD}'
gitlab_rails['smtp_enable'] = ${GITLAB_SMTP_ENABLE}
gitlab_rails['smtp_address'] = "${GITLAB_SMTP_ADDRESS}"
gitlab_rails['smtp_port'] = ${GITLAB_SMTP_PORT}
gitlab_rails['smtp_user_name'] = "${GITLAB_SMTP_USER_NAME}"
gitlab_rails['smtp_password'] = "${GITLAB_SMTP_PASSWORD}"
gitlab_rails['smtp_domain'] = "${GITLAB_SMTP_DOMAIN}"
gitlab_rails['smtp_authentication'] = "${GITLAB_SMTP_AUTHENTICATION}"
gitlab_rails['smtp_enable_starttls_auto'] = ${GITLAB_SMTP_ENABLE_STARTTLS_AUTO}
gitlab_rails['smtp_tls'] = ${GITLAB_SMTP_TLS}
gitlab_rails['smtp_openssl_verify_mode'] = '${GITLAB_SMTP_OPENSSL_VERIFY_MODE}'
gitlab_rails['gitlab_email_enabled'] = ${GITLAB_EMAIL_ENABLED}
gitlab_rails['gitlab_email_from'] = '${GITLAB_EMAIL_FROM}'
gitlab_rails['gitlab_email_display_name'] = '${GITLAB_EMAIL_DISPLAY_NAME}'
gitlab_rails['gitlab_email_reply_to'] = '${GITLAB_EMAIL_REPLY_TO}'
gitlab_rails['gitlab_email_subject_suffix'] = '${GITLAB_EMAIL_SUBJECT_SUFFIX}'
gitlab_rails['rack_attack_git_basic_auth'] = {
'enabled' => ${GITLAB_GIT_BASIC_AUTH_ENABLED},
'ip_whitelist' => ["127.0.0.1"],
'maxretry' => ${GITLAB_GIT_BASIC_AUTH_MAX_RETRY},
'findtime' => ${GITLAB_GIT_BASIC_AUTH_FIND_TIME},
'bantime' => ${GITLAB_GIT_BASIC_AUTH_BAN_TIME}
}
depends_on:
- db
db:
image: postgres:15
container_name: ${DB_DATABASE}
ports:
- "${DB_PORT_PUBLIC}:${DB_PORT}"
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
PGPORT: ${DB_PORT}
TZ: ${TIMEZONE}
volumes:
- ./postgres-data:/var/lib/postgresql/data
restart: always
runner:
image: gitlab/gitlab-runner:alpine-v${VERSION}
volumes:
- ./runner-data:/etc/gitlab-runner:Z
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: replicated
replicas: 2
*EXTERNAL_REGISTRY=http://192.168.0.2:5000 (it on different server with gitlab)
and my config.yml for registry is
version: 0.1
log:
fields:
service: registry
storage:
delete:
enabled: true
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
Access-Control-Allow-Origin: ['http://192.168.0.2']
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']
Access-Control-Max-Age: [1728000]
Access-Control-Allow-Credentials: [true]
Access-Control-Expose-Headers: ['Docker-Content-Digest']
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
i can remove image tag using postman with DELETE method
http://192.168.0.2:5000/v2/<my-project>/manifests/<digest>
i can remove it too using registry-ui that i installed on same server with registry (192.168.0.2:5001)
but when i try to remove it with gitlab, i got this error
i don’t know what exactly the error is, or maybe just misconfigured on config.yml for registry / compose config for gitlab?