Skip to content

Commit

Permalink
changed base container image to Wolfi
Browse files Browse the repository at this point in the history
  • Loading branch information
jbergfeld committed Aug 29, 2024
1 parent 38ef399 commit a025857
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions src/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
FROM node:16-alpine3.13

ARG IMAGE_CREATE_DATE
ARG IMAGE_VERSION
ARG IMAGE_SOURCE_REVISION

# Metadata as defined in OCI image spec annotations - https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.title="Hello Kubernetes!" \
org.opencontainers.image.description="Provides a demo app to deploy to a Kubernetes cluster. It displays a message, the name of the pod and details of the node it is deployed to." \
org.opencontainers.image.created=$IMAGE_CREATE_DATE \
org.opencontainers.image.version=$IMAGE_VERSION \
org.opencontainers.image.authors="Paul Bouwer" \
org.opencontainers.image.url="https://hub.docker.com/r/paulbouwer/hello-kubernetes/" \
org.opencontainers.image.documentation="https://github.com/paulbouwer/hello-kubernetes/README.md" \
org.opencontainers.image.vendor="Paul Bouwer" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/paulbouwer/hello-kubernetes.git" \
org.opencontainers.image.revision=$IMAGE_SOURCE_REVISION

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install

# Bundle app source
COPY . /usr/src/app

USER node
CMD [ "npm", "start" ]
FROM cgr.dev/chainguard/wolfi-base

ARG version=3.11

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN apk update && apk add nodejs && apk add npm

COPY package.json /usr/src/app/
RUN npm install

COPY . /usr/src/app

ENV PORT 5000

USER nonroot
CMD [ "npm", "start" ]

0 comments on commit a025857

Please sign in to comment.