# 1. download the script
#
# $ curl -fsSL https://get.docker.com -o install-docker.sh
#
# 2. verify the script's content
#
# $ cat install-docker.sh
#
# 3. run the script with --dry-run to verify the steps it executes
#
# $ sh install-docker.sh --dry-run
#
# 4. run the script either as root, or using sudo to perform the installation.
#
# $ sudo sh install-docker.sh
一 准备html
新建一个html文件夹,在文件夹中新建index.html写上hello world
mkdir html && cd html
vim index.html
二 准备Dockerfile文件
在html的同级目录,新建Dockerfile
FROM nginx
COPY ./html /usr/share/nginx/html
三 构建docker 镜像
在Dockerfile的同级目录 运行下面命令
docker build -t some-content-nginx .
四 运行docker容器
docker run --name some-nginx -d -p 8080:80 some-content-nginx
Usage: docker image prune [OPTIONS]
Remove unused images
Options:
-a, --all Remove all unused images, not just dangling ones
--filter filter Provide filter values (e.g. 'until=<timestamp>')
-f, --force Do not prompt for confirmation