Skip to content

Commit

Permalink
chore: fixup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Jul 31, 2024
1 parent 2bbc722 commit a2a0d19
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/portal-loop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: portal-loop

on:
pull_request: {}
pull_request:
branches:
- master
push:
paths:
- "misc/loop/**"
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
- name: "Buid new gnolang/gno image"
run: |
docker build -t ghcr.io/gnolang/gno -f Dockerfile.gnoland.release .
docker build -t ghcr.io/gnolang/gno/gnoland -f Dockerfile --target gnoland .
- name: "Wait for new docker image"
run: |
Expand Down
58 changes: 58 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# build gno
FROM golang:1.22-alpine AS build-gno
RUN go env -w GOMODCACHE=/root/.cache/go-build
WORKDIR /gnoroot
ENV GNOROOT="/gnoroot"
COPY . ./
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnoland ./gno.land/cmd/gnoland
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnokey ./gno.land/cmd/gnokey
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gnoweb ./gno.land/cmd/gnoweb
RUN --mount=type=cache,target=/root/.cache/go-build go build -o ./build/gno ./gnovm/cmd/gno

# Base image
FROM alpine:3.17 AS base
WORKDIR /gnoroot
ENV GNOROOT="/gnoroot"
RUN apk add ca-certificates
CMD [ "" ]

# alpine images
# gnoland
FROM base AS gnoland
COPY --from=build-gno /gnoroot/build/gnoland /usr/bin/gnoland
COPY --from=build-gno /gnoroot/examples /gnoroot/examples
COPY --from=build-gno /gnoroot/gnovm/stdlibs /gnoroot/gnovm/stdlibs
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
EXPOSE 26656 26657
ENTRYPOINT ["/usr/bin/gnoland"]

# gnokey
FROM base AS gnokey
COPY --from=build-gno /gnoroot/build/gnokey /usr/bin/gnokey
# gofmt is required by `gnokey maketx addpkg`
COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin/gofmt
ENTRYPOINT ["/usr/bin/gnokey"]

# gno
FROM base AS gno
COPY --from=build-gno /gnoroot/build/gno /usr/bin/gno
ENTRYPOINT ["/usr/bin/gno"]

# gnoweb
FROM base AS gnoweb
COPY --from=build-gno /gnoroot/build/gnoweb /usr/bin/gnoweb
COPY --from=build-gno /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb
EXPOSE 8888
ENTRYPOINT ["/usr/bin/gnoweb"]

# all, contains everything.
FROM base AS all
COPY --from=build-gno /gnoroot/build/* /usr/bin/
COPY --from=build-gno /gnoroot/examples /gnoroot/examples
COPY --from=build-gno /gnoroot/gnovm/stdlibs /gnoroot/gnovm/stdlibs
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs.jsonl
COPY --from=build-gno /gnoroot/gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt
# gofmt is required by `gnokey maketx addpkg`
COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin

0 comments on commit a2a0d19

Please sign in to comment.