Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
FROM golang:alpine3.13 AS build-env
FROM golang:1.20-alpine AS build-env

# Set up dependencies
ENV PACKAGES bash curl make git libc-dev gcc linux-headers eudev-dev python3
ENV PACKAGES make gcc libc-dev linux-headers bash curl git

WORKDIR /rizon

COPY go.mod .
COPY go.sum .

COPY . .

RUN apk add --no-cache $PACKAGES && make install
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a

FROM alpine:edge
RUN apk add --no-cache $PACKAGES && \
BUILD_TAGS=muslc LINK_STATICALLY=true make install && \
rm -rf /var/cache/apk/*

RUN apk add --update ca-certificates
FROM alpine:edge

WORKDIR /rizon

COPY --from=build-env /go/bin/rizond /usr/bin/rizond

CMD ["rizond"]
CMD ["rizond"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=rizon \
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

.PHONY: install protocgen update-swagger-docs
Expand Down