1--- 2title: "signer add" 3description: "The signer add command description and usage" 4keywords: "signer, notary, trust" 5--- 6 7# trust signer add 8 9```markdown 10Usage: docker trust signer add [OPTIONS] NAME REPOSITORY [REPOSITORY...] 11 12Add a signer 13 14Options: 15 --help Print usage 16 -k, --key list Path to the signer's public key file 17``` 18 19## Description 20 21`docker trust signer add` adds signers to signed repositories. 22 23## Examples 24 25### Add a signer to a repo 26 27To add a new signer, `alice`, to this repository: 28 29```bash 30$ docker trust inspect --pretty example/trust-demo 31 32No signatures for example/trust-demo 33 34 35List of signers and their keys: 36 37SIGNER KEYS 38bob 5600f5ab76a2 39 40Administrative keys for example/trust-demo: 41Repository Key: 642692c14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e 42Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 43``` 44 45Add `alice` with `docker trust signer add`: 46 47```bash 48$ docker trust signer add alice example/trust-demo --key alice.crt 49 Adding signer "alice" to example/trust-demo... 50 Enter passphrase for repository key with ID 642692c: 51Successfully added signer: alice to example/trust-demo 52``` 53 54`docker trust inspect --pretty` now lists `alice` as a valid signer: 55 56```bash 57$ docker trust inspect --pretty example/trust-demo 58 59No signatures for example/trust-demo 60 61 62List of signers and their keys: 63 64SIGNER KEYS 65alice 05e87edcaecb 66bob 5600f5ab76a2 67 68Administrative keys for example/trust-demo: 69Repository Key: 642692c14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e 70Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 71``` 72 73## Initialize a new repo and add a signer 74 75When adding a signer on a repo for the first time, `docker trust signer add` sets up a new repo if it doesn't exist. 76 77```bash 78$ docker trust inspect --pretty example/trust-demo 79 80No signatures or cannot access example/trust-demo 81``` 82 83```bash 84$ docker trust signer add alice example/trust-demo --key alice.crt 85 86Initializing signed repository for example/trust-demo... 87Enter passphrase for root key with ID 748121c: 88Enter passphrase for new repository key with ID 95b9e55: 89Repeat passphrase for new repository key with ID 95b9e55: 90Successfully initialized "example/trust-demo" 91 92Adding signer "alice" to example/trust-demo... 93Successfully added signer: alice to example/trust-demo 94``` 95 96```bash 97$ docker trust inspect --pretty example/trust-demo 98 99No signatures for example/trust-demo 100 101 102SIGNED TAG DIGEST SIGNERS 103 104List of signers and their keys: 105 106SIGNER KEYS 107alice 6d52b29d940f 108 109Administrative keys for example/trust-demo: 110Repository Key: 95b9e5565eac3ef5ec01406801bdfb70feb40c17808d2222427c18046eb63beb 111Root Key: 748121c14bd1461f6c58cb3ef39087c8fdc7633bb11a98af844fd9a04e208103 112``` 113 114## Add a signer to multiple repos 115To add a signer, `alice`, to multiple repositories: 116```bash 117$ docker trust inspect --pretty example/trust-demo 118 119SIGNED TAG DIGEST SIGNERS 120v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob 121 122List of signers and their keys: 123 124SIGNER KEYS 125bob 5600f5ab76a2 126 127Administrative keys for example/trust-demo: 128Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e 129Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 130``` 131```bash 132$ docker trust inspect --pretty example/trust-demo2 133 134SIGNED TAG DIGEST SIGNERS 135v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob 136 137List of signers and their keys: 138 139SIGNER KEYS 140bob 5600f5ab76a2 141 142Administrative keys for example/trust-demo2: 143Repository Key: ece554f14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4553d2ab20a8d9268 144Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 145``` 146Add `alice` to both repositories with a single `docker trust signer add` command: 147 148```bash 149$ docker trust signer add alice example/trust-demo example/trust-demo2 --key alice.crt 150 151Adding signer "alice" to example/trust-demo... 152Enter passphrase for repository key with ID 95b9e55: 153Successfully added signer: alice to example/trust-demo 154 155Adding signer "alice" to example/trust-demo2... 156Enter passphrase for repository key with ID ece554f: 157Successfully added signer: alice to example/trust-demo2 158``` 159 160`docker trust inspect --pretty` now lists `alice` as a valid signer of both `example/trust-demo` and `example/trust-demo2`: 161 162 163```bash 164$ docker trust inspect --pretty example/trust-demo 165 166SIGNED TAG DIGEST SIGNERS 167v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob 168 169List of signers and their keys: 170 171SIGNER KEYS 172alice 05e87edcaecb 173bob 5600f5ab76a2 174 175Administrative keys for example/trust-demo: 176Repository Key: 95b9e5514c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e 177Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 178``` 179 180```bash 181$ docker trust inspect --pretty example/trust-demo2 182 183SIGNED TAG DIGEST SIGNERS 184v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob 185 186List of signers and their keys: 187 188SIGNER KEYS 189alice 05e87edcaecb 190bob 5600f5ab76a2 191 192Administrative keys for example/trust-demo2: 193Repository Key: ece554f14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4553d2ab20a8d9268 194Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 195``` 196 197 198`docker trust signer add` adds signers to repositories on a best effort basis, so it will continue to add the signer to subsequent repositories if one attempt fails: 199 200```bash 201$ docker trust signer add alice example/unauthorized example/authorized --key alice.crt 202 203Adding signer "alice" to example/unauthorized... 204you are not authorized to perform this operation: server returned 401. 205 206Adding signer "alice" to example/authorized... 207Enter passphrase for repository key with ID c6772a0: 208Successfully added signer: alice to example/authorized 209 210Failed to add signer to: example/unauthorized 211``` 212