diff --git a/.github/workflows/node-release.yml b/.github/workflows/node-release.yml new file mode 100644 index 0000000..d97d114 --- /dev/null +++ b/.github/workflows/node-release.yml @@ -0,0 +1,62 @@ +name: Build Node Image + +on: + workflow_dispatch: + inputs: + node22Version: + description: 'Node 22 Version' + default: '22.2.0' + required: true + node21Version: + description: 'Node 21 Version' + default: '21.7.3' + required: true + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build Node-22 and Push + uses: docker/build-push-action@v5 + with: + context: ./node/22 + file: Dockerfile + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + push: true + build-args: + NODE_VERSION=${{ github.event.inputs.node22Version }} + tags: | + 1panel/node:${{ github.event.inputs.node22Version }} + #outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build Node-21 and Push + uses: docker/build-push-action@v5 + with: + context: ./node/21 + file: Dockerfile + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + push: true + build-args: + NODE_VERSION=${{ github.event.inputs.node21Version }} + tags: | + 1panel/node:${{ github.event.inputs.node21Version }} + #outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/node/18/Dockerfile b/node/18/Dockerfile new file mode 100644 index 0000000..f007ef5 --- /dev/null +++ b/node/18/Dockerfile @@ -0,0 +1,10 @@ +ARG NODE_VERSION + +FROM node:${NODE_VERSION} + +RUN npm install -g pnpm + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] \ No newline at end of file diff --git a/node/18/docker-entrypoint.sh b/node/18/docker-entrypoint.sh new file mode 100644 index 0000000..c742827 --- /dev/null +++ b/node/18/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/node/20/Dockerfile b/node/20/Dockerfile new file mode 100644 index 0000000..f007ef5 --- /dev/null +++ b/node/20/Dockerfile @@ -0,0 +1,10 @@ +ARG NODE_VERSION + +FROM node:${NODE_VERSION} + +RUN npm install -g pnpm + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] \ No newline at end of file diff --git a/node/20/docker-entrypoint.sh b/node/20/docker-entrypoint.sh new file mode 100644 index 0000000..c742827 --- /dev/null +++ b/node/20/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/node/21/Dockerfile b/node/21/Dockerfile new file mode 100644 index 0000000..f007ef5 --- /dev/null +++ b/node/21/Dockerfile @@ -0,0 +1,10 @@ +ARG NODE_VERSION + +FROM node:${NODE_VERSION} + +RUN npm install -g pnpm + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] \ No newline at end of file diff --git a/node/21/docker-entrypoint.sh b/node/21/docker-entrypoint.sh new file mode 100644 index 0000000..c742827 --- /dev/null +++ b/node/21/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/node/22/Dockerfile b/node/22/Dockerfile new file mode 100644 index 0000000..f007ef5 --- /dev/null +++ b/node/22/Dockerfile @@ -0,0 +1,10 @@ +ARG NODE_VERSION + +FROM node:${NODE_VERSION} + +RUN npm install -g pnpm + +COPY docker-entrypoint.sh /usr/local/bin/ +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD [ "node" ] \ No newline at end of file diff --git a/node/22/docker-entrypoint.sh b/node/22/docker-entrypoint.sh new file mode 100644 index 0000000..c742827 --- /dev/null +++ b/node/22/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# Run command with node if the first argument contains a "-" or is not a system command. The last +# part inside the "{}" is a workaround for the following bug in ash/dash: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 +if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then + set -- node "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/nodejs/.gitkeep b/nodejs/.gitkeep deleted file mode 100644 index e69de29..0000000