Commit c1957126 authored by Matthew Slipper's avatar Matthew Slipper

ci: Use Alpine to reduce image size

Image sizes were increased because the packages Dockerfile used `buster-slim` rather than Alpine. Unfortunately, the images will still be large because the `node_modules` directory contains dev dependencies. This is how it was before the CircleCI migration/larger build cleanup, and will need a larger rethink of how we build TypeScript projects in the monorepo before it can be solved.
parent 3dee2651
---
'@eth-optimism/integration-tests': patch
'@eth-optimism/common-ts': patch
'@eth-optimism/contracts': patch
'@eth-optimism/core-utils': patch
'@eth-optimism/data-transport-layer': patch
'@eth-optimism/message-relayer': patch
'@eth-optimism/replica-healthcheck': patch
'@eth-optimism/sdk': patch
---
Update Dockerfile to use Alpine
...@@ -208,22 +208,22 @@ jobs: ...@@ -208,22 +208,22 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-source-{{ .Branch }}-{{ .Revision }} - v2-source-{{ .Branch }}-{{ .Revision }}
- v1-source-{{ .Branch }} - v2-source-{{ .Branch }}
- checkout - checkout
- save_cache: - save_cache:
key: v1-source-{{ .Branch }}-{{ .Revision }} key: v2-source-{{ .Branch }}-{{ .Revision }}
paths: paths:
- ".git" - ".git"
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-install-{{ checksum "yarn.lock" }} - v2-yarn-install-{{ checksum "yarn.lock" }}
- v1-yarn-install - v2-yarn-install
- run: - run:
name: Install dependencies name: Install dependencies
command: yarn --frozen-lockfile command: yarn --frozen-lockfile
- save_cache: - save_cache:
key: v1-yarn-install-{{ checksum "yarn.lock" }} key: v2-yarn-install-{{ checksum "yarn.lock" }}
paths: paths:
- node_modules - node_modules
- packages/common-ts/node_modules - packages/common-ts/node_modules
...@@ -238,7 +238,7 @@ jobs: ...@@ -238,7 +238,7 @@ jobs:
name: Build monorepo name: Build monorepo
command: yarn build command: yarn build
- save_cache: - save_cache:
key: v1-yarn-build-{{ .Revision }} key: v2-yarn-build-{{ .Revision }}
paths: paths:
- "." - "."
...@@ -248,7 +248,7 @@ jobs: ...@@ -248,7 +248,7 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-build-{{ .Revision }} - v2-yarn-build-{{ .Revision }}
- checkout - checkout
- run: - run:
name: Run Slither name: Run Slither
...@@ -262,7 +262,7 @@ jobs: ...@@ -262,7 +262,7 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-build-{{ .Revision }} - v2-yarn-build-{{ .Revision }}
- checkout - checkout
- run: - run:
name: Lint name: Lint
...@@ -283,7 +283,7 @@ jobs: ...@@ -283,7 +283,7 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-build-{{ .Revision }} - v2-yarn-build-{{ .Revision }}
- checkout - checkout
- run: - run:
name: Test name: Test
...@@ -306,7 +306,7 @@ jobs: ...@@ -306,7 +306,7 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-build-{{ .Revision }} - v2-yarn-build-{{ .Revision }}
- checkout - checkout
# Note: The below needs to be manually configured whenever we # Note: The below needs to be manually configured whenever we
# add a new package to CI. # add a new package to CI.
...@@ -385,7 +385,7 @@ jobs: ...@@ -385,7 +385,7 @@ jobs:
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v1-yarn-build-{{ .Revision }} - v2-yarn-build-{{ .Revision }}
- checkout - checkout
- run: - run:
name: Lint name: Lint
......
...@@ -2,16 +2,9 @@ ...@@ -2,16 +2,9 @@
# be used to build any of the follow-on services # be used to build any of the follow-on services
# #
# ### BASE: Install deps # ### BASE: Install deps
# We do not use Alpine because there's a regression causing it to be very slow FROM node:16-alpine3.14 as base
# when used with typescript/hardhat: https://github.com/nomiclabs/hardhat/issues/1219
FROM node:16.13-buster-slim as base
RUN apt-get update -y && apt-get install -y --no-install-recommends git \ RUN apk --no-cache add curl jq python3 ca-certificates git make gcc musl-dev linux-headers bash
curl \
jq \
python3 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# copy over the needed configs to run the dep installation # copy over the needed configs to run the dep installation
# note: this approach can be a bit unhandy to maintain, but it allows # note: this approach can be a bit unhandy to maintain, but it allows
......
...@@ -8,7 +8,7 @@ do ...@@ -8,7 +8,7 @@ do
sleep 1 sleep 1
if [ $i -eq $RETRIES ]; then if [ $i -eq $RETRIES ]; then
echo 'Timed out waiting for sequencer' echo 'Timed out waiting for sequencer'
break exit 1
fi fi
echo 'Waiting for sequencer...' echo 'Waiting for sequencer...'
((i=i+1)) ((i=i+1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment