Skip to content

Commit

Permalink
feat: add Gitlab Container Registry oci_pull support (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv authored Sep 18, 2023
1 parent fa6c07a commit 2dc52de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fetch.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ def fetch_images():
reproducible = False,
)

oci_pull(
name = "gitlab_assets_ce",
# tag = "v15-11-0-ee",
image = "registry.gitlab.com/gitlab-org/gitlab/gitlab-assets-ce",
digest = "sha256:78fc30603a49cdabba4cd1c3a94f71cb78e606a98b5b17c690c781c5c8955f29",
)

_DEB_TO_LAYER = """\
alias(
name = "layer",
Expand Down
5 changes: 5 additions & 0 deletions oci/private/pull.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ _WWW_AUTH = {
"scope": "repository:{repository}:pull",
"service": "{registry}",
},
"registry.gitlab.com": {
"realm": "gitlab.com/jwt/auth",
"scope": "repository:{repository}:pull",
"service": "container_registry",
},
}

def _strip_host(url):
Expand Down
1 change: 1 addition & 0 deletions oci/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ build_test(
"@debian",
"@debian_latest",
"@debian_stable",
"@gitlab_assets_ce",
# TODO: https://github.com/bazel-contrib/rules_oci/issues/193
# "@apollo_router",
"@from_rules_docker",
Expand Down

0 comments on commit 2dc52de

Please sign in to comment.