我是新来的docker,我正在使用一个撰写文件从一个Dockerfile生成,并为我运行和图像我有以下的XML文件
version: '2' services: multichain: build: ./ image: ubuntu:15.04 read_only: false volumes: - .:/data:rw working_dir: /data #entrypoint: node server/index.js
docker-compose up --build生产
REPOSITORY TAG IMAGE ID CREATED SIZE <none> <none> 5c5580fb6ce4 2 minutes ago 175.1 MB ubuntu 15.04 d1b55fd07600 10 months ago 131.3 MB
哪一个是预期的,但是我可以在构builddocker-compose期间用东西replace“”吗?
另外,当我再次运行该文件时,将创build另一个:我不能只是取代已经有什么?
Docker不会replace图像,您必须运行另一个命令来删除旧的。 根据https://docs.docker.com/compose/compose-file/#/build ,在'build'之后添加'image',你正在指示docker将你的新版本标记为ubuntu:15.04 。
您不希望在撰写文件中指定基本映像,Dockerfile FROM会这样做。
我想你想在你的例子中将ubuntu:15.04更改为myapp:latest