diff --git a/Dockerfile b/Dockerfile index d5f39a2..5c52168 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,9 @@ RUN apt-get update \ # s6 overlay 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 diff --git a/docker-compose.yaml b/docker-compose.yaml index 4a1c794..f4172fa 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,4 +9,4 @@ services: TARGETPLATFORM: 'linux/amd64' # TARGETPLATFORM: 'linux/arm64' # TARGETPLATFORM: 'linux/arm32/v7' - image: certbot:test + image: certbot_only:test diff --git a/scripts/buildx.sh b/scripts/buildx.sh index 1d3b72e..b3705b1 100755 --- a/scripts/buildx.sh +++ b/scripts/buildx.sh @@ -3,7 +3,8 @@ REGISTRY="ahgraber" TAG=${1:-"test"} -# clone/update keycloak container instructions +# define build context +# assumes run from project folder root DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # buildx @@ -13,7 +14,8 @@ docker buildx use "${BUILDX_NAME:-certbot}" docker buildx build \ -f Dockerfile \ -t ${REGISTRY}/certbot_only:${TAG} \ - --platform linux/amd64,linux/arm64 \ + --no-cache \ + --platform linux/amd64,linux/arm/v7,linux/arm64 \ --push \ . diff --git a/scripts/install-s6.sh b/scripts/install-s6.sh index a75388e..469dbf0 100644 --- a/scripts/install-s6.sh +++ b/scripts/install-s6.sh @@ -2,8 +2,10 @@ # Note: This script is designed to be run inside a Docker Build for a container -S6_OVERLAY_VERSION=1.22.1.0 + TARGETPLATFORM=$1 +# S6_OVERLAY_VERSION="v2.2.0.3" +S6_OVERLAY_VERSION="latest" # Determine the correct binary file for the architecture given case $TARGETPLATFORM in @@ -11,6 +13,10 @@ case $TARGETPLATFORM in S6_ARCH=aarch64 ;; + linux/aarch64) + S6_ARCH=aarch64 + ;; + linux/arm/v7) S6_ARCH=armhf ;; @@ -20,10 +26,11 @@ case $TARGETPLATFORM in ;; 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" \ - && tar xzf /tmp/s6-overlay-amd64.tar.gz -C / --exclude="./bin" && \ - tar xzf /tmp/s6-overlay-amd64.tar.gz -C /usr ./bin +# 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" \ +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-${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." \ No newline at end of file