Docker Compose file to Create a container with multiple Images I need to build a container using the following images.
Python DotNetCore 2.0
have created a docker-compose.yml file as below. Am trying to create one container for each image and do linking between the containers. But its failing can you please correct me the compose file.
Also after the container is created how can i check what are the images inside the container.
… version: “1.0”
services: phython: image: python
dotnetcore: image: microsoft/aspnetcore:2.0 links:
phython:hub
Please suggest how to go ahead .
If you are able I would recommend using docker-compose 3.0 instead of 1.0. The 'links' attribute is deprecated in 3.0 which now favors just setting up a simple user-defined bridge network. Your docker-compose would be as follows:
version: 3.0
services:
phython:
image: python:latest
networks:
- my-net
dotnetcore:
image: microsoft/aspnetcore:2.0
networks:
- my-net
networks:
my-net:
driver: bridge
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With