美文网首页
node 镜像制作

node 镜像制作

作者: 皓月__ | 来源:发表于2019-07-19 07:00 被阅读0次

Dockerfile 文件内容

FROM centos

RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash - \
    && yum install -y nodejs \
    && yum clean all

CMD ["/usr/sbin/init"]

由 Dockerfile 文件构建镜像

docker build -t centos76-node:latest .

保存镜像到文件

docker save > centos76-node.tar centos76-node:latest

启动容器 添加端口映射

docker run --privileged=true --name "centos76-node" -d -i -t centos76-node /usr/sbin/init

进入容器

docker exec -i -t centos76-node /bin/bash

相关文章

网友评论

      本文标题:node 镜像制作

      本文链接:https://www.haomeiwen.com/subject/otmdlctx.html