Two weeks ago I created a docker-compose.yml file to start two services, but this week when I try to start those services Docker appends a "-1" to the service name. I am using Docker Desktop on a Windows 10 machine. Here is my yml file:
services:
pgdatabase:
image: postgres:13
environment:
- POSTGRES_USER=####
- POSTGRES_PASSWORD=####
- POSTGRES_DB=ny_taxi
volumes:
- "./ny_taxi_postgres_data:/var/lib/postgresql/data:rw"
ports:
- "5432:5432"
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=####@####.com
- PGADMIN_DEFAULT_PASSWORD=####
ports:
- "8080:80"
This worked perfectly when I created it, but now when I run docker-compose up
the containers that get created are pgadmin-1
and pgdatabase-1
.
If I then run docker-compose down
, and do a docker ps
the output shows that no containers are running. However, if I run docker-compose config --services
I get the following:
pgadmin
pgdatabase
Restarting Docker does nothing, and the issue occurs even if I delete all containers and all volumes from Docker Desktop.
docker-compose start
returns service "pgadmin" has no container to start
. If I run docker-compose up
and then docker-compose start pgadmin
I get no output from the command line. However, listing the active containers after doing this still only shows pgadmin-1
. Running docker-compose down
after these steps does not resolve the issue.
docker rm -f pgadmin
returns Error: No such container: pgadmin
.
docker service rm pgadmin
returns Error: No such service: pgadmin
.
docker-compose up -d --force-recreate --renew-anon-volumes
just creates pgadmin-1
and pgdatabase-1
again.