Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
972d50e7
Unverified
Commit
972d50e7
authored
Oct 18, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ops: cleanup and optimize ci-builder Dockerfile
parent
5e2f7b2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
28 deletions
+39
-28
Dockerfile
ops/docker/ci-builder/Dockerfile
+39
-28
No files found.
ops/docker/ci-builder/Dockerfile
View file @
972d50e7
...
@@ -31,7 +31,18 @@ RUN source $HOME/.profile && \
...
@@ -31,7 +31,18 @@ RUN source $HOME/.profile && \
FROM
--platform=linux/amd64 ghcr.io/crytic/echidna/echidna:v2.0.4 as echidna-test
FROM
--platform=linux/amd64 ghcr.io/crytic/echidna/echidna:v2.0.4 as echidna-test
FROM
--platform=linux/amd64 golang:1.21-bullseye as go-build
FROM
--platform=linux/amd64 debian:bullseye-slim as go-build
RUN
apt-get update
&&
apt-get
install
-y
curl ca-certificates
ENV
GO_VERSION=1.21.1
# Fetch go manually, rather than using a Go base image, so we can copy the installation into the final stage
RUN
curl
-sL
https://go.dev/dl/go
$GO_VERSION
.linux-amd64.tar.gz
-o
go
$GO_VERSION
.linux-amd64.tar.gz
&&
\
tar
-C
/usr/local/
-xzvf
go1.21.1.linux-amd64.tar.gz
ENV
GOPATH=/go
ENV
PATH=/usr/local/go/bin:$GOPATH/bin:$PATH
# Install the specific version of abigen from .abigenrc
# Install the specific version of abigen from .abigenrc
COPY
./.abigenrc ./.abigenrc
COPY
./.abigenrc ./.abigenrc
...
@@ -40,12 +51,22 @@ RUN go install github.com/ethereum/go-ethereum/cmd/abigen@$(cat .abigenrc)
...
@@ -40,12 +51,22 @@ RUN go install github.com/ethereum/go-ethereum/cmd/abigen@$(cat .abigenrc)
COPY
./.gethrc ./.gethrc
COPY
./.gethrc ./.gethrc
RUN
go
install
github.com/ethereum/go-ethereum/cmd/geth@
$(
cat
.gethrc
)
RUN
go
install
github.com/ethereum/go-ethereum/cmd/geth@
$(
cat
.gethrc
)
RUN
go
install
gotest.tools/gotestsum@latest
RUN
go
install
github.com/vektra/mockery/v2@v2.28.1
RUN
go
install
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
FROM
--platform=linux/amd64 python:3.11.4-slim-bullseye
FROM
--platform=linux/amd64 python:3.11.4-slim-bullseye
ENV
GOPATH=/go
ENV
GOPATH=/go
ENV
PATH=/usr/local/go/bin:$GOPATH/bin:$PATH
ENV
PATH=/usr/local/go/bin:$GOPATH/bin:$PATH
ENV
DEBIAN_FRONTEND=noninteractive
ENV
DEBIAN_FRONTEND=noninteractive
# copy the go installation, but not the module cache (cache will get stale, and would add a lot of weight)
COPY
--from=go-build /usr/local/go /usr/local/go
# copy tools
COPY
--from=go-build /go/bin/gotestsum /go/bin/gotestsum
COPY
--from=go-build /go/bin/mockery /go/bin/mockery
COPY
--from=go-build /go/bin/mockery /go/bin/golangci-lint
COPY
--from=go-build /go/bin/abigen /usr/local/bin/abigen
COPY
--from=go-build /go/bin/abigen /usr/local/bin/abigen
COPY
--from=go-build /go/bin/geth /usr/local/bin/geth
COPY
--from=go-build /go/bin/geth /usr/local/bin/geth
COPY
--from=rust-build /root/.cargo/bin/svm /usr/local/bin/svm
COPY
--from=rust-build /root/.cargo/bin/svm /usr/local/bin/svm
...
@@ -57,21 +78,23 @@ COPY --from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test
...
@@ -57,21 +78,23 @@ COPY --from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test
COPY
.nvmrc .nvmrc
COPY
.nvmrc .nvmrc
ENV
GO_VERSION=1.21.1
# not installed, unused
# musl coreutils g++-x86-64-linux-gnu libc6-dev-amd64-cross
RUN
apt-get update
&&
\
#
apt-get
install
-y
bash curl openssh-client git build-essential ca-certificates jq musl gnupg coreutils g++-x86-64-linux-gnu libc6-dev-amd64-cross
&&
\
# note: python3 package in apt is python 3.9, while base image already has python 3.11
curl
-o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
&&
\
RUN
/bin/sh
-c
set
-eux
;
\
.
/root/.bashrc
&&
nvm
install
&&
nvm use
&&
nvm install-latest-npm
&&
\
apt-get update
;
\
curl
-sL
https://go.dev/dl/go
$GO_VERSION
.linux-amd64.tar.gz
-o
go
$GO_VERSION
.linux-amd64.tar.gz
&&
\
apt-get
install
-y
--no-install-recommends
bash curl openssh-client git build-essential ca-certificates jq gnupg binutils-mips-linux-gnu
;
\
tar
-C
/usr/local/
-xzvf
go1.21.1.linux-amd64.tar.gz
&&
\
curl
-o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
;
\
rm
go
$GO_VERSION
.linux-amd64.tar.gz
&&
\
.
/root/.bashrc
&&
nvm
install
&&
nvm use
&&
nvm install-latest-npm
;
\
ln
-s
/usr/local/go/bin/gofmt /usr/local/bin/gofmt
&&
\
ln
-s
/usr/local/go/bin/gofmt /usr/local/bin/gofmt
;
\
npm i
-g
depcheck
&&
\
npm i
-g
depcheck
;
\
pip
install
slither-analyzer
==
0.9.3
&&
\
pip
install
slither-analyzer
==
0.9.3 capstone pyelftools
;
\
go
install
gotest.tools/gotestsum@latest
&&
\
curl
-fLSs
https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash
;
\
curl
-sSfL
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh
-s
--
-b
$(
go
env
GOPATH
)
/bin v1.54.2
&&
\
apt-get purge
-y
--auto-remove
-o
APT::AutoRemove::RecommendsImportant
=
false
;
\
curl
-fLSs
https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash
rm
-rf
/var/lib/apt/lists/
*
;
\
rm
-rf
/root/.cache/pip
;
\
rm
-rf
/root/.cache/npm
;
RUN
echo
"downloading pnpm and yarn"
&&
.
/root/.bashrc
&&
npm i
-g
pnpm
&&
npm i
-g
yarn@1
&&
pnpm
--version
&&
yarn
--version
RUN
echo
"downloading pnpm and yarn"
&&
.
/root/.bashrc
&&
npm i
-g
pnpm
&&
npm i
-g
yarn@1
&&
pnpm
--version
&&
yarn
--version
...
@@ -90,15 +113,3 @@ RUN echo "downloading and verifying Codecov uploader" && \
...
@@ -90,15 +113,3 @@ RUN echo "downloading and verifying Codecov uploader" && \
chmod
+x /usr/local/bin/codecov
&&
\
chmod
+x /usr/local/bin/codecov
&&
\
rm
codecov
rm
codecov
RUN
echo
"downloading mockery tool"
&&
\
mkdir
-p
mockery-tmp-dir
&&
\
curl
-o
mockery-tmp-dir/mockery.tar.gz
-sL
https://github.com/vektra/mockery/releases/download/v2.28.1/mockery_2.28.1_Linux_x86_64.tar.gz
&&
\
tar
-xzvf
mockery-tmp-dir/mockery.tar.gz
-C
mockery-tmp-dir
&&
\
cp
mockery-tmp-dir/mockery /usr/local/bin/mockery
&&
\
chmod
+x /usr/local/bin/mockery
&&
\
rm
-rf
mockery-tmp-dir
RUN
echo
"installing mips binutils"
&&
\
apt-get
install
-y
binutils-mips-linux-gnu python3 python3-pip
&&
\
pip3
install
capstone pyelftools
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment