diff options
Diffstat (limited to 'doc/user/packages/container_registry/index.md')
-rw-r--r-- | doc/user/packages/container_registry/index.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/user/packages/container_registry/index.md b/doc/user/packages/container_registry/index.md index b10430633ff..c9e60d1497f 100644 --- a/doc/user/packages/container_registry/index.md +++ b/doc/user/packages/container_registry/index.md @@ -60,7 +60,7 @@ using your GitLab credentials. For example if the Registry's URL is `registry.example.com`, then you should be able to login with: -```sh +```shell docker login registry.example.com ``` @@ -68,7 +68,7 @@ Building and publishing images should be a straightforward process. Just make sure that you are using the Registry URL with the namespace and project name that is hosted on GitLab: -```sh +```shell docker build -t registry.example.com/group/project/image . docker push registry.example.com/group/project/image ``` @@ -94,7 +94,7 @@ registry.example.com/group/project/my/image:rc1 To download and run a container from images hosted in GitLab Container Registry, use `docker run`: -```sh +```shell docker run [options] registry.example.com/group/project/image [arguments] ``` @@ -134,7 +134,7 @@ The minimal scope needed for both of them is `read_registry`. Example of using a token: -```sh +```shell docker login registry.example.com -u <username> -p <token> ``` @@ -153,13 +153,13 @@ Examples: - Select all tags, keep at least 1 tag per image, expire any tag older than 14 days, run once a month, and the policy is enabled: - ```bash + ```shell curl --request PUT --header 'Content-Type: application/json;charset=UTF-8' --header "PRIVATE-TOKEN: <your_access_token>" --data-binary '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":".*"}' 'https://gitlab.example.com/api/v4/projects/2' ``` - Select only tags with a name that contains `stable`, keep at least 50 tag per image, expire any tag older than 7 days, run every day, and the policy is enabled: - ```bash + ```shell curl --request PUT --header 'Content-Type: application/json;charset=UTF-8' --header "PRIVATE-TOKEN: <your_access_token>" --data-binary '{"container_expiration_policy_attributes":{"cadence":"1day","enabled":true,"keep_n":50"older_than":"7d","name_regex":"*stable"}' 'https://gitlab.example.com/api/v4/projects/2' ``` |