This commit is contained in:
parent
a049275733
commit
f222b17083
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
.github
|
||||||
|
README.md
|
38
.github/workflows/docker-publish.yml
vendored
Normal file
38
.github/workflows/docker-publish.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: release
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 0 1 * *
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU (para emular otras arquitecturas)
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push multi-arch image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
tags: docker.io/${{ secrets.DOCKER_REGISTRY_USER }}/base-node:latest
|
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
FROM docker.io/rusian/hyperbola:latest
|
||||||
|
|
||||||
|
ENV NODE_VERSION=lts/*
|
||||||
|
|
||||||
|
RUN pacman -Syu --noconfirm --noprogressbar \
|
||||||
|
&& pacman -S --noconfirm --noprogressbar \
|
||||||
|
base-devel \
|
||||||
|
doas \
|
||||||
|
curl \
|
||||||
|
ca-certificates \
|
||||||
|
git \
|
||||||
|
rsync \
|
||||||
|
wget \
|
||||||
|
bash \
|
||||||
|
&& useradd -m builder \
|
||||||
|
&& echo "permit persist keepenv nopass builder as root" > /etc/doas.conf \
|
||||||
|
&& pacman -Scc --noconfirm
|
||||||
|
|
||||||
|
USER builder
|
||||||
|
ENV NVM_DIR=/home/builder/.nvm
|
||||||
|
ENV HOME=/home/builder
|
||||||
|
WORKDIR /home/builder
|
||||||
|
|
||||||
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \
|
||||||
|
&& . "$NVM_DIR/nvm.sh" \
|
||||||
|
&& nvm install $NODE_VERSION \
|
||||||
|
&& nvm alias default $NODE_VERSION \
|
||||||
|
&& nvm use default \
|
||||||
|
&& npm install -g npm
|
||||||
|
|
||||||
|
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc \
|
||||||
|
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> ~/.bashrc \
|
||||||
|
&& echo 'nvm use default &>/dev/null' >> ~/.bashrc
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
@ -4,7 +4,7 @@ Una imagen Docker base con **Node.js LTS instalado vía NVM**, ideal para proyec
|
|||||||
|
|
||||||
## 📦 Características
|
## 📦 Características
|
||||||
|
|
||||||
- Basado en `ubuntu:22.04`
|
- Basado en `hyperbola:v0.4.4`
|
||||||
- Node.js LTS instalado con `nvm`
|
- Node.js LTS instalado con `nvm`
|
||||||
- Incluye `npm` y `npx`
|
- Incluye `npm` y `npx`
|
||||||
- Node.js accesible globalmente (`node`, `npm`, `npx` en `/usr/bin/`)
|
- Node.js accesible globalmente (`node`, `npm`, `npx` en `/usr/bin/`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user