mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
Fix: optimize postman docker build (#183)
* fix: optimize postman docker build * fix: format readme * fix: add apt get clean * fix: refactor docker cache issue in the CI workflow
This commit is contained in:
@@ -71,7 +71,11 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}-${{ env.UNTESTED_TAG_SUFFIX }}
|
||||
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||
cache-from: |
|
||||
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-amd64,platform=linux/amd64
|
||||
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-arm64,platform=linux/arm64
|
||||
cache-to: |
|
||||
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-amd64,mode=max,platform=linux/amd64
|
||||
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-arm64,mode=max,platform=linux/arm64
|
||||
build-args: |
|
||||
NATIVE_LIBS_RELEASE_TAG=blob-libs-v1.0.1
|
||||
|
||||
@@ -5,6 +5,11 @@ ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends python3 ca-certificates bash curl make g++ \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
@@ -16,10 +21,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
|
||||
COPY ./sdk/package.json ./sdk/package.json
|
||||
COPY ./ts-libs/linea-native-libs/package.json ./ts-libs/linea-native-libs/package.json
|
||||
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store apt-get update && apt-get install -y --no-install-recommends python3 ca-certificates bash curl make g++ \
|
||||
&& pnpm install --frozen-lockfile --prefer-offline --ignore-scripts \
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
|
||||
|
||||
COPY ./sdk ./sdk
|
||||
COPY ts-libs/linea-native-libs ./ts-libs/linea-native-libs
|
||||
@@ -27,7 +29,7 @@ COPY ts-libs/linea-native-libs ./ts-libs/linea-native-libs
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm run build \
|
||||
&& pnpm deploy --filter=./sdk --prod ./prod/sdk
|
||||
|
||||
FROM base AS production
|
||||
FROM node:lts-slim AS production
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -40,5 +40,3 @@ This package exposes two main classes for usage:
|
||||
## License
|
||||
|
||||
This package is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for more information.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user