Lab 5.A - Building Images
Dockerfile
https://docs.docker.com/get-started/
git clone https://github.com/docker/getting-started.git
cd getting-started/app
# open in text editor
# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
EXPOSE 3000
docker build -t getting-started .
docker run -d -p 3000:3000 getting-started
# edit src/static/js/app.js line 56
docker build -t getting-started .
docker stop [container]
docker run -d -p 3000:3000 getting-started
docker scan getting-started
# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --production
COPY . .
CMD ["node", "src/index.js"]
EXPOSE 3000
# .dockerignore
node_modules