-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
37 lines (29 loc) · 903 Bytes
/
build.sh
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
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -e
REGISTRY_HOST="ghcr.io"
REGISTRY_USER="smashedr"
REGISTRY_REPO="docker-nginx-static"
if [ -f ".env" ];then
echo "Sourcing Environment: .env"
source ".env"
fi
if [ -z "${VERSION}" ];then
if [ -z "${1}" ];then
read -rp "Version: " VERSION
else
VERSION="${1}"
fi
fi
#if [ -z "${USERNAME}" ];then
# read -rp "Username: " USERNAME
#fi
#if [ -z "${PASSWORD}" ];then
# read -rp "Password: " PASSWORD
#fi
echo "${REGISTRY_HOST}/${REGISTRY_USER}/${REGISTRY_REPO}:${VERSION}"
#docker login --username "${USERNAME}" --password "${PASSWORD}" "${REGISTRY_HOST}"
docker login "${REGISTRY_HOST}"
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 --push \
-t "${REGISTRY_HOST}/${REGISTRY_USER}/${REGISTRY_REPO}:${VERSION}" nginx
#docker push "${REGISTRY_HOST}/${REGISTRY_USER}/${REGISTRY_REPO}:${VERSION}"