This is an example project for building Docker images on CircleCI 2.0 Beta. This project covers:
- Building Docker images in Docker CI container
- Caching Docker image layers without using potential premium feature
- Testing Docker images using Docker Compose
- Pushing Docker images to Amazon EC2 Container Registry
The example application in this project is fairly simple. To launch the app, just run:
$ docker-compose up
Then, you will get Hello World!
if you curl localhost:8000
.
-
Create an AWS account and an IAM user with enough permissions
-
Move to
terraform
directory$ cd terraform
-
Copy
terraform.tfvars.example
toterraform.tfvars
and fill in values -
Run terraform command
$ terraform plan && terraform apply
You need to set the following environment variables on CircleCI UI:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
ECR_ENDPOINT
: e.g.<ACCOUNT-ID>.dkr.ecr.ap-northeast-1.amazonaws.com
Copyright © 2017 Naoto Yokoyama
Distributed under the MIT license. See the LICENSE file for full details.