From 0d3e2d70917ecb43212a2dad06f1c26234e2a5e4 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sun, 2 May 2021 09:18:11 -0600 Subject: [PATCH] node16: new image --- .github/workflows/docker-publish.yml | 7 +++-- node16/Dockerfile | 38 ++++++++++++++++++++++++ node16/entrypoint.sh | 44 ++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 node16/Dockerfile create mode 100644 node16/entrypoint.sh diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index efb4957..eb6ffdf 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -34,6 +34,7 @@ jobs: - "node12" - "node14" - "node15" + - "node16" - "python3.7" - "python3.8" - "python3.9" @@ -45,8 +46,8 @@ jobs: - name: Code Checkout uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v1 - name: Install buildx uses: docker/setup-buildx-action@v1 @@ -73,7 +74,7 @@ jobs: with: context: ./${{ matrix.image }} file: ./${{ matrix.image }}/Dockerfile - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: | ghcr.io/matthewpi/images:${{ matrix.image }} diff --git a/node16/Dockerfile b/node16/Dockerfile new file mode 100644 index 0000000..497d535 --- /dev/null +++ b/node16/Dockerfile @@ -0,0 +1,38 @@ +# +# Copyright (c) 2021 Matthew Penner +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +FROM --platform=$BUILDPLATFORM node:16-alpine + +LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" + +LABEL org.opencontainers.image.source="https://github.com/matthewpi/images" +LABEL org.opencontainers.image.licenses=MIT + +RUN apk add --update --no-cache ca-certificates curl ffmpeg git openssl sqlite tar tzdata \ + && adduser -D -h /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD [ "/bin/ash", "/entrypoint.sh" ] diff --git a/node16/entrypoint.sh b/node16/entrypoint.sh new file mode 100644 index 0000000..926c2a1 --- /dev/null +++ b/node16/entrypoint.sh @@ -0,0 +1,44 @@ +#!/bin/ash + +# +# Copyright (c) 2021 Matthew Penner +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Switch to the container's working directory +cd /home/container + +# Set environment variable that holds the Internal Docker IP +export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` + +# Print Node.js version +node -v + +# Replace variables in the startup command +MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m' +echo "${MODIFIED_STARTUP}" + +# Run the startup command +exec env ${MODIFIED_STARTUP}