Err*_*404 4 docker dockerfile docker-compose docker-image
我在社区做了基本的搜索,没有找到合适的答案,所以我在这里提问。抱歉,如果之前有人问过的话。
基本上,我正在从事某个项目,并且我们会定期更改代码。所以,我们每次都需要构建docker镜像,因为我们需要从头开始安装requirement.txt中的依赖项,每次大约需要10分钟。
如何对 docker 映像执行直接更改,以及如何配置反映预构建 docker 映像中更改的入口点(在 Docker 文件中)
docker run IMAGEdocker exec -it <container-id>(您可以使用 获取容器 ID docker ps)docker commit <container-id> my-new-image(替换为要保存的容器的容器 ID)# Run an existing image
docker run -dt existing_image
# See that it's running
docker ps
# CONTAINER ID IMAGE COMMAND CREATED STATUS
# c7e6409a22bf existing-image "R" 6 minutes ago Up 6 minutes
# Shell into it
docker exec -it c7e6409a22bf bash
# Make a new directory for demonstration purposes
# (note that this is inside the existing image)
mkdir NEWDIRECTORY
# Open another terminal tab/window, and save the running container you modified
docker commit c7e6409a22bf my-new-image
# Inspect to ensure it saved correctly
docker image ls
# REPOSITORY TAG IMAGE ID CREATED SIZE
# existing-image latest a7dde5d84fe5 7 minutes ago 888MB
# my-new-image latest d57fd15d5a95 2 minutes ago 888MB
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15956 次 |
| 最近记录: |