我有一个docker-compose文件,并希望能够从本地缓存中的图像中旋转出一张图像,而不是从dockerhub中拉出图像。我正在使用sbt docker插件,因此我可以看到正在创建的图像,并且可以docker images在命令行中看到。但是,当我这样做时,docker-compose up -d myimage它始终默认为远程映像。如何强制它使用本地图像?
这是我的撰写文件的相关部分:
spark-master:
image: gettyimages/spark:2.2.0-hadoop-2.7
command: bin/spark-class org.apache.spark.deploy.master.Master -h spark-master
hostname: spark-master
environment:
MASTER: spark://spark-master:7077
SPARK_CONF_DIR: /conf
SPARK_PUBLIC_DNS: localhost
expose:
- 7001
- 7002
- 7003
- 7004
- 7005
- 7006
- 7077
- 6066
ports:
- 4040:4040
- 6066:6066
- 7077:7077
- 8080:8080
volumes:
- ./conf/master:/conf
- ./data:/tmp/data
hydra-streams:
image: ****/hydra-spark-core
command: bin/spark-class org.apache.spark.deploy.worker.Worker spark://spark-master:7077
hostname: worker
environment:
SPARK_CONF_DIR: /conf
SPARK_WORKER_CORES: 2
SPARK_WORKER_MEMORY: 1g
SPARK_WORKER_PORT: 8881
SPARK_WORKER_WEBUI_PORT: 8091
SPARK_PUBLIC_DNS: localhost
links:
- spark-master
expose:
- 7012
- 7013
- 7014
- 7015
- 7016
- 8881
ports:
- 8091:8091
volumes:
- ./conf/worker:/conf
- ./data:/tmp/data
Run Code Online (Sandbox Code Playgroud)
您可以通过重新使用现有图像来强制使用本地图像:
docker tag remote/image local_image
Run Code Online (Sandbox Code Playgroud)
然后在撰写文件中使用local_image代替remote/image。
| 归档时间: |
|
| 查看次数: |
4089 次 |
| 最近记录: |