Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Container Fails to Start After Setup #343

Closed
emochka2007 opened this issue Nov 19, 2024 · 0 comments
Closed

Docker Container Fails to Start After Setup #343

emochka2007 opened this issue Nov 19, 2024 · 0 comments

Comments

@emochka2007
Copy link

emochka2007 commented Nov 19, 2024

Recently, I've encountered an issue where my Docker container fails immediately after setup. The container does not stay up and exits right after initialization.
Screenshot 2024-11-19 at 12 54 46
Screenshot 2024-11-19 at 12 55 06

FROM golang:1.20-alpine AS go-builder
#ARG arch=x86_64

# See https://github.com/CosmWasm/wasmvm/releases -> pick latest stable release
ENV LIBWASMVM_VERSION=v1.5.5

# 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
RUN set -eux; apk add --no-cache ca-certificates build-base;

RUN apk add curl --no-cache wget git cmake libusb-dev linux-headers tar gzip
# NOTE: add these to run with LEDGER_ENABLED=true
# RUN apk add libusb-dev linux-headers

WORKDIR /code

RUN curl -L https://github.com/phoenix-directive/core/archive/refs/tags/v2.12.5.tar.gz -o ./terrad.tar.gz
RUN tar -xzf terrad.tar.gz && rm -f terrad.tar.gz
RUN mv */* /code/

RUN curl -L https://snapshots.polkachu.com/genesis/terra/genesis.json -o genesis.json
RUN curl -L https://snapshots.polkachu.com/addrbook/terra/addrbook.json -o addrbook.json

# Install mimalloc
RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install
ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASMVM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
#RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc
#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

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LDFLAGS="-linkmode=external -extldflags \"-L/code/mimalloc/build -lmimalloc -Wl,-z,muldefs -static\"" make build

FROM alpine:3.15.4

RUN addgroup terra \
    && adduser -G terra -D -h /terra terra

WORKDIR /terra

COPY --from=go-builder /code/build/terrad /usr/local/bin/terrad
COPY --from=go-builder /code/genesis.json /root/.terra/config/genesis.json
COPY --from=go-builder /code/addrbook.json /root/.terra/config/addrbook.json

USER 0

# rest server
EXPOSE 1317
# grpc
EXPOSE 9090
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657


ENTRYPOINT ["terrad"]
@emochka2007 emochka2007 changed the title Node.js Docker Container Fails to Start After Setup Docker Container Fails to Start After Setup Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant