buildx tweaks

This commit is contained in:
ahgraber 2021-02-17 20:30:40 -05:00
parent 200266120b
commit c08157e213
4 changed files with 20 additions and 9 deletions

View File

@ -31,7 +31,9 @@ RUN apt-get update \
# s6 overlay # s6 overlay
COPY ./scripts/install-s6.sh /tmp/install-s6.sh COPY ./scripts/install-s6.sh /tmp/install-s6.sh
RUN chmod +x /tmp/install-s6.sh && /tmp/install-s6.sh "${TARGETPLATFORM}" && rm -f /tmp/install-s6 RUN chmod +x /tmp/install-s6.sh \
&& /tmp/install-s6.sh "${TARGETPLATFORM}" \
&& rm -f /tmp/install-s6
EXPOSE 80 443 EXPOSE 80 443

View File

@ -9,4 +9,4 @@ services:
TARGETPLATFORM: 'linux/amd64' TARGETPLATFORM: 'linux/amd64'
# TARGETPLATFORM: 'linux/arm64' # TARGETPLATFORM: 'linux/arm64'
# TARGETPLATFORM: 'linux/arm32/v7' # TARGETPLATFORM: 'linux/arm32/v7'
image: certbot:test image: certbot_only:test

View File

@ -3,7 +3,8 @@
REGISTRY="ahgraber" REGISTRY="ahgraber"
TAG=${1:-"test"} TAG=${1:-"test"}
# clone/update keycloak container instructions # define build context
# assumes run from project folder root
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# buildx # buildx
@ -13,7 +14,8 @@ docker buildx use "${BUILDX_NAME:-certbot}"
docker buildx build \ docker buildx build \
-f Dockerfile \ -f Dockerfile \
-t ${REGISTRY}/certbot_only:${TAG} \ -t ${REGISTRY}/certbot_only:${TAG} \
--platform linux/amd64,linux/arm64 \ --no-cache \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--push \ --push \
. .

View File

@ -2,8 +2,10 @@
# Note: This script is designed to be run inside a Docker Build for a container # Note: This script is designed to be run inside a Docker Build for a container
S6_OVERLAY_VERSION=1.22.1.0
TARGETPLATFORM=$1 TARGETPLATFORM=$1
# S6_OVERLAY_VERSION="v2.2.0.3"
S6_OVERLAY_VERSION="latest"
# Determine the correct binary file for the architecture given # Determine the correct binary file for the architecture given
case $TARGETPLATFORM in case $TARGETPLATFORM in
@ -11,6 +13,10 @@ case $TARGETPLATFORM in
S6_ARCH=aarch64 S6_ARCH=aarch64
;; ;;
linux/aarch64)
S6_ARCH=aarch64
;;
linux/arm/v7) linux/arm/v7)
S6_ARCH=armhf S6_ARCH=armhf
;; ;;
@ -20,10 +26,11 @@ case $TARGETPLATFORM in
;; ;;
esac esac
echo -e "Installing S6-overlay v${S6_OVERLAY_VERSION} for ${TARGETPLATFORM} (${S6_ARCH})" echo -e "Installing S6-overlay ${S6_OVERLAY_VERSION} for ${TARGETPLATFORM} (${S6_ARCH})"
curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz" \ # curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.gz" \
&& tar xzf /tmp/s6-overlay-amd64.tar.gz -C / --exclude="./bin" && \ curl -L -o "/tmp/s6-overlay-${S6_ARCH}.tar.gz" "https://github.com/just-containers/s6-overlay/releases/latest/s6-overlay-${S6_ARCH}.tar.gz" \
tar xzf /tmp/s6-overlay-amd64.tar.gz -C /usr ./bin && tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" \
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin
echo -e "S6-overlay install complete." echo -e "S6-overlay install complete."