Configure GLU.Engine settings
To configure GLU.Engine settings for pushing Docker containers to an AWS ECR repository, follow these steps. Please refer to AWS ECR documentation for details (AWS ECR):
Step 1:
- First a temporary token needs to be acquired through the AWS CLI command: $ aws ecr get-login-password
Step 2:
- Ensure that the server running the CLI commands has access to the AWS environment where the ECR repository is located. Use the
aws configure
command to set up access. - The following example shows how to view if the settings exist. Press return after each line and it will show you he value which has been set.
$ aws configure AWS Access Key ID [****************XXXD]: AWS Secret Access Key [****************8996]: Default region name [us-east-1]: Default output format [json]: |
Step 3:
- Once the connection has been established then the get-login-password command can be used to get a password, which can be used in the GLUConsole DOCKER PASSWORD field.
$ aws ecr get-login-password |
Step 4:
- A = DOCKER IMAGE REPOSITORY , to be entered in the GLU.Engines Settings below
- B = Must match the GLU.Engine name (See screen shot below, please also note the constraint applied to the GLU.Engine name by AWS i.e. a name like GLU_USSD_Demo will not work.)
- C = DOCKER URL , to be entered in the GLU.Engines Settings below
NOTE: Constraint applied by AWS on the GLU.Engine name if AWS ECR is to be used.
All below the fields are mandatory:
name | Value | Description |
---|---|---|
DOCKER URL | 42588888888835.dkr.ecr.us-east-1.amazonaws.com | path to the docker.io instance (C) |
DOCKER USERNAME | AWS | For AWS ECR Repos. this will always be “AWS” |
SKIP DOCKER | false | true or false, When set to false docker will be used. |
DOCKER PASSWORD | {Long string of characers from above} | The token generated by the aws ecr get-login-password |
DOCKER IMAGE REPOSITORY | gluware | in docker the repository name (A) |
In the example below, when this is configured and a build is executed the GLU.Console will execute the command below at the end of the build process. This will then push the Docker container 1.5-SNAPSHOT to the AWS ECR repo demo.
- $ push 42558888888535.dkr.ecr.us-east-1.amazonaws.com/gluware/demo:1.5-SNAPSHOT
Useful AWS commands
Command | Description |
---|---|
aws ecr get-login-password | docker login –username AWS –password-stdin 92266666477.dkr.ecr.us-east-1.amazonaws.com | to be used to log into the AWS instance of the ECR |
aws ecr get-login-password | If connected to AWS it will display the password, which needs to be put in the GLU Application Settings page. |
aws ecr list-images –repository-name gluware/demo | Useful to list the repositories which are held by the ECR, also to confirm connection is correct. |