Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --insecure flag usage document in readme #113

Merged
merged 1 commit into from
Aug 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,40 @@ To remove the entry from the credentials file, use `oras logout`:
oras logout localhost:5000
```

#### Example using with insecure Docker registry

You want to login the registry without certificate if using the self-signed certificate or unencrypted HTTP connection Docker registry. `oras` support `--insecure` flag to login, it like the Docker daemon `insecure-registries` configuration.

First, create a valid htpasswd file (must use `-B` for bcrypt):

```
htpasswd -cB -b auth.htpasswd myuser mypass
```

Next, start a registry using that file for auth and listen the `0.0.0.0` address:

```
docker run -it --rm -p 8443:443 \
-v $(pwd)/auth.htpasswd:/etc/docker/registry/auth.htpasswd \
-e REGISTRY_AUTH="{htpasswd: {realm: localhost, path: /etc/docker/registry/auth.htpasswd}}" \
-e REGISTRY_HTTP_ADDR=0.0.0.0:443 \
registry
```

In a new window, login with `oras` using the ip address not localhost:

```
oras login -u myuser -p mypass --insecure <registry-ip>:8443
```

You will notice a new entry for `<registry-ip>:8443` appear in `~/.docker/config.json`.

To remove the entry from the credentials file, use `oras logout`:

```
oras logout <registry-ip>:8443
```

### Usage

#### Pushing single files to remote registry
Expand Down