0

I have a docker-compose.yml file like this:

version: "3.7"
services:
    server:
        build: .
        ports:
            - "3000:3000"

so my service name is server. When i try to do this:

docker-compose exec server sh

it gives me an error:

ERROR: No container found for server_1

why is it changing my param from server to server_1? and what's the correct way to run this command? I tried this too:

docker-compose ps

// output: name: website-service-api_server_run_dfb252d8a1fc
// then

docker-compose exec website-service-api_server_run_dfb252d8a1fc sh

same error:

ERROR: No such service: website-service-api_server_run_dfb252d8a1fc

2
  • Did you use up or run to start the container?
    – chash
    Jun 11, 2020 at 18:23
  • i used run to start it Jun 11, 2020 at 18:24

0

Browse other questions tagged or ask your own question.