-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
multi-arch-docker-ci.sh
44 lines (37 loc) · 1.62 KB
/
multi-arch-docker-ci.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
38
39
40
41
42
43
44
#!/bin/bash
#------------------------------------------------------------------------
# Trakt.tv tools
#
# Copyright 2016-2021 xbgmsharp <[email protected]>. All Rights Reserved.
# License: GNU General Public License version 3 or later; see LICENSE.txt
# Website: https://trakt.tv, https://github.com/xbgmsharp/trakt
#------------------------------------------------------------------------
## Check ENV
if [[ -z "${DOCKER_USERNAME}" ]]; then
echo 'Missing DOCKER_USERNAME env'
exit 1
fi
if [[ -z "${DOCKER_PASSWORD}" ]]; then
echo 'Missing DOCKER_PASSWORD env'
exit 1
fi
## Instantiate docker buildx builder with multi-architecture support.
docker buildx create --name mybuilder
docker buildx use mybuilder
# Start up buildx and verify that all is OK.
docker buildx inspect --bootstrap
## Log in to Docker Hub for deployment.
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
## Run buildx build and push.
#docker buildx build -t docker-trakt-tools:latest --platform linux/amd64,linux/arm64,linux/arm/v7 .
#docker buildx build -t docker-trakt-tools:latest --platform linux/amd64 --load .
docker buildx build -t ${DOCKER_USERNAME}/docker-trakt-tools:latest --platform linux/amd64,linux/arm64,linux/arm/v7 --push .
## Inspect architecture versions for images
#docker buildx imagetools inspect docker-trakt-tools:latest
docker buildx imagetools inspect ${DOCKER_USERNAME}/docker-trakt-tools:latest
# Inspect architecture manually
#docker inspect --format "{{.Architecture}}" docker-trakt-tools
# Stop and prune and remove buildx builder
docker buildx stop mybuilder
docker buildx prune
docker buildx rm mybuilder