Running a Custom Docker Image on Amazon CodeBuild

I needed to use a custom docker image for some Dotnet Core 3 work with Amazon CodeBuild and hit into a few issues that took a bit of digging around to find, so thought I’d leave the here should anyone else need the same info.

Referencing a non AWS Docker Dmage

To do this use the format mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview4

Installing the AWS CLI Tools

Your docker image probably doesn’t have the AWS CLI tools installed so to do that add the following command to your buildspec.yml

phases:
    install:
        commands:
            - apt-get -y update
            - apt-get -y install python-pip
            - pip install --upgrade awscli
comments powered by Disqus