Create a docker image

Time:2021-9-21

1,mkdir docker
2. Create a dockerfile VIM dockerfile
3. Edit this file and enter the following contents:
1,FROM alpine:latest
MAINTAINER xbf
CMD echo “hello docker”
2,FROM ubuntu
MAINTAINER [email protected]
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. Command: docker build – t hello_ Docker. Done!

This work adoptsCC agreement, reprint must indicate the author and the link to this article