Please can someone help and advise me why I am unable to update my docker containers. I am new to docker having installed it recently to setup Home Assistant running as a Docker Container.
I am trying to update my installed docker containers but unfortunately I am getting errors which is preventing this.
Below is a copy of my docker-compose.yaml file
version: '3.0'
services:
portainer:
container_name: portainer
image: portainer/portainer-ce
restart: always
ports:
- "9000:9000/tcp"
environment:
- TZ=Europe/London
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/portainer:/data
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /opt/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host
duplicati:
image: lscr.io/linuxserver/duplicati:latest
container_name: duplicati
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- CLI_ARGS= #optional
volumes:
- /opt/duplicati/config:/config
- /opt:/source
ports:
- 8200:8200
restart: unless-stopped
I used ‘docker-compose -pull’ to download the latest images
I used ‘docker-compose up -d’ to recreate the containers but unfortunately I get the following errors and being new to Docker would appreciate some help in how to solve them (there maybe some typos below):
pete@pemserv:/opts docker-compose up -d
portainer is up-to-date
Recreating d8054f762d8b_homeassistant …
Recreating 12cbcde9fcde_duplicati …
ERROR: for 12cbcde9fcde_duplicati ‘ContainerConfig’
ERROR: for d8054f762d8b_homeassistant ‘ContainerConfig’
ERROR: for duplicati ‘ContainerConfig’
ERROR: for homeassistant ‘ContainerConfig’
Traceback (most recent call last):
File “docker-compose”, line 3, in
File “compose/cli/main.py” line 81, in main
File "compose/cli/main.py, line 203, in perform_command
File "compose/cli/main.py, the 203, in perform.command
File “compose/metrics/decorator.py”, line 18, in wrapper
File “compose/chi/main.py”, line 1186, in up
File "compose/project.py, line 1182, in up
File “compose/parallel.py”, line 702, in up
File “compose/parallel.py”, 108, in parallel_execute
File "compose/parallel.py, line 206, in producer
File “compose/project.py”, line 688, in do
File “compose/service.py”, Line 581, in -execute convergence-ren
File “compose/service.py”, line 503, in _execute_convergence_recreate
File "compose/parallel.py, line 108, in parallel_execute
File "compose/parallel.py, line 206, in producer
File “compose/service.py”, line 496, in recreate
File “compose/service.py”, line 615, in recreate_container
File “compose/service.py”, line 334, in create_container
File “compose/service.py”, line 922, in _get_container_create_options
File “compose/service.py”, line 962, in_build_container_volume_options
File “compose/service.py”, line 1549, in merge_volume_bindings
File “compose/service.py”, line 1579, in get_container _data_volumes
KeyError:"ContainerConfig’
[2647] Failed to execute script docker-compose
Some research revealed that possibly the “docker-compose up” command had been replaced by “docker compose up”. However, when I executed “docker compose up -d” I get the following response:
WARN[0000] /opt/docker-compose.yaml: ‘version’ is obsolete
[+] Running 0/3
Container portainer Recreate
Container abc…_duplicati Recreate
Container d8054f762d8b_homeassistant Recreate
Error response from daemon: Conflict. The container name “d8054f762d8b_homeassistant” is already in use by container “xyz”. . You have to remove (or rename) that container to be able to reuse that name.
Thanks in anticipation.