Compare commits

...

4 Commits

Author SHA1 Message Date
41302b9f9f Set bash args as extra-args 2022-11-14 23:02:47 +01:00
ad8d546b78 Utilize Multi-stage building to reduce Image-size 2022-11-14 22:39:57 +01:00
d5a727c3df Make executeable 2022-11-14 21:19:37 +01:00
d5c7f0a580 Make apk package install more elegant 2022-11-14 19:13:32 +01:00
3 changed files with 20 additions and 10 deletions

View File

@ -1,19 +1,29 @@
FROM node:16-alpine # ---- Base ----
FROM alpine:3 AS base
# Create app directory # Create app directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Copy project file
COPY package.json .
# Install required apk-packages
RUN apk add --no-cache nodejs npm tcpdump
# ---- Dependencies ----
FROM base AS dependencies
# Install app dependencies # Install app dependencies
COPY package*.json ./ RUN npm install --only=production
RUN npm install
# remove development dependencies
RUN npm prune --production
# Install required apk-packages & delete cache # ---- Release ----
RUN apk update && apk add tcpdump && rm -rf /var/cache/apk/* FROM base AS release
# copy from build image
COPY --from=dependencies /usr/src/app/ ./
# Bundle app source # Bundle app source
COPY ./src/ . COPY ./src/ .
CMD ["npm", "run", "start"] CMD ["npm", "run", "start"]

View File

@ -1,6 +1,6 @@
TAG="ruakij/rfmon-to-influx" TAG="ruakij/rfmon-to-influx"
PLATFORM="linux/amd64,linux/arm64/v8,linux/arm/v7" PLATFORM="linux/amd64,linux/arm64/v8,linux/arm/v7"
EXTRA_ARGS="" EXTRA_ARGS="$@"
docker buildx build \ docker buildx build \
--platform $PLATFORM \ --platform $PLATFORM \

2
build/docker-ownarch.sh Normal file → Executable file
View File

@ -1,5 +1,5 @@
TAG="ruakij/rfmon-to-influx" TAG="ruakij/rfmon-to-influx"
EXTRA_ARGS="" EXTRA_ARGS="$@"
docker build \ docker build \
--tag $TAG \ --tag $TAG \