-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* buildx looks great and multi-arch support is also desirable, but unfortunately, it was difficult for me to maintain, and I couldn't seem to harness help from others in the community * in order to support this project long-term, and without support from other members of the community, I need to trade-off features for simplicity and maintainability * I therefore decided to remove buildx / multi-arch suppor for now
- Loading branch information
1 parent
f5535dd
commit 40aa7d9
Showing
3 changed files
with
58 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,41 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
PLATFORM="linux/amd64" | ||
EXTRA_ARGUMENTS="" | ||
while true; do | ||
case "$1" in | ||
### Push requires authentication to minimalcompact docker hub | ||
-p | --push) | ||
EXTRA_ARGUMENTS="${EXTRA_ARGUMENTS} --push" | ||
shift | ||
;; | ||
-b | --branch) | ||
BRANCH="$2"; | ||
shift 2 | ||
;; | ||
### Images have issues building multi arch, so hold behind a feature flag | ||
-m | --multiarch) | ||
PLATFORM="${PLATFORM},linux/arm64" | ||
shift | ||
;; | ||
## Create should be run once, or in ci, if docker buildx ls doesnt contain supported platforms | ||
-c | --create) | ||
docker buildx create --use | ||
shift | ||
;; | ||
-e | --extra ) | ||
EXTRA_ARGUMENTS="${EXTRA_ARGUMENTS} $2" | ||
shift 2 | ||
;; | ||
* ) break ;; | ||
esac | ||
done | ||
|
||
THUMBOR_VERSION=$(cat thumbor/requirements.txt| grep thumbor== | cut -d= -f 3) | ||
|
||
docker buildx version | ||
echo "Branch: ${BRANCH} | Thumbor version: ${THUMBOR_VERSION} | Platform: ${PLATFORM} | Extra Arguments: ${EXTRA_ARGUMENTS}" | ||
echo "*******************************************************" | ||
|
||
echo "--> BUILDING minimalcompact/thumbor-nginx-proxy-cache" | ||
[ "$BRANCH" == "master" ] && EXTRA_TAG="--tag ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:latest" | ||
docker buildx build $EXTRA_ARGUMENTS --platform $PLATFORM -f nginx-proxy-cache/Dockerfile \ | ||
--tag ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:test \ | ||
--tag ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:$THUMBOR_VERSION \ | ||
$EXTRA_TAG \ | ||
nginx-proxy-cache/ | ||
|
||
echo "--> BUILDING minimalcompact/thumbor" | ||
[ "$BRANCH" == "master" ] && EXTRA_TAG="--tag ghcr.io/minimalcompact/thumbor:latest" | ||
docker buildx build $EXTRA_ARGUMENTS --platform $PLATFORM -f thumbor/Dockerfile \ | ||
--tag ghcr.io/minimalcompact/thumbor:test \ | ||
--tag ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION \ | ||
$EXTRA_TAG \ | ||
thumbor/ | ||
docker build --pull -f thumbor/Dockerfile -t minimalcompact/thumbor thumbor/ | ||
# introspecting version by running the built image | ||
THUMBOR_VERSION=`docker run --rm minimalcompact/thumbor bash -c "pip freeze |grep ^thumbor== | cut -d= -f 3"` | ||
echo "THUMBOR VERSION: $THUMBOR_VERSION" | ||
|
||
echo "--> TAGGING minimalcompact/thumbor:$THUMBOR_VERSION" | ||
docker tag minimalcompact/thumbor ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION | ||
echo "--> TAGGING minimalcompact/thumbor:latest" | ||
docker tag minimalcompact/thumbor ghcr.io/minimalcompact/thumbor:latest | ||
|
||
echo "--> BUILDING minimalcompact/thumbor:simd-sse4" | ||
[ "$BRANCH" == "master" ] && EXTRA_TAG="--tag ghcr.io/minimalcompact/thumbor:latest-simd-sse4t" | ||
## SSE doesnt support multi arch | ||
docker buildx build $EXTRA_ARGUMENTS --platform linux/amd64 --build-arg SIMD_LEVEL=sse4 -f thumbor/Dockerfile \ | ||
--tag ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-sse4 \ | ||
$EXTRA_TAG \ | ||
thumbor/ | ||
docker build --build-arg SIMD_LEVEL=sse4 -f thumbor/Dockerfile -t minimalcompact/thumbor-simd-sse4 thumbor/ | ||
echo "--> TAGGING minimalcompact/thumbor:$THUMBOR_VERSION-simd-sse4" | ||
docker tag minimalcompact/thumbor-simd-sse4 ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-sse4 | ||
echo "--> TAGGING minimalcompact/thumbor:latest-simd-sse4" | ||
docker tag minimalcompact/thumbor-simd-sse4 ghcr.io/minimalcompact/thumbor:latest-simd-sse4 | ||
|
||
echo "--> BUILDING minimalcompact/thumbor:simd-avx2" | ||
[ "$BRANCH" == "master" ] && EXTRA_TAG="--tag ghcr.io/minimalcompact/thumbor:latest-simd-avx2" | ||
## AVX2 Doesnt support multi arch | ||
docker buildx build $EXTRA_ARGUMENTS --platform linux/amd64 --build-arg SIMD_LEVEL=avx2 -f thumbor/Dockerfile \ | ||
--tag ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-avx2 \ | ||
$EXTRA_TAG \ | ||
thumbor/ | ||
docker build --build-arg SIMD_LEVEL=avx2 -f thumbor/Dockerfile -t minimalcompact/thumbor-simd-avx2 thumbor/ | ||
echo "--> TAGGING minimalcompact/thumbor:$THUMBOR_VERSION-simd-avx2" | ||
docker tag minimalcompact/thumbor-simd-avx2 ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-avx2 | ||
echo "--> TAGGING minimalcompact/thumbor:latest-simd-avx2" | ||
docker tag minimalcompact/thumbor-simd-avx2 ghcr.io/minimalcompact/thumbor:latest-simd-avx2 | ||
|
||
echo "--> BUILDING minimalcompact/remotecv" | ||
[ "$BRANCH" == "master" ] && EXTRA_TAG="--tag ghcr.io/minimalcompact/remotecv:latest" | ||
docker buildx build $EXTRA_ARGUMENTS --platform $PLATFORM --build-arg THUMBOR_TAG=$THUMBOR_VERSION -f remotecv/Dockerfile \ | ||
--tag ghcr.io/minimalcompact/remotecv:$THUMBOR_VERSION \ | ||
$EXTRA_TAG \ | ||
remotecv/ | ||
echo "--> BUILDING minimalcompact/thumbor-nginx-proxy-cache" | ||
docker build --pull -f nginx-proxy-cache/Dockerfile -t minimalcompact/thumbor-nginx-proxy-cache nginx-proxy-cache/ | ||
echo "--> TAGGING minimalcompact/thumbor-nginx-proxy-cache:$THUMBOR_VERSION" | ||
docker tag minimalcompact/thumbor-nginx-proxy-cache ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:$THUMBOR_VERSION | ||
echo "--> TAGGING minimalcompact/thumbor-nginx-proxy-cache:latest" | ||
docker tag minimalcompact/thumbor-nginx-proxy-cache ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:latest | ||
|
||
echo "*******************************************************" | ||
echo Docker images: | ||
docker image ls -a | ||
echo "--> BUILDING minimalcompact/remotecv" | ||
docker build --build-arg THUMBOR_TAG=latest -f remotecv/Dockerfile -t minimalcompact/remotecv remotecv/ | ||
echo "--> TAGGING minimalcompact/remotecv:$THUMBOR_VERSION" | ||
docker tag minimalcompact/remotecv ghcr.io/minimalcompact/remotecv:$THUMBOR_VERSION | ||
echo "--> TAGGING minimalcompact/remotecv:latest" | ||
docker tag minimalcompact/remotecv ghcr.io/minimalcompact/remotecv:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# introspecting version by running the built image | ||
THUMBOR_VERSION=`docker run --rm minimalcompact/thumbor bash -c "pip freeze |grep ^thumbor== | cut -d= -f 3"` | ||
echo "THUMBOR VERSION: $THUMBOR_VERSION" | ||
|
||
echo "--> pushing minimalcompact/thumbor:simdsse4" | ||
docker push ghcr.io/minimalcompact/thumbor:latest-simd-sse4 | ||
docker push ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-sse4 | ||
|
||
echo "--> pushing minimalcompact/thumbor:simdavx2" | ||
docker push ghcr.io/minimalcompact/thumbor:latest-simd-avx2 | ||
docker push ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION-simd-avx2 | ||
|
||
echo "--> pushing minimalcompact/thumbor-nginx-proxy-cache" | ||
docker push ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:latest | ||
docker push ghcr.io/minimalcompact/thumbor-nginx-proxy-cache:$THUMBOR_VERSION | ||
|
||
echo "--> pushing minimalcompact/remotecv" | ||
docker push ghcr.io/minimalcompact/remotecv:latest | ||
docker push ghcr.io/minimalcompact/remotecv:$THUMBOR_VERSION | ||
|
||
echo "--> pushing minimalcompact/thumbor" | ||
docker push ghcr.io/minimalcompact/thumbor:latest | ||
docker push ghcr.io/minimalcompact/thumbor:$THUMBOR_VERSION |