创建一个docker image

Docker/容器
394
0
0
2022-04-15
标签   Docker

1,mkdir docker
2,创建一个文件Dockerfile vim Dockerfile
3,编辑这个文件,输入内容:
1,FROM alpine:latest
MAINTAINER xbf
CMD echo “hello docker”
2,FROM ubuntu
MAINTAINER admin@xyqfrms.xyz
RUN sed -i ‘s/archive.ubuntu.com/mirrors.ustc.edu.cn/g’ /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
COPY index.html /var/www/html
ENTRYPOINT [“usr/sbin/nginx”, “-g”, “daemon off;”]
EXPOSE 80
4,命令:docker build -t hello_docker . 完成!