Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Compose file to Create a container with multiple Images

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 .

like image 465
Rahul Bhat Avatar asked Oct 15 '25 18:10

Rahul Bhat


1 Answers

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
like image 177
user1505520 Avatar answered Oct 18 '25 05:10

user1505520



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!