forked from antonputra/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·27 lines (20 loc) · 917 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·27 lines (20 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# Print the commands.
set -x
# Exit script on error.
set -e
# To run, execute: ./build.sh go-app v1
USERNAMR="${USERNAMR:-aputra}"
LESSON=$(basename $(pwd))
DOCKERFILE="${DOCKERFILE:-Dockerfile}"
APP_DIR="$1"
VER="$2"
DOCKERFILE="$3"
docker build -t quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-arm64:${VER} -f ${APP_DIR}/${DOCKERFILE} --platform linux/arm64 ${APP_DIR}
docker build -t quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-amd64:${VER} -f ${APP_DIR}/${DOCKERFILE} --platform linux/amd64 ${APP_DIR}
docker push quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-arm64:${VER}
docker push quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-amd64:${VER}
docker manifest create quay.io/${USERNAMR}/${APP_DIR}-${LESSON}:${VER} \
quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-arm64:${VER} \
quay.io/${USERNAMR}/${APP_DIR}-${LESSON}-amd64:${VER}
docker manifest push quay.io/${USERNAMR}/${APP_DIR}-${LESSON}:${VER}