应用容器化
程序员文章站
2022-06-22 16:56:10
应用容器化1. 容器化当前应用,构建镜像构建前必须确保当前在存放Dockerfile的目录当中docker image build -t [web:latest] .2. Dockerfile示例# Test web-app to use with Pluralsight courses and Docker Deep Dive book# Linux x64FROM alpineLABEL maintainer="nigelpoulton@hotmail.com"# Install...
应用容器化
1. 容器化当前应用,构建镜像
构建前必须确保当前在存放Dockerfile的目录当中
docker image build -t [web:latest] .
2. Dockerfile示例
# Test web-app to use with Pluralsight courses and Docker Deep Dive book
# Linux x64
FROM alpine
LABEL maintainer="nigelpoulton@hotmail.com"
# Install Node and NPM
RUN apk add --update nodejs nodejs-npm
# Copy app to /src
COPY . /src
WORKDIR /src
# Install dependencies
RUN npm install
EXPOSE 8080
ENTRYPOINT ["node", "./app.js"]
3.推送镜像
推送镜像之前要先打上标签
docker image tag [镜像名]:latest [仓库名]/[镜像名]:latest
本文地址:https://blog.csdn.net/HELLOWORLD2424/article/details/112553416
下一篇: 【蓝桥杯】_05有理数类