Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: optimize postman docker build #183

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/postman-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
jonesho marked this conversation as resolved.
Show resolved Hide resolved
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
12 changes: 7 additions & 5 deletions sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,18 +21,15 @@ 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

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

Expand Down
2 changes: 0 additions & 2 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Loading