Skip to content

Commit

Permalink
Dockerfile including whole monorepo (#10472)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortejoso authored Aug 8, 2023
1 parent 196ba83 commit 3fffa15
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 5 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/container-all-monorepo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Build celo-monorepo container

on:
push:
paths:
- 'dockerfiles/all-monorepo/**'
branches:
- master
pull_request:
paths:
- 'dockerfiles/all-monorepo/**'
workflow_dispatch:

jobs:
celomonorepo-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/monorepo:${{ github.sha }}
if: |
github.ref != 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/monorepo
tag: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile

celomonorepo-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo:${{ github.sha }}
if: |
github.ref == 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo
tag: ${{ github.sha }}
context: .
file: dockerfiles/all-monorepo/Dockerfile
10 changes: 5 additions & 5 deletions .github/workflows/container-celotool.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build celo-monorepo container
name: Build celotool container

on:
push:
Expand All @@ -15,26 +15,26 @@ on:
jobs:
celotool-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:testing
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/celotool:${{ github.sha }}
if: |
github.ref != 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/celotool
tag: testing
tag: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile

celotool-build:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:latest
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool:${{ github.sha }}
if: |
github.ref == 'refs/heads/master'
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/celotool
tag: latest
tag: ${{ github.sha }}
context: .
file: dockerfiles/celotool/Dockerfile
26 changes: 26 additions & 0 deletions dockerfiles/all-monorepo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-monorepo

# Needed for gsutil
RUN apt-get update && \
apt-get install -y lsb-release && \
apt-get install -y curl build-essential git python3 && \
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update -y && \
apt-get install -y google-cloud-sdk kubectl netcat-openbsd && \
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash && \
rm -rf /var/lib/apt/lists/*

# ensure yarn.lock is evaluated by kaniko cache diff
COPY . ./

RUN yarn install --network-timeout 100000 --frozen-lockfile && yarn cache clean
RUN yarn build

RUN rm -rf .git
RUN rm -rf .gitmodules

2 changes: 2 additions & 0 deletions dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-monorepo

# Needed for gsutil
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/cli-standalone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# VERSION=x.y.z; docker build . --build-arg VERSION=$VERSION -t gcr.io/celo-testnet/celocli-standalone:$VERSION
FROM node:12-alpine
LABEL org.opencontainers.image.authors="[email protected]"

# Install cli install dependencies.
RUN apk add --no-cache python3 git make gcc g++ bash libusb-dev linux-headers eudev-dev
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN npm install @celo/celocli

# Build the combined image
FROM node:12-alpine as final_image
LABEL org.opencontainers.image.authors="[email protected]"

ARG network_name="alfajores"
ARG network_id="44787"
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/phone-number-privacy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ COPY packages/sdk/wallets/wallet-remote packages/sdk/wallets/wallet-remote

##### Main stage
FROM node:18
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /celo-phone-number-privacy/

Expand Down

0 comments on commit 3fffa15

Please sign in to comment.