You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: registry/part-3.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,12 @@ The registry server and the Docker client support [basic authentication](https:/
9
9
Create the password file with an entry for user "moby" with password "gordon";
10
10
```
11
11
$ 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
13
13
```
14
14
The options are:
15
15
16
16
- --entrypoint Overwrite the default ENTRYPOINT of the image
17
+
- -B to force bcrypt vs default md5
17
18
- -b run in batch mode
18
19
- -n display results
19
20
@@ -60,9 +61,9 @@ Now the registry is using secure transport and user authentication.
60
61
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:
61
62
62
63
```
63
-
$ sudo docker pull <hostname>:5000/hello-world
64
+
$ sudo docker pull localhost:5000/hello-world
64
65
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
66
67
```
67
68
68
69
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
83
84
Now you're authenticated, you can push and pull as before:
0 commit comments