Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Ixo committed Nov 28, 2024
2 parents 2bdbc33 + cbfe5c2 commit 1b84e7b
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
# echo $(git describe --tags) | sed 's/^v//'

ARG GO_VERSION="1.22"
# ARG RUNNER_IMAGE="ubuntu:latest"
ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"
ARG RUNNER_IMAGE="ubuntu:latest"
# ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"
ARG BUILD_TAGS="netgo,ledger,muslc"

# --------------------------------------------------------
# Builder
# --------------------------------------------------------

FROM golang:${GO_VERSION}-alpine3.18 AS builder
FROM golang:${GO_VERSION}-alpine3.20 AS builder

# TODO: maybe extract below args to where called in cicd?
# git log -1 --format='%H'
ARG GIT_VERSION="4.0.0-rc.0"
ARG GIT_COMMIT="ca9e64cf2f8c29b8bb001281abcdcb942dc9fa01"
ARG GIT_VERSION="v4.0.0"
ARG GIT_COMMIT="cbfe5c259cad5b192e6b6353879e80b1e8f2abd8"

RUN apk add --no-cache \
ca-certificates \
build-base \
linux-headers \
binutils-gold
ENV PACKAGES="ca-certificates build-base binutils-gold curl make git libc-dev bash file gcc linux-headers eudev-dev"
RUN apk add --no-cache $PACKAGES

# Download go dependencies
WORKDIR /ixo
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download
RUN go mod download

# RUN ARCH=$(uname -m)
# Cosmwasm - Download correct libwasmvm version
Expand All @@ -40,17 +35,15 @@ RUN ARCH=x86_64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed
COPY . .

# Build ixod binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
RUN GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="ixo" \
-X github.com/cosmos/cosmos-sdk/version.AppName="ixod" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs --static -lm'" \
-trimpath \
-o /ixo/build/ixod \
Expand Down

0 comments on commit 1b84e7b

Please sign in to comment.