From 1d224f278ba42049f1c5da2855a43428eb00664a Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Tue, 15 Aug 2023 20:30:35 -0700 Subject: [PATCH] Add a node image --- README.md | 1 + node/README.md | 3 +++ node/apko.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ node/build.sh | 7 +++++++ 4 files changed, 51 insertions(+) create mode 100644 node/README.md create mode 100644 node/apko.yaml create mode 100755 node/build.sh diff --git a/README.md b/README.md index a5a1213..4763baa 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ docker pull gitea.elara.ws/elara6331/golang:latest - `golang`: An alpine-based image with Go installed - `webserver`: A very simple webserver - `go-import-redirector`: rsc's [go-import-redirector](https://github.com/rsc/go-import-redirector) project +- `node`: An alpine-based image with NodeJS installed ### Acknowledgements diff --git a/node/README.md b/node/README.md new file mode 100644 index 0000000..debf5dc --- /dev/null +++ b/node/README.md @@ -0,0 +1,3 @@ +# node + +The [node image](https://gitea.elara.ws/Elara6331/-/packages/container/node/latest) is an Alpine Edge image with the latest version of NodeJS from Alpine's [nodejs package](https://pkgs.alpinelinux.org/package/edge/main/riscv64/nodejs) installed diff --git a/node/apko.yaml b/node/apko.yaml new file mode 100644 index 0000000..44d319b --- /dev/null +++ b/node/apko.yaml @@ -0,0 +1,40 @@ +contents: + repositories: + - https://dl-cdn.alpinelinux.org/alpine/edge/main + packages: + - busybox + - nghttp2 + - nodejs + +accounts: + groups: + - groupname: node + gid: 65532 + users: + - username: node + uid: 65532 + gid: 65532 + run-as: 65532 + +paths: + - path: /app + type: directory + permissions: 0o777 + uid: 65532 + gid: 65532 + +work-dir: /app + +environment: + NODE_PORT: 3000 + PATH: '/usr/sbin:/sbin:/usr/bin:/bin' + NPM_CONFIG_UPDATE_NOTIFIER: false + +entrypoint: + command: /usr/bin/node +cmd: --help + +archs: + - amd64 + - arm64 + - riscv64 diff --git a/node/build.sh b/node/build.sh new file mode 100755 index 0000000..53dc748 --- /dev/null +++ b/node/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +apko publish \ + --sbom=false \ + --package-version-tag=nodejs \ + apko.yaml \ + gitea.elara.ws/elara6331/node:latest