Moule Lin
← All notes

Dockerfile

A Dockerfile lets you build your own image, usually based on an existing image, then installing some extra libraries (the ones you need)
Dockerfile can build own image that base on a basic image and install some libraries that you need

FROM node:11
MAINTAINER easydoc.net

# Copy the code
ADD . /app

# Set the default working directory after the container starts
WORKDIR /app

# Run commands to install dependencies
# There can be multiple RUN commands, but you can join several commands with && to reduce layers.
# e.g. RUN npm install && cd /app && mkdir logs
RUN npm install --registry=https://registry.npm.taobao.org

# There can be only one CMD instruction; it is the command run after the container starts, i.e. the program's entry point.
# If you need to run other commands, join them with &&, or put them in a shell script and run that.
# e.g. CMD cd /app && ./start.sh
CMD node app.js

Run docker build -t test:v1 .