Skip to content

Commit

Permalink
Use slim
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Dec 3, 2024
1 parent c930b5b commit 9a6c79b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
docker:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20]
steps:
-
name: Set up QEMU
Expand All @@ -26,10 +28,22 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm i
working-directory: ${{ github.workspace }}

-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
tags: ghcr.io/${{ github.repository_owner }}/ultralight:latest
provenance: false
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine as BUILD_IMAGE
FROM node:20-alpine

RUN apk update && apk add --no-cache bash g++ make git python3 && rm -rf /var/cache/apk/*
RUN apk add --virtual .build-deps alpine-sdk jq
Expand All @@ -7,16 +7,12 @@ RUN ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2

WORKDIR /ultralight

RUN jq -r '.workspaces |= .[0:2]' package.json > package.json
COPY package*.json ./
COPY . .
RUN npm i --omit-dev
COPY node_modules node_modules
COPY packages/portalnetwork/dist packages/portalnetwork/dist
COPY packages/cli/dist packages/cli/dist
COPY packages/cli/package.json packages/cli
COPY packages/portalnetwork/package.json packages/portalnetwork

LABEL org.opencontainers.image.source=https://github.com/acolytec3/ultralight

FROM ubuntu:23.04
RUN apt update && apt-get install nodejs musl-dev -y && ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
COPY --from=BUILD_IMAGE ./ultralight ./ultralight
ENV BINDADDRESS=
ENV RPCPORT=
ENV PK=
Expand Down
20 changes: 0 additions & 20 deletions Dockerfile.slim

This file was deleted.

0 comments on commit 9a6c79b

Please sign in to comment.