From 95bf842b594ffa37c7a87fe24bfb802614cbd1f5 Mon Sep 17 00:00:00 2001 From: ShafathZ <53407653+ShafathZ@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:54:25 -0400 Subject: [PATCH] useful commands written plus modification for docker to work cross-platform building --- ops/aws/useful-commands.md | 63 +++++++++++++++++++++++++++++++++++ ops/docker/useful-commands.md | 6 ++-- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 ops/aws/useful-commands.md diff --git a/ops/aws/useful-commands.md b/ops/aws/useful-commands.md new file mode 100644 index 0000000..1292172 --- /dev/null +++ b/ops/aws/useful-commands.md @@ -0,0 +1,63 @@ +# Useful Commands for AWS (ECR) + +## Install AWS CLI + +Download AWS CLI based on your OS:\ +https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html + +## Configure / Login to AWS + +``` bash +aws login +``` + +You'll be prompted for: - AWS Access Key ID\ +- AWS Secret Access Key\ +- Region (e.g. us-east-2)\ +- Output format (json) + +## Authenticate Docker to AWS ECR + +``` bash +aws ecr get-login-password --region us-east-2 \ +| docker login \ +--username AWS \ +--password-stdin .dkr.ecr..amazonaws.com +``` + +Example: + +``` bash +aws ecr get-login-password --region us-east-2 \ +| docker login \ +--username AWS \ +--password-stdin .dkr.ecr.us-east-2.amazonaws.com +``` + +## Docker Commands + +### Tagging Images + +``` bash +docker tag \ +.dkr.ecr..amazonaws.com/: +``` + +Example: + +``` bash +docker tag surigo/anizenith:latest \ +.dkr.ecr.us-east-2.amazonaws.com/anizenith-repo:latest +``` + +### Pushing Images + +``` bash +docker push +``` + +Example: + +``` bash +docker push .dkr.ecr.us-east-2.amazonaws.com/anizenith-repo:latest +``` diff --git a/ops/docker/useful-commands.md b/ops/docker/useful-commands.md index ddff91c..6d7f27e 100644 --- a/ops/docker/useful-commands.md +++ b/ops/docker/useful-commands.md @@ -2,17 +2,17 @@ ## Commands for building docker images ### Building backend image ```bash -docker build -t surigo/anizenith_backend:latest -f ./backend/Dockerfile --progress=plain --no-cache . +docker buildx build --platform linux/amd64 -t surigo/anizenith_backend:latest -f ./backend/Dockerfile --progress=plain --no-cache . ``` ### Building frontend image ```bash -docker build -t surigo/anizenith_frontend:latest -f ./frontend/Dockerfile --progress=plain --no-cache . +docker buildx build --platform linux/amd64 -t surigo/anizenith_frontend:latest -f ./frontend/Dockerfile --progress=plain --no-cache . ``` ### Building integrated image (backend + frontend) ```bash -docker build -t surigo/anizenith:latest -f ./Dockerfile --progress=plain --no-cache . +docker buildx build --platform linux/amd64 -t surigo/anizenith:latest -f ./Dockerfile --progress=plain --no-cache . ``` ## Commands for pushing docker images to dockerhub