sonr/Dockerfile
Prad Nukala 807b2e86ec
feature/1220 origin handle exists method (#1241)
* feat: add docs and CI workflow for publishing to onsonr.dev

* (refactor): Move hway,motr executables to their own repos

* feat: simplify devnet and testnet configurations

* refactor: update import path for didcrypto package

* docs(networks): Add README with project overview, architecture, and community links

* refactor: Move network configurations to deploy directory

* build: update golang version to 1.23

* refactor: move logger interface to appropriate package

* refactor: Move devnet configuration to networks/devnet

* chore: improve release process with date variable

* (chore): Move Crypto Library

* refactor: improve code structure and readability in DID module

* feat: integrate Trunk CI checks

* ci: optimize CI workflow by removing redundant build jobs

---------

Co-authored-by: Darp Alakun <i@prad.nu>
2025-01-06 17:06:10 +00:00

55 lines
1.5 KiB
Docker

FROM golang:1.23-alpine AS go-builder
SHELL ["/bin/sh", "-ecuxo", "pipefail"]
RUN apk add --no-cache ca-certificates build-base git
WORKDIR /code
COPY go.mod go.sum ./
RUN set -eux; \
export ARCH=$(uname -m); \
WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true); \
if [ ! -z "${WASM_VERSION}" ]; then \
WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}');\
WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}');\
wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
fi; \
go mod download;
# Copy over code
COPY . /code
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/sonrd
# then ensure static linking
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
&& file /code/build/sonrd \
&& echo "Ensuring binary is statically linked ..." \
&& (file /code/build/sonrd | grep "statically linked")
# --------------------------------------------------------
FROM debian:11-slim
LABEL org.opencontainers.image.source https://github.com/onsonr/sonr
COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd
# Install dependencies for Debian 11
RUN apt-get update && apt-get install -y \
curl \
make \
bash \
jq \
sed \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/test_node.sh /usr/bin/test_node.sh
WORKDIR /opt
# rest server, tendermint p2p, tendermint rpc
EXPOSE 1317 26656 26657 6060
ENTRYPOINT ["/usr/bin/sonrd"]