Add podman support

This commit is contained in:
andrew.greene 2022-01-17 09:31:18 -07:00
parent da74c67ec8
commit ece0f3c9bb
5 changed files with 27 additions and 10 deletions

View File

@ -10,6 +10,9 @@ RUN npm run build
FROM node:stretch-slim
RUN useradd -ms /bin/bash appuser
USER appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appuser /home/node/node_modules node_modules

13
container-build.sh Executable file
View File

@ -0,0 +1,13 @@
VERSION=$(grep -oE "\"version\": \"(\w*.\w*.\w*.\w*.\w*.)" package.json | cut -d\" -f4)
CONTAINER_ENGINE=$1
if [ -z $CONTAINER_ENGINE ]; then
CONTAINER_ENGINE=docker
fi
echo using $CONTAINER_ENGINE container engine...
$CONTAINER_ENGINE build --rm --no-cache \
--build-arg BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")" \
--file Containerfile \
--tag sparkle-guide:$VERSION .

11
container-run.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
VERSION=$(grep -oE "\"version\": \"(\w*.\w*.\w*.\w*.\w*.)" package.json | cut -d\" -f4)
CONTAINER_ENGINE=$1
if [ -z $CONTAINER_ENGINE ]; then
CONTAINER_ENGINE=docker
fi
echo using $CONTAINER_ENGINE container engine...
$CONTAINER_ENGINE run -p 1880:1880 -v "$(pwd)"/data/:/root/.node-red/ sparkle-guide:$VERSION &

View File

@ -1,6 +0,0 @@
VERSION=$(grep -oE "\"version\": \"(\w*.\w*.\w*.\w*.\w*.)" package.json | cut -d\" -f4)
docker build --rm --no-cache \
--build-arg BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")" \
--file Dockerfile \
--tag sparkle-guide:$VERSION .

View File

@ -1,4 +0,0 @@
#!/bin/bash
VERSION=$(grep -oE "\"version\": \"(\w*.\w*.\w*.\w*.\w*.)" package.json | cut -d\" -f4)
docker run -p 1880:1880 -v "$(pwd)"/data/:/root/.node-red/ sparkle-guide:$VERSION &