linux  virtualisierung  docker

  Inhaltsverzeichnis:

Docker - Build

Stetig wachsen...

Notes

Example One

#dockerfile
FROM nginx:alpine
COPY ./index.html /usr/share/nginx/html/index.html

Example Two

#dockerfile
FROM node:alpine as baseimage
USER node

#-----
# Install dependencies
FROM baseimage AS buildimage
COPY --chown=node:node package*.json /home/node/app/
RUN cd /home/node/app && npm install
COPY --chown=node:node . /home/node/app

#-----
FROM baseimage
COPY --from=buildimage --chown=node:node /home/node/app /home/node/app
CMD ["node", "/home/node/app/index.js"]