Update the README on the use of shelling out to the aws cli command to obtain the token for ECR automatically

This commit is contained in:
John McDowall
2023-05-20 13:46:05 -07:00
parent a7d869ad40
commit 7daee9a0df

View File

@@ -184,6 +184,19 @@ registry:
A reference to secret `DOCKER_REGISTRY_TOKEN` will look for `ENV["DOCKER_REGISTRY_TOKEN"]` on the machine running MRSK.
#### Using AWS ECR as the container registry
AWS ECR's access token is only valid for 12hrs. In order to not have to manually regenerate the token every time, you can use ERB in the `deploy.yml` file to shell out to the `aws` cli command, and obtain the token:
```yaml
registry:
server: <your aws account id>.dkr.ecr.<your aws region id>.amazonaws.com
username: AWS
password: <%= %x(aws ecr get-login-password) %>
```
You will need to have the `aws` CLI installed locally for this to work.
### Using a different SSH user than root
The default SSH user is root, but you can change it using `ssh/user`: