Skip to content

Commit

Permalink
fix build 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhjkim committed Jul 16, 2024
1 parent b09daea commit 425a704
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.21.4-alpine3.18 AS build-env
FROM golang:1.22.5-alpine3.20 AS build-env

ARG DB_BACKEND=goleveldb
ARG ROCKSDB_VERSION="8.5.3"
ARG ROCKSDB_VERSION="9.2.1"

WORKDIR /go/src/github.com/evmos/evmos

COPY go.mod go.sum ./

RUN set -eux; apk add --no-cache ca-certificates=20240226-r0 build-base=0.5-r3 git=2.40.1-r0 linux-headers=6.3-r0 bash=5.2.15-r5
RUN set -eux; apk add --no-cache ca-certificates=20240226-r0 build-base=0.5-r3 git=2.45.2-r0 linux-headers=6.6-r0 bash=5.2.26-r0

RUN --mount=type=bind,target=. --mount=type=secret,id=GITHUB_TOKEN \
git config --global url."https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/".insteadOf "https://github.com/"; \
Expand All @@ -17,21 +17,19 @@ COPY . .

RUN mkdir -p /target/usr/lib /target/usr/local/lib /target/usr/include

RUN if [ "$DB_BACKEND" = "pebbledb" ]; then \
make build-pebbledb; \
elif [ "$DB_BACKEND" = "rocksdb" ]; then \
RUN if [ "$DB_BACKEND" = "rocksdb" ]; then \
make build-rocksdb; \
cp -r /usr/lib/* /target/usr/lib/ && \
cp -r /usr/local/lib/* /target/usr/local/lib/ && \
cp -r /usr/include/* /target/usr/include/; \
else \
# Build default binary (LevelDB)
make build; \
# Build default binary with corresponding db backend
COSMOS_BUILD_OPTIONS=$DB_BACKEND make build; \
fi

RUN go install github.com/MinseokOh/toml-cli@latest

FROM alpine:3.18
FROM alpine:3.20

WORKDIR /root

Expand All @@ -43,13 +41,14 @@ COPY --from=build-env /target/usr/lib /usr/lib
COPY --from=build-env /target/usr/local/lib /usr/local/lib
COPY --from=build-env /target/usr/include /usr/include

RUN apk add --no-cache ca-certificates=20240226-r0 jq=1.6-r4 curl=8.5.0-r0 bash=5.2.15-r5 vim=9.0.2073-r0 lz4=1.9.4-r4 rclone=1.62.2-r6 \
RUN apk add --no-cache ca-certificates=20240705-r0 jq=1.7.1-r0 curl=8.8.0-r0 bash=5.2.26-r0 vim=9.1.0414-r0 lz4=1.9.4-r5 rclone=1.66.0-r4 \
&& addgroup -g 1000 evmos \
&& adduser -S -h /home/evmos -D evmos -u 1000 -G evmos

USER 1000
WORKDIR /home/evmos

EXPOSE 26656 26657 1317 9090 8545 8546
HEALTHCHECK CMD curl --fail http://localhost:26657 || exit 1

CMD ["evmosd"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/evmos/evmos/v18

go 1.22
go 1.22.2

require (
cosmossdk.io/api v0.3.1
Expand Down

0 comments on commit 425a704

Please sign in to comment.