Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Add build instructions for armv8 image
Browse files Browse the repository at this point in the history
  • Loading branch information
thought-tobi committed Mar 27, 2024
1 parent c10eeca commit ff9b0af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,12 @@ jobs:
run: |
./scripts/docker-util.sh build
./scripts/docker-util.sh push
- name: Build docker image for armv8
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
run: |
./scripts/docker-util.sh build_arm
./scripts/docker-util.sh push_arm
18 changes: 18 additions & 0 deletions scripts/docker-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ function build() {
docker build -t mood-tracker:latest .
}

# using this for my raspberry pi
function build_arm() {
mkdir -p package
poetry export -f requirements.txt -o package/requirements.txt --without-hashes
docker build -t mood-tracker:arm64v8 --platform arm64v8 .
docker tag mood-tracker:arm64v8 "public.ecr.aws/c1o1h8f4/mood-tracker:latest-arm64v8"
docker tag mood-tracker:arm64v8 "public.ecr.aws/c1o1h8f4/mood-tracker:${commit_sha}-arm64v8"
}

function push_arm() {
commit_sha=$(git rev-parse --short HEAD)
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/c1o1h8f4
docker tag mood-tracker:arm64v8 "public.ecr.aws/c1o1h8f4/mood-tracker:latest-arm64v8"
docker tag mood-tracker:arm64v8 "public.ecr.aws/c1o1h8f4/mood-tracker:${commit_sha}-arm64v8"
docker push public.ecr.aws/c1o1h8f4/mood-tracker:latest-arm64v8
docker push "public.ecr.aws/c1o1h8f4/mood-tracker:${commit_sha}-arm64v8"
}

function push() {
commit_sha=$(git rev-parse --short HEAD)
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/c1o1h8f4
Expand Down

0 comments on commit ff9b0af

Please sign in to comment.