Depending on your use case, you can use an image that has already been created and specify its name in docker-compose .
We have a production case where our CI server creates the name Docker with the name. ( docker build -t <specific_image_name> . ). As soon as the specified name is specified, our docker-compose will always create a specific image. This allows you to use several different features:
1- You can guarantee that wherever you run your docker-compose , you will always use the latest version of this particular image.
2- You can specify several named images in your docker-compose file and let them automatically connect through the previous build step.
So, if your image is already built, you can name the image using docker-compose . Remove build and specify image:
wildfly: image: my_custom_wildfly_image container_name: wildfly_server ports: - 9990:9990 - 80:8080 environment: - MYSQL_HOST=mysql_server - MONGO_HOST=mongo_server - ELASTIC_HOST=elasticsearch_server volumes: - /Volumes/CaseSensitive/development/wildfly/deployments/:/opt/jboss/wildfly/standalone/deployments/ links: - mysql:mysql_server - mongo:mongo_server - elasticsearch:elasticsearch_server
meoww- Aug 27 '15 at 10:18 2015-08-27 22:18
source share