Pycharm remote interpreter using docker-compose not working in debug mode - docker

I have a Pycharm remote interpreter setup using docker-compose, I am able to run the project fine but when trying to debug I am getting this error:
ERROR: for e21cea317159_my_proj Cannot create container for service myproj: conflicting options: port publishing and the container type network mode
My docker-compose file:
version: '1.0'
services:
my-router:
image: testimage:latest
dns: 10.10.10.10
dns_search:
- testwebsite.com
et:
build:
context: ""
dockerfile: Dockerfile
volumes:
- .:/workarea
depends_on:
- "my-router"
environment:
- WAIT_FOR_PORTS=my-router:12345
network_mode: service:my-router
Thanks for the help!

Related

Docker compose showing networks as unsupported config for services

I am using docker-compose version 1.25.0, build unknown I have built two backend APIs that need to communicate with each other. Below is my docker-compose.yml file.
version: '0.1'
services:
user_api:
build: ./users
ports:
- "5002:5000"
command: bash start.sh
networks:
- api_network
posts_api:
build: ./posts
links:
- user_api
ports:
- "5001:5000"
command: bash start.sh
networks:
- api_network
networks:
api_network:
driver: bridge
I am getting the following error:
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for posts_api: 'networks'
Unsupported config option for user_api: 'networks'
I referred to the docker-compose documentation: https://docs.docker.com/compose/networking/
I cannot understand why it is showing unsupported. Please help.

OSRM Server setup using docker-compose - container exited

I'm trying to setup the OSRM server on the top of Docker. I need to configure it using docker-compose.yml in side my micro-services project using .net core.
version: '3.4'
services:
test_web:
image: ${DOCKER_REGISTRY-}osrmweb
build:
context: .
dockerfile: OSRM_WEB/Dockerfile
ports:
- 1111
osrm-data:
image: irony/osrm5
volumes:
- /data
osrm:
image: irony/osrm5
volumes:
- osrm-data
ports:
- 5000:5000
command: ./start.sh Sweden http://download.geofabrik.de/europe/sweden-latest.osm.pbf
I have this docker-compose.yml file. When I run the docker-compose up There is no error but the container is Exited.
I cant see any response in this url.
https://localhost:5000/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
Any thing else I need to do in configurations? Any suggestions?

Docker Compose up command times out frequently

I am using Docker For Windows and have a set of images that are already built on my docker host. When I try to use the docker-compose up -d command to start my environment, I frequently face i/o timeout errors for different containers. Usually, retrying helps but I am trying to automate this and can't expect to re-run the whole pipeline.
Versions:
Docker version 18.09.0, build 4d60db4
docker-compose version 1.23.1, build b02f1306
Command line logs:
C:\workspace\AK_DOCKER_RISK\docker-compose>docker-compose up -d
Creating risk-svc ...
Creating risk-svc ... done
Creating risk-prc ...
Creating risk-web ...
Creating risk-web ... error
ERROR: for risk-web b'i/o timeout'
Creating risk-prc ... done
ERROR: for web b'i/o timeout'
Encountered errors while bringing up the project.
The error is observed randomly, sometimes for svc, or web or prc.
Can someone please explain why this error is occurring and more importantly - how to solve this issue?
This is my docker-compose.yml file:
version: '3'
services:
web:
image: iis-core-web:1910.252
build:
context: .
dockerfile: ./web/Dockerfile
container_name: risk-web
ports:
- "9111:8080"
tty: true
links:
- svc
volumes:
- ../RiskLogs/web:c:/RiskLogs
svc:
image: iis-core-svc:1910.252
build:
context: .
dockerfile: ./svc/Dockerfile
container_name: risk-svc
ports:
- "9112:8080"
tty: true
volumes:
- ../RiskLogs/svc:c:/RiskLogs
prc:
image: iis-core-prc:1910.252
build:
context: .
dockerfile: ./prc/Dockerfile
container_name: risk-prc
tty: true
links:
- svc
volumes:
- ../RiskLogs/prc:c:/RiskLogs
# prevent creation of new network and use existing nat
networks:
default:
external:
name: nat
Links is a legacy feature. Try user defined networks instead as per docs:
https://docs.docker.com/compose/compose-file/#links

Aspnet core application is not running after docker host or container restart

I'm running containers with restart policy as always through docker-compose, it has two images RabbitMq & AspNetCore,it all works fine for the first time.
when I restart the host or docker containers then RabbitMq is running fine and accessible through localhost:8080 even after restarting, but aspnet core project container is running but I can't access through internal and external ( localhost:5001/api/home/get) ports.
Docker compose
version: '3.4'
services:
aspnetcoreenvironmentvariables.api:
image: aspnetcoreenvironmentvariables
build:
context: .
dockerfile: AspNetCoreEnvironmentVariables.API/Dockerfile
restart: always
depends_on:
- rabbitmq
rabbitmq:
image: rabbitmq:3-management
restart: always
Docker compose override
version: '3.4'
services:
aspnetcoreenvironmentvariables.api:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection="connection"
ports:
- "5001:80"
rabbitmq:
ports:
- "8080:15672"
Below is error from docker

docker-machine instance not running on port 8080

I am trying to get this tutorial to work. But at the end of the tutorial it says to run http://192.168.99.100:8080 and see your website. But it is not showing up for me at all after running docker-machine ls. There are no entries at all. So my question is how can I get a docker-machine instance running on an nginx container? I assume that is the one that runs the wwwroot folder, that is what points to it and has all of the port and root calls for the server.
My code in the docker-compose.yml is the same as the tutorial but here it is:
version: '2'
services:
nginx:
build:
context: .
dockerfile: docker.nginx
image: my-nginx
container_name: my-nginx-container
ports:
- "8080:8080"
volumes:
- wwwroot:/wwwroot
webpack:
build:
context: .
dockerfile: docker.webpack
image: my-webpack
container_name: my-webpack-container
ports:
- "35729:35729"
volumes:
- ./app:/app
- /app/node_modules
- wwwroot:/wwwroot
volumes:
wwwroot:
driver: local
From the comments, it has been established that your docker machine is running and the server you are trying to run is running on localhost:8080.
Before you run docker compose up, make sure that the directory contains other required files and folders, examplenginx.conf and index.html.

Resources