Skip to content

Commit e444696

Browse files
author
sophia parafina
committed
fixed -B (bcrypt) option in htpasswd example
1 parent c193841 commit e444696

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

registry/part-3.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ The registry server and the Docker client support [basic authentication](https:/
99
Create the password file with an entry for user "moby" with password "gordon";
1010
```
1111
$ mkdir auth
12-
$ sudo docker run --entrypoint htpasswd registry:latest -bn moby gordon > auth/htpasswd
12+
$ sudo docker run --entrypoint htpasswd registry:latest -Bbn moby gordon > auth/htpasswd
1313
```
1414
The options are:
1515

1616
- --entrypoint Overwrite the default ENTRYPOINT of the image
17+
- -B to force bcrypt vs default md5
1718
- -b run in batch mode
1819
- -n display results
1920

@@ -60,9 +61,9 @@ Now the registry is using secure transport and user authentication.
6061
With basic authentication, users cannot push or pull from the registry unless they are authenticated. If you try and pull an image without authenticating, you will get an error:
6162

6263
```
63-
$ sudo docker pull <hostname>:5000/hello-world
64+
$ sudo docker pull localhost:5000/hello-world
6465
Using default tag: latest
65-
Error response from daemon: Get https://<hostname>:5000/v2/hello-world/manifests/latest: no basic auth credentials
66+
Error response from daemon: Get https://localhost:5000/v2/hello-world/manifests/latest: no basic auth credentials
6667
```
6768

6869
The result is the same for valid and invalid image names, so you can't even check a repository exists without authenticating. Logging in to the registry is the same `docker login` command you use for Docker Hub, specifying the registry hostname:
@@ -83,7 +84,7 @@ Error response from daemon: login attempt to https://registry.local:5000/v2/ fai
8384
Now you're authenticated, you can push and pull as before:
8485

8586
```
86-
$ sudo docker pull <hostname>:5000/hello-world
87+
$ sudo docker pull localhost:5000/hello-world
8788
Using default tag: latest
8889
latest: Pulling from hello-world
8990
Digest: sha256:961497c5ca49dc217a6275d4d64b5e4681dd3b2712d94974b8ce4762675720b4

0 commit comments

Comments
 (0)