-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d20bb9d
commit a2150b0
Showing
6 changed files
with
81 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,28 @@ | ||
FROM golang:1.22 AS builder | ||
|
||
COPY . /src | ||
ARG GOPROXY | ||
|
||
WORKDIR /src | ||
COPY go.mod go.sum /src/ | ||
RUN --mount=type=secret,id=git_config,target=/root/.gitconfig \ | ||
--mount=type=secret,id=git_credentials,target=/root/.config/git/credentials \ | ||
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \ | ||
go mod download -x | ||
|
||
COPY . /src | ||
|
||
RUN --mount=type=secret,id=git_config,target=/root/.gitconfig \ | ||
--mount=type=secret,id=git_credentials,target=/root/.config/git/credentials \ | ||
--mount=type=secret,id=gh_hosts,target=/root/.config/gh/hosts.yml \ | ||
make build | ||
|
||
FROM debian:stable-slim | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
jq \ | ||
git \ | ||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
python3 \ | ||
python3-pip \ | ||
netbase \ | ||
netcat-traditional \ | ||
&& rm -rf /var/lib/apt/lists/ \ | ||
&& apt-get autoremove -y && apt-get autoclean -y | ||
|
||
RUN pip install apprise --break-system-packages | ||
|
||
RUN curl -L https://foundry.paradigm.xyz | /bin/bash && /root/.foundry/bin/foundryup | ||
|
||
ENV PATH=/root/.foundry/bin:$PATH | ||
|
||
COPY --from=builder /src/bin /app | ||
|
||
WORKDIR /app | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
EXPOSE 8000 | ||
EXPOSE 9000 | ||
VOLUME /data/conf | ||
COPY --from=builder /src/bin /usr/local/bin | ||
|
||
CMD ["/app/apiserver"] | ||
CMD ["/usr/local/bin/arbctl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package commands | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
var app = cli.NewApp() | ||
|
||
func init() { | ||
app.Name = "arbctl" | ||
app.Usage = "Cli tool to interact with the Arbitrum chain" | ||
app.Commands = []cli.Command{} | ||
} | ||
|
||
func Run(args ...string) error { | ||
if len(args) == 0 { | ||
args = os.Args | ||
} | ||
return app.Run(args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/renlulu/arbitrum-orbit-sdk-go/cmd/arbctl/commands" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
func main() { | ||
err := commands.Run() | ||
if err != nil { | ||
_, _ = os.Stderr.WriteString(err.Error() + "\n") | ||
exitCode := 1 | ||
if exitCoder, ok := err.(cli.ExitCoder); ok { | ||
exitCode = exitCoder.ExitCode() | ||
} | ||
os.Exit(exitCode) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters