Skip to content

Commit

Permalink
Merge pull request #97 from OffchainLabs/docker-layer
Browse files Browse the repository at this point in the history
perf: common docker layer
  • Loading branch information
joshuacolvin0 authored Nov 5, 2024
2 parents 3086f24 + e096877 commit 51e1d7a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
6 changes: 3 additions & 3 deletions rollupcreator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM node:18-bullseye-slim
ARG NITRO_CONTRACTS_BRANCH=main
RUN apt-get update && \
apt-get install -y git docker.io python3 build-essential curl jq
apt-get install -y git docker.io python3 make gcc g++ curl jq
ARG NITRO_CONTRACTS_BRANCH=main
WORKDIR /workspace
RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./
RUN git checkout ${NITRO_CONTRACTS_BRANCH}
RUN yarn install && yarn cache clean
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="${PATH}:/root/.foundry/bin"
RUN foundryup
RUN touch scripts/config.ts
RUN yarn install
RUN yarn build:all
ENTRYPOINT ["yarn"]
22 changes: 18 additions & 4 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ run=true
ci=false
validate=false
detach=false
nowait=false
blockscout=false
tokenbridge=false
l3node=false
Expand Down Expand Up @@ -71,13 +72,13 @@ while [[ $# -gt 0 ]]; do
read -p "are you sure? [y/n]" -n 1 response
if [[ $response == "y" ]] || [[ $response == "Y" ]]; then
force_init=true
build_utils=true
build_node_images=true
echo
else
exit 0
fi
fi
build_utils=true
build_node_images=true
shift
;;
--init-force)
Expand Down Expand Up @@ -179,6 +180,14 @@ while [[ $# -gt 0 ]]; do
detach=true
shift
;;
--nowait)
if ! $detach; then
echo "Error: --nowait requires --detach to be provided."
exit 1
fi
nowait=true
shift
;;
--batchposters)
simple=false
batchposters=$2
Expand Down Expand Up @@ -344,7 +353,8 @@ fi

if $build_utils; then
LOCAL_BUILD_NODES="scripts rollupcreator"
if $tokenbridge || $l3_token_bridge; then
# always build tokenbridge in CI mode to avoid caching issues
if $tokenbridge || $l3_token_bridge || $ci; then
LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge"
fi

Expand Down Expand Up @@ -556,7 +566,11 @@ fi
if $run; then
UP_FLAG=""
if $detach; then
UP_FLAG="--wait"
if $nowait; then
UP_FLAG="--detach"
else
UP_FLAG="--wait"
fi
fi

echo == Launching Sequencer
Expand Down
12 changes: 7 additions & 5 deletions tokenbridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM node:18-bullseye-slim
ARG TOKEN_BRIDGE_BRANCH=main
RUN apt-get update && \
apt-get install -y git docker.io python3 build-essential
apt-get install -y git docker.io python3 make gcc g++ curl jq
ARG TOKEN_BRIDGE_BRANCH=main
WORKDIR /workspace
RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./
RUN git checkout ${TOKEN_BRIDGE_BRANCH}
RUN yarn install
RUN git clone --no-checkout https://github.com/OffchainLabs/token-bridge-contracts.git ./ && \
git checkout ${TOKEN_BRIDGE_BRANCH} && \
rm -rf .git && \
git init && git add . && git -c user.name="user" -c user.email="[email protected]" commit -m "Initial commit"
RUN yarn install && yarn cache clean
RUN yarn build
ENTRYPOINT ["yarn"]

0 comments on commit 51e1d7a

Please sign in to comment.