Disclaimer:
Some steps or configurations described in this post may incur charges when using AWS services. It is your responsibility to review AWS pricing and monitor your usage. After testing, ensure that all resources are properly deleted to avoid unexpected charges. Always use the AWS Free Tier where applicable and test responsibly.
2. Log in to the Oracle Container Registry
From your EC2 login to container-registry.oracle.com
docker login container-registry.oracle.com
3. Pull the Oracle XE Docker Image
docker pull container-registry.oracle.com/database/express:latestt
latest: Pulling from database/express
2318ff572021: Pull complete
c6250726c822: Pull complete
33ac5ea7f7dd: Pull complete
753e0fae7e64: Pull complete
Digest: sha256:dcf137aab02d5644aaf9299aae736e4429f9bfdf860676ff398a1458ab8d23f2
Status: Downloaded newer image for container-registry.oracle.com/database/express:latest
container-registry.oracle.com/database/express:latest
Verify the image was downloaded
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/database/express latest 8da8cedb7fbf 19 months ago 11.4GB
4. Create an ECR Repository in AWS
Navigate to Elastic Container Registry (ECR) and click on Create. Provide a name for the repository(f.i. oracle-xe) and configure settings (or just leave them as they are).
5. Authenticate Docker to Your ECR Registry
To push images to ECR, authenticate Docker with your ECR registry:
— Replace <region> with your AWS region (e.g., us-west-1) and <aws_account_id> with your AWS account ID.
— ‘aws configure’ must have been started before
aws ecr get-login-password –region <region> | docker login –username AWS –password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com
…
Login Succeeded
6. Tag the Oracle XE Image for ECR
–Replace: <aws_account_id> with your AWS account ID, <region> with your AWS region, <repository_name> with the name of your ECR repository, <tag> with the desired tag.
docker tag container-registry.oracle.com/database/express:latest <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<repository_name>:<tag>
7. Push the Oracle XE Image to ECR
docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<repository_name>:<tag>
8. Verify the Image in ECR
From AWS Management Console navigate to Elastic Container Registry (ECR), select your repository and verify that Oracle XE image has been successfully pushed

9. When you finish, EC2 instance can be terminated if no more needed.
10. Pull the Image from ECR
To pull the image from ECR to another machine or service
docker pull <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<repository_name>:<tag>
Happy clouding!