Home > Software design >  HTTPS fails when building Docker image through AWS CodePipeline
HTTPS fails when building Docker image through AWS CodePipeline

Time:11-20

I have a single instance (Elastic Beanstalk, no load balancer) which runs a docker image of my web page (nginx). To configure this, I'm having a .ebextensions folder with:https-instance.config, https-instance-single.config and in the root a docker file that builds the image.

If I build the image locally, upload it to docker hub, and let EBS update the image from here, my HTTPS calls to my application works.

Now, I've moved to CodePipelines where I'm checking out the same code and building it with AWS CodeBuild, putting the docker image on ECR and deploying it to EBS my HTTP calls are working but all my HTTPS calls gets a Request Timeout.

I have not changed the hosting environments, so they have access to S3 (where my certificate is located for nginx) and everything just as before (if I revert to image from docker hub, it works again).

Something must be blocking the request. The only thing that should be changed is where the image has been build.

I would have included some files, but I'm rather unsure which makes sense to include in this case.

Can anybody give me some pointers on where to look to figure out what is going wrong? (I'm fairly new to AWS)

CodePudding user response:

The problem was with my buildspec.yml file. I had to add .ebextensions as an artifact.

artifacts:
  files:
    - 'Dockerrun.aws.json'
    - .ebextensions/**/*

When not having this, the file that was generated and sent to Elastic Beanstalk would only contain Dockerrun.aws.json and then nginx would not get configured to use SSL

  • Related