[英]i have problem when i use Docker container is not using my local html file
First i create normal Docker file and used首先我创建正常的 Docker 文件并使用
FROM nginx:latest来自 nginx:最新
COPY.复制。 /usr/share/nginx/html
/usr/share/nginx/html
inside Dockerfile内部 Dockerfile
it create images and containers perfectly它完美地创建图像和容器
but my friend by mistake write this in the terminal:但是我的朋友错误地在终端上写了这个:
docker run -d -p 80:80 docker/getting-started docker run -d -p 80:80 docker/getting-started
every time I create image or container will let me go to this website the first code i write after i delete the images and continers: docker build.每次我创建图像或容器时,都会让我 go 到这个网站,我在删除图像和 continers 后编写的第一个代码:docker build。
my image command: docker build -t image name.我的图像命令:docker build -t 图像名称。
my container command: docker run -d -p 80:80 Image ID我的容器命令:docker run -d -p 80:80 Image ID
note: the container was run my HTML file normal but my friend used that command I don't know why but I need to fix it i just want my container run my HTML file注意:容器运行我的 HTML 文件正常但我的朋友使用该命令我不知道为什么但我需要修复它我只想让我的容器运行我的 HTML 文件
Stop the docker engine and remove all images and then built the image停止 docker 引擎并移除所有镜像,然后构建镜像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.