Skip to content

Commit

Permalink
docs: add customer example
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Sep 21, 2023
1 parent bb0f32f commit d850f56
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ regctl image export $REGISTRY/alpine /dev/null

Try pulling an image **user** does not have access to:


```shell
# Using skopeo
skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/product1/alpine
Expand All @@ -134,6 +133,26 @@ regctl image inspect $REGISTRY/product1/alpine
regctl image export $REGISTRY/product1/alpine /dev/null
```

Push an image to the registry:

```shell
# Using skopeo
skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/user/alpine

# Using regctl
regctl image import $REGISTRY/user/alpine $PWD/var/alpine.tar.gz
```

Try pushing an image that **user** does not have access to:

```shell
# Using skopeo
skopeo --insecure-policy copy --dest-tls-verify=false -a oci-archive://$PWD/var/alpine.tar.gz docker://$REGISTRY/alpine

# Using regctl
regctl image import $REGISTRY/alpine $PWD/var/alpine.tar.gz
```

Logout as **user** from the registry:

```shell
Expand All @@ -144,6 +163,39 @@ skopeo logout $REGISTRY
regctl registry logout $REGISTRY
```

Log in to the registry as **customer**:

```shell
# Using skopeo
skopeo login --tls-verify=false -u customer -p password $REGISTRY

# Using regctl
regctl registry set --tls=disabled $REGISTRY
regctl registry login -u customer -p password $REGISTRY
```

Inspect and pull images in the registry:

```shell
# Using skopeo
skopeo --insecure-policy --override-os linux --override-arch amd64 inspect --tls-verify=false docker://$REGISTRY/product1/alpine
skopeo --insecure-policy copy --src-tls-verify=false -a docker://$REGISTRY/product1/alpine oci-archive:///dev/null

# Using regctl
regctl image inspect $REGISTRY/product1/alpine
regctl image export $REGISTRY/product1/alpine /dev/null
```

Logout as **customer** from the registry:

```shell
# Using skopeo
skopeo logout $REGISTRY

# Using regctl
regctl registry logout $REGISTRY
```

## Cleanup

Tear down the Docker Compose setup:
Expand Down

0 comments on commit d850f56

Please sign in to comment.