Skip to content

Commit

Permalink
docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
hard-nett committed Mar 8, 2024
1 parent cf1aa3d commit b69fac5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# docker build . -t terpnetwork/terpd:latest
# docker run --rm -it terpnetwork/terpd:latest /bin/sh
FROM golang:1.19-alpine3.15 AS go-builder
ARG GO_VERSION="1.21"
ARG RUNNER_IMAGE="gcr.io/distroless/static"

FROM golang:${GO_VERSION}-alpine as builder
ARG arch=x86_64

# this comes from standard alpine nightly file
Expand All @@ -16,10 +19,13 @@ WORKDIR /code
COPY . /code/
# See https://github.com/CosmWasm/wasmvm/releases

ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63
# Cosmwasm - Download correct libwasmvm version
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
Expand All @@ -30,7 +36,8 @@ RUN echo "Ensuring binary is statically linked ..." \
&& (file /code/build/terpd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.15

FROM ${RUNNER_IMAGE}

COPY --from=go-builder /code/build/terpd /usr/bin/terpd

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ require (

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 => github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// See: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down
Loading

0 comments on commit b69fac5

Please sign in to comment.