Skip to content

Commit

Permalink
add option to modify alpine version
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnuj committed Jan 5, 2024
1 parent 24c8963 commit 84de279
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions builds/chihuahua.6.alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand All @@ -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}" \
Expand Down

0 comments on commit 84de279

Please sign in to comment.