When I run docker-compose up
, I get this error:
root@ubuntu:/home/benson/Docker/HaproxyMy# docker-compose up
Recreating 950ddc308278_950ddc308278_950ddc308278_950ddc308278_950ddc308278_haproxymy_webb_1
Recreating 485800bdf3a1_485800bdf3a1_485800bdf3a1_485800bdf3a1_485800bdf3a1_haproxymy_webc_1
Recreating 2b3338d88716_2b3338d88716_2b3338d88716_2b3338d88716_2b3338d88716_haproxymy_weba_1
ERROR: for webb No such image: sha256:15853e771e7ca3f5eecee38fcf97efd3ee164c1b66e2ef543d9985a04e78e099
ERROR: for webc No such image: sha256:15853e771e7ca3f5eecee38fcf97efd3ee164c1b66e2ef543d9985a04e78e099
ERROR: for weba No such image: sha256:15853e771e7ca3f5eecee38fcf97efd3ee164c1b66e2ef543d9985a04e78e099
docker-compose.yml
:
weba:
build: ./web
expose:
- 80
webb:
build: ./web
expose:
- 80
webc:
build: ./web
expose:
- 80
haproxy:
image: haproxy:latest
volumes:
- ./haproxy:/haproxy-override
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
links:
- weba
- webb
- webc
ports:
- "80:80"
- "70:70"
expose:
- "80"
- "70"
Problem was solved for me by doing
finding the problematic container name and then (note running
docker
here)The old cache caused this issue, I failed to run this command the first time and docker-compose already created images which I can't see from
docker images
.Need to check from
docker-compose ps
, and remove all old images with this commanddocker-compose rm
, then rebuild again.Examples using weba, webb and webc like "How to use Docker Compose to run complex multi container apps on your Raspberry Pi" suppose that you are building those images.
Meaning you have (in
/home/benson/Docker/HaproxyMy
) aDockerfile
like this one which will be interpreted by the build . to build those images.To solve this issue
To see all images
I encountered this error when using Docker Machine on Windows.
A container seems to have gone rogue;
docker-compose rm --all
caused the whole shell to freeze and restarting Docker Machine didn't help either, the container still showed up when doingdocker-compose ps
.The solution was to execute
docker-compose down
.