From 84de279c13fdb0535b4a53e67fcf8370164630be Mon Sep 17 00:00:00 2001 From: gregnuj Date: Fri, 5 Jan 2024 05:52:12 -0600 Subject: [PATCH] add option to modify alpine version --- .github/workflows/docker-build.yml | 5 +++++ alpine.Dockerfile | 6 +++--- builds/chihuahua.6.alpine.sh | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 75f5046..d800c8f 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -69,6 +69,10 @@ on: description: "Linux distribution" required: true type: string + distro_version: + description: "Linux distribution version" + required: false + type: string platform: description: "Platform" required: true @@ -168,6 +172,7 @@ jobs: COSMOS_BUILD_OPTIONS=${{ inputs.cosmos_build_options }} CHECK_STATICALLY=${{ inputs.check_statically }} DENOM=${{ inputs.denom }} + DISTRO_VERSION=${{ inputs.distro_version }} GIT_TAG=${{ env.REPO_TAG }} GIT_REPO=${{ inputs.repo }} GO_VERSION=${{ inputs.go_version }} diff --git a/alpine.Dockerfile b/alpine.Dockerfile index f1ebfc4..1550772 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -1,8 +1,8 @@ ARG GO_VERSION="1.20" -ARG ALPINE_VERSION="3.18" +ARG DISTRO_VERSION="3.19" ################################################################################ -FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as base +FROM golang:${GO_VERSION}-alpine${DISTRO_VERSION} as base # NOTE: add libusb-dev to run with LEDGER_ENABLED=true RUN set -eu && \ @@ -94,7 +94,7 @@ RUN set -x && \ fi ################################################################################ -FROM --platform=${BUILDPLATFORM} alpine:latest as prod +FROM --platform=${BUILDPLATFORM} alpine:${DISTRO_VERSION} as prod # build args passed down to env var diff --git a/builds/chihuahua.6.alpine.sh b/builds/chihuahua.6.alpine.sh index c62ef3e..07da4c4 100755 --- a/builds/chihuahua.6.alpine.sh +++ b/builds/chihuahua.6.alpine.sh @@ -2,14 +2,15 @@ BASEDIR=$(dirname "$0") DOCKER_DIR="${BASEDIR}/.." -IMAGE="alpine" +DISTRO="alpine" NAME="chihuahua" REPO="ChihuahuaChain/chihuahua" TAG="6" GO_VERSION="1.20" +DISTRO_VERSION="3.18" cd "${DOCKER_DIR}" -docker buildx build "." -f "${IMAGE}.Dockerfile" \ +docker buildx build "." -f "${DISTRO}.Dockerfile" \ --load \ --progress plain \ --tag "terraformlabs/${NAME}:${TAG}" \ @@ -21,6 +22,7 @@ docker buildx build "." -f "${IMAGE}.Dockerfile" \ --build-arg "BUILD_COMMAND=make install" \ --build-arg "BUILD_TAGS=netgo ledger muslc" \ --build-arg "COSMOS_BUILD_OPTIONS=" \ + --build-arg "DISTRO_VERSION=${DISTRO_VERSION}" \ --build-arg "GIT_TAG=v${TAG}" \ --build-arg "GIT_REPO=${REPO}" \ --build-arg "GO_VERSION=${GO_VERSION}" \