Skip to main content

Push and pull docker images on Amazon ECR via aws client

Open cygwin terminal
$ cd /cygdrive/c/projects

$ docker-machine env default  && eval $("docker-machine.exe" env default)

Create new nodejs express web application with ejs
$ npm install -g express-generator
$ express --view=ejs ecrtest

For automaticly create Docker file install generator
$ npm install -g generator-docker
$ npm install -g yo
Run generator with yo
$ yo docker

Build docker image with 1.0 tag
$ docker build -t mycmp/ecrtest:1.0 .

Run docker image
$ docker run -p 3000:3000 mycmp/ecrtest:1.0

For image push ECR, we need to aws configure
$ aws configure
     AWS Access Key ID [****************EWAQ]: ************************
     AWS Secret Access Key [****************eYKe]: ************************
     Default region name [eu-west-1]:
     Default output format [None]:

Docker needs to be logged into the registry. The aws client can output the required docker command to login with.Paste the output to login.
$ aws ecr get-login
$ docker login -u AWS -p ************************ -e none https://000000000000.dkr.ecr.eu-west-1.amazonaws.com

Create new docker repository on ECR
$ aws ecr create-repository --repository-name my-project/ecr-test
   {
           "repository": {
           "registryId": "000000000000",
           "repositoryName": "my-project/ecr-test",
           "repositoryArn": "arn:aws:ecr:eu-west-1:000000000000:repository/my-project/ecr-test",
           "createdAt": 1505288294.0,
           "repositoryUri": "000000000000.dkr.ecr.eu-west-1.amazonaws.com/my-project/ecr-test"
     }
 }

First tag it with your ECR repository address
$ docker tag mycmp/ecrtest:1.0 000000000000.dkr.ecr.eu-west-1.amazonaws.com/my-project/ecr-test:1.0
Then push it:
$ docker push 000000000000.dkr.ecr.eu-west-1.amazonaws.com/my-project/ecr-test:1.0

Now launch new EC2 Ubuntu instance  and install docker client.
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce

After installatin aws command, login to ecr and pull docker images then run it:
$ aws ecr get-login --region eu-west-1 --no-include-email
$ sudo docker pull 000000000000.dkr.ecr.eu-west-1.amazonaws.com/my-project/ecr-test:1.0
$ sudo docker images
$ sudo docker run 000000000000.dkr.ecr.eu-west-1.amazonaws.com/my-project/ecr-test:1.0$

Comments

Popular posts from this blog

Offline AI Coding in VSCode: Continue + Ollama Complete Setup Guide

Want GitHub Copilot-level code assistance — but fully offline, air-gapped, and private? This guide walks you through setting up Continue (a VSCode extension) with Ollama (a local model runner) so you get chat, autocomplete, and inline editing powered entirely by models running on your own machine. No internet required at runtime. Table of Contents What Are Continue and Ollama? Prerequisites & Hardware Requirements Choosing the Right Models Step 1 — Installing Ollama & Pulling Models Step 2 — Installing Continue in VSCode (Offline) Step 3 — Configuring config.yaml Step 4 — Disabling Telemetry Step 5 — Usage & Shortcuts Troubleshooting What Are Continue and Ollama? Continue is an open-source VSCode (and JetBrains) extension that adds AI-powered coding features directly into your editor — think chat, inline edits, and tab autocomplete. By default it can connect to Claude, GPT-4, or any API. But it also supports local providers , which is exactly what we want here. Ollama i...

Local LLM on Ubuntu (CPU-Only): Ollama + Qwen Coder + Open WebUI + RAG Setup

Local LLM on Ubuntu (CPU-Only): Ollama + Qwen Coder + Open WebUI + RAG Run a private, high-performance internal AI coding assistant on your own hardware—no GPU required. Feb 13, 2026 Qwen 2.5 Coder RAG Enabled Enterprise Ready Keeping your code and documents on your own infrastructure is the gold standard for enterprise security. By combining Ollama , Qwen Coder , and Open WebUI , we can build a production-grade AI assistant that respects your privacy. Environment: CPU-only Ubuntu server (e.g., i9/Threadripper) with 64GB+ RAM for smooth 14B model inference. 1. System Preparation First, update your local environment and install necessary dependencies: sudo apt update && sudo apt upgrade -y sudo apt install -y curl git ca-certificates lscpu 2. Ollama & Model Tuning Install Ollama and optimize the configuration for CPU-only inference by setting the thread count: ...

Defining tomcat and mysql server Amazon EC2 instance

-- Create new amazon ec2 instance http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html -- Give permisson to pem file chmod 400 mycertificate.pem -- Connect to EC2 instance ssh -i mycertificate.pem ubuntu@ec2-51-51-51-51.eu-west-1.compute.amazonaws.com -- Installation Oracle Java 1.8 $ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz $ tar -xzvf jdk-8u92-linux-x64.tar.gz $ sudo mkdir -p /usr/java/ $ sudo mv jdk1.8.0_92/ /usr/java/ $ sudo vim  /etc/profile         JAVA_HOME=/usr/java/jdk1.8.0_92         PATH=$PATH:$HOME/bin:$JAVA_HOME/bin         JRE_HOME=/usr/java/jdk1.8.0_92/jre         PATH=$PATH:$HOME/bin:$JRE_HOME/bin         export JAVA_HOME...