From 97a626cd2f9f7a098c8ff99f0c99e5bade90d1ce Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Wed, 24 Aug 2022 20:31:16 +0700 Subject: [PATCH] Update go.mod (#272) * Update go.mod Bump back down to go 1.18 * Also downgrade docker build to go 1.18 * Inline ignore Dockerfile linter rules that we don't care about * Use alpine pipefail incantation * Appease hadolint * Correct git version * Untag git version Co-authored-by: Alex Lynham --- Dockerfile | 17 ++++++++++++----- go.mod | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index fced4e03c..0b3241443 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ # docker build . -t cosmoscontracts/juno:latest # docker run --rm -it cosmoscontracts/juno:latest /bin/sh -FROM golang:1.19-alpine3.15 AS go-builder +FROM golang:1.18-alpine3.15 AS go-builder # this comes from standard alpine nightly file # https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile # with some changes to support our toolchain, etc +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] +# we probably want to default to latest and error +# since this is predominantly for dev use +# hadolint ignore=DL3018 RUN set -eux; apk add --no-cache ca-certificates build-base; +# hadolint ignore=DL3018 RUN apk add git # NOTE: add these to run with LEDGER_ENABLED=true # RUN apk add libusb-dev linux-headers @@ -21,12 +26,14 @@ RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce9 RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 # Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` -RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a +RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a # force it to use static lib (from above) not standard libgo_cosmwasm.so file -RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build -RUN file /code/bin/junod -RUN echo "Ensuring binary is statically linked ..." \ +# then log output of file /code/bin/junod +# then ensure static linking +RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \ + && file /code/bin/junod \ + && echo "Ensuring binary is statically linked ..." \ && (file /code/bin/junod | grep "statically linked") # -------------------------------------------------------- diff --git a/go.mod b/go.mod index 3c3c81535..a1b2a74bf 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/CosmosContracts/juno/v10 -go 1.19 +go 1.18 require ( github.com/CosmWasm/wasmd v0.28.0