Before you begin

You can run the created images on any Arm machine with Docker installed.

Install Docker on the machine you want to run the created images.

For Linux, confirm the architecture is Arm AArch64.

Confirm you are using an Arm machine by running:

    

        
        
            uname -m
        
    

The output should be:

    

        
        aarch64

        
    

If you see a different result, you are not using an Arm computer running 64-bit Linux.

Pull and Run

If CodeBuild is complete, the images are ready to pull and run. Both images are identical and the output from the uname is the same and shows the image was built on Amazon Linux 2.

To get the image from Docker Hub:

    

        
        
            docker pull <username>/c-hello-world
        
    
Note

Replace <username> with your Docker Hub user name.

To get the image from AWS ECR:

    

        
        
            docker pull public.ecr.aws/<alias>/c-hello-world
        
    
Note

Replace <alias> with your AWS ECR alias (similar to m6s3k6o5)

To run the Docker Hub image:

    

        
        
            docker run --rm <username>/c-hello-world
        
    

The output should be similar to:

    

        
        Hello, architecture from uname is Linux 39d131c8e64b 4.14.219-161.340.amzn2.aarch64 #1 SMP Thu Feb 4 05:54:27 UTC 2021 aarch64 Linux
64-bit userspace

        
    

To run the AWS ECR image:

    

        
        
            docker run --rm public.ecr.aws/<alias>/c-hello-world
        
    

The output should be the same as above.

Summary

CodeBuild makes it easy to automate Docker image creation on AWS Graviton processors. The images can be stored automatically in repositories such as Docker Hub and AWS ECR. The images can be run on any Arm machine with Docker installed, including Linux, macOS, and Windows on Arm.

Back
Next