Skip to content

Commit e710d41

Browse files
Benbentwomilldr
andauthored
EKS: actions-runner-controller readme update for dockerhub auth (cloudposse/terraform-aws-components#1010)
Co-authored-by: Dan Miller <[email protected]>
1 parent b40a57b commit e710d41

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,63 @@ Store this key in AWS SSM under the same path specified by `ssm_github_webhook_s
247247
ssm_github_webhook_secret_token_path: "/github_runners/github_webhook_secret"
248248
```
249249

250+
### Dockerhub Authentication
251+
252+
Authenticating with Dockerhub is optional but when enabled can ensure stability by increasing the number of pulls
253+
allowed from your runners.
254+
255+
To get started set `docker_config_json_enabled` to `true` and `ssm_docker_config_json_path` to the SSM path where the
256+
credentials are stored, for example `github_runners/docker`.
257+
258+
To create the credentials file, fill out a JSON file locally with the following content:
259+
260+
```json
261+
{
262+
"auths": {
263+
"https://index.docker.io/v1/": {
264+
"username": "your_username",
265+
"password": "your_password",
266+
"email": "your_email",
267+
"auth": "$(echo "your_username: your_password" | base64)"
268+
}
269+
}
270+
}
271+
```
272+
273+
Then write the file to SSM with the following Atmos Workflow:
274+
275+
```yaml
276+
save/docker-config-json:
277+
description: Prompt for uploading Docker Config JSON to the AWS SSM Parameter Store
278+
steps:
279+
- type: shell
280+
command: |-
281+
echo "Please enter the Docker Config JSON file path"
282+
echo "See https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry for information on how to create the file"
283+
read -p "Docker Config JSON file path: " -r DOCKER_CONFIG_JSON_FILE_PATH
284+
if [ -z "DOCKER_CONFIG_JSON_FILE_PATH" ]
285+
then
286+
echo 'Inputs cannot be blank please try again!'
287+
exit 0
288+
fi
289+
290+
DOCKER_CONFIG_JSON=$(<$DOCKER_CONFIG_JSON_FILE_PATH);
291+
ENCODED_DOCKER_CONFIG_JSON=$(echo "$DOCKER_CONFIG_JSON" | base64 -w 0 );
292+
293+
echo $DOCKER_CONFIG_JSON
294+
echo $ENCODED_DOCKER_CONFIG_JSON
295+
296+
AWS_PROFILE=acme-core-gbl-auto-admin
297+
298+
set -e
299+
300+
chamber write github_runners/docker config-json -- "$ENCODED_DOCKER_CONFIG_JSON"
301+
302+
echo 'Saved Docker Config JSON to the AWS SSM Parameter Store'
303+
```
304+
305+
Don't forget to update the AWS Profile in the script.
306+
250307
### Using Runner Groups
251308
252309
GitHub supports grouping runners into distinct

0 commit comments

Comments
 (0)