安装docker
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
DockerFile
mkdir your_docker
touch .dockerignore
vim Dockerfile
如果不需要其他镜像的话FROM scratch
是最节省空间的
FROM node:8.4
COPY . /app
WORKDIR /app
RUN npm install --registry=https://registry.npm.taobao.org
EXPOSE 3000
docker image的构建与上传
docker image build -t [imageName]:[tag] .
docker login
docker image tag [imageName] [username]/[repository]:[tag]
docker image build -t [username]/[repository]:[tag] .
docker image push [username]/[repository]:[tag]
docker-compose
安装
sudo pip install -U docker-compose
sudo pip uninstall docker-compose
创建yml
vim docker-compose.yml