-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-push-linux-arm64
executable file
·46 lines (38 loc) · 1.23 KB
/
build-push-linux-arm64
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
38
39
40
41
42
43
44
45
46
#! /usr/bin/env sh
#
# Rode em uma máquina arm64v8 (por exemplo apple m1 / m2)
#
NEGRITO=''
ESMAECIDO=''
RESET=''
VERMELHO_NEGRITO=''
if [ -t 1 ]; then
NEGRITO='\033[1m'
ESMAECIDO='\033[0;2m'
RESET='\033[0m'
VERMELHO_NEGRITO='\033[1;31m'
fi
VERSION=${1}
if [ -z "${VERSION}" ]; then
echo ""
echo "${VERMELHO_NEGRITO}Faltou passar a versão da imagem como argumento${RESET}"
echo ""
echo "${ESMAECIDO}É para usar assim oh:${RESET}"
echo ""
echo " ${ESMAECIDO}./build-push-linux-amd64${RESET} ${NEGRITO}0.2.5${NEGRITO}"
echo ""
exit 1
fi
docker --context=default buildx build \
-t "ghcr.io/rwillians/rinha-de-backend--elixir-plug-bandit-ecto:${VERSION}-arm64v8" \
--label "org.opencontainers.image.source=http://github.com/rwillians/rinha-de-backend--elixir-plug-bandit-ecto" \
--builder default \
--platform linux/arm64/v8 \
--push .
# opcional: para que a imagem rode em dispositivos como raspberry pi
docker --context=default buildx build \
-t "ghcr.io/rwillians/rinha-de-backend--elixir-plug-bandit-ecto:${VERSION}-arm64v7" \
--label "org.opencontainers.image.source=http://github.com/rwillians/rinha-de-backend--elixir-plug-bandit-ecto" \
--builder default \
--platform linux/arm64/v7 \
--push .